Commit 07d6b7f5 authored by Andreas Frisch's avatar Andreas Frisch Committed by Sebastian Dröge

lcms: Add LCMS ICC color correction element

https://bugzilla.gnome.org/show_bug.cgi?id=765927
parent 519ead24
......@@ -2480,6 +2480,15 @@ AG_GST_CHECK_FEATURE(LADSPA, [ladspa], ladspa, [
AC_SUBST(LRDF_CFLAGS)
])
dnl *** LCM2 ***
#translit(dnm, m, l) AM_CONDITIONAL(USE_LCMS2, true)
AG_GST_CHECK_FEATURE(LCMS2, [LCMS colormanagement plugin], lcms2, [
PKG_CHECK_MODULES(LCMS2, lcms2 >= 2.7, HAVE_LCMS2="yes", [
HAVE_LCMS2="no"
])
AC_SUBST(LCMS2_LIBS)
])
dnl *** LV2 ***
translit(dnm, m, l) AM_CONDITIONAL(USE_LV2, true)
AG_GST_CHECK_FEATURE(LV2, [lv2], lv2, [
......@@ -3454,6 +3463,7 @@ AM_CONDITIONAL(USE_KATE, false)
AM_CONDITIONAL(USE_KMS, false)
AM_CONDITIONAL(USE_TIGER, false)
AM_CONDITIONAL(USE_LADSPA, false)
AM_CONDITIONAL(USE_LCMS2, false)
AM_CONDITIONAL(USE_LV2, false)
AM_CONDITIONAL(USE_LIBDE265, false)
AM_CONDITIONAL(USE_LIBMMS, false)
......@@ -3739,6 +3749,7 @@ ext/assrender/Makefile
ext/bs2b/Makefile
ext/bz2/Makefile
ext/chromaprint/Makefile
ext/colormanagement/Makefile
ext/curl/Makefile
ext/dash/Makefile
ext/dc1394/Makefile
......
......@@ -22,6 +22,12 @@ else
BZ2_DIR=
endif
if USE_LCMS2
COLORMANAGEMENT_DIR=colormanagement
else
COLORMANAGEMENT_DIR=
endif
if USE_CHROMAPRINT
CHROMAPRINT_DIR=chromaprint
else
......@@ -401,6 +407,7 @@ SUBDIRS=\
$(AUDIOFILE_DIR) \
$(BS2B_DIR) \
$(BZ2_DIR) \
$(COLORMANAGEMENT_DIR) \
$(CHROMAPRINT_DIR) \
$(CURL_DIR) \
$(DASH_DIR) \
......@@ -467,6 +474,7 @@ DIST_SUBDIRS = \
assrender \
bs2b \
bz2 \
colormanagement \
chromaprint \
curl \
dash \
......
plugin_LTLIBRARIES = libgstcolormanagement.la
libgstcolormanagement_la_SOURCES = gstcolormanagement.c \
gstlcms.c
libgstcolormanagement_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(LCMS2_CFLAGS)
libgstcolormanagement_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstvideo-1.0 $(GST_LIBS) $(LCMS2_LIBS)
libgstcolormanagement_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstcolormanagement_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
noinst_HEADERS = gstlcms.h
/*
* GStreamer gstreamer-colormanagement
* Copyright (C) 2016 Andreas Frisch <fraxinas@dreambox.guru>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstlcms.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
return gst_element_register (plugin, "lcms", GST_RANK_NONE, GST_TYPE_LCMS);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
colormanagement,
"Color management correction plugins",
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
This diff is collapsed.
/*
* GStreamer gstreamer-lcms
* Copyright (C) 2016 Andreas Frisch <fraxinas@dreambox.guru>
*
* gstlcms.h
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_LCMS_H__
#define __GST_LCMS_H__
#include <gst/gst.h>
#include <gst/video/video.h>
#include <gst/video/gstvideofilter.h>
#include <lcms2.h>
G_BEGIN_DECLS
typedef enum
{
GST_LCMS_INTENT_PERCEPTUAL = 0,
GST_LCMS_INTENT_RELATIVE_COLORIMETRIC,
GST_LCMS_INTENT_SATURATION,
GST_LCMS_INTENT_ABSOLUTE_COLORIMETRIC,
} GstLcmsIntent;
#define GST_TYPE_LCMS_INTENT (gst_lcms_intent_get_type ())
typedef enum
{
GST_LCMS_LOOKUP_METHOD_UNCACHED = 0,
GST_LCMS_LOOKUP_METHOD_PRECALCULATED,
GST_LCMS_LOOKUP_METHOD_CACHED,
GST_LCMS_LOOKUP_METHOD_FILE,
} GstLcmsLookupMethod;
#define GST_TYPE_LCMS_LOOKUP_METHOD (gst_lcms_lookup_method_get_type ())
#define GST_TYPE_LCMS (gst_lcms_get_type())
#define GST_LCMS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_LCMS,GstLcms))
#define GST_LCMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_LCMS,GstLcmsClass))
#define GST_LCMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_LCMS,GstLcmsClass))
#define GST_IS_LCMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_LCMS))
#define GST_IS_LCMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_LCMS))
typedef struct _GstLcms GstLcms;
typedef struct _GstLcmsClass GstLcmsClass;
/**
* GstLcms:
*
* Opaque data structure.
*/
struct _GstLcms
{
GstVideoFilter videofilter;
/* < private > */
gboolean embeddedprofiles;
GstLcmsIntent intent;
GstLcmsLookupMethod lookup_method;
cmsHPROFILE cms_inp_profile, cms_dst_profile;
cmsHTRANSFORM cms_transform;
cmsUInt32Number cms_inp_format, cms_dst_format;
gchar *inp_profile_filename;
gchar *dst_profile_filename;
guint32 *color_lut;
gboolean preserve_black;
void (*process) (GstLcms * lcms, GstVideoFrame * inframe,
GstVideoFrame * outframe);
};
struct _GstLcmsClass
{
GstVideoFilterClass parent_class;
};
G_GNUC_INTERNAL GType gst_lcms_get_type (void);
G_GNUC_INTERNAL GType gst_lcms_intent_get_type (void);
G_END_DECLS
#endif /* __GST_LCMS_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment