libgimpcolor: rename the gimp_lcms_*() functions to gimp_color_profile_*()
because it doesn't make sense to call the typedef GimpColorProfile but the function namespace gimp_lcms_*().
This commit is contained in:
@ -78,9 +78,9 @@ gimp_image_validate_icc_profile (GimpImage *image,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
profile = gimp_lcms_profile_open_from_data (gimp_parasite_data (icc_profile),
|
profile = gimp_color_profile_open_from_data (gimp_parasite_data (icc_profile),
|
||||||
gimp_parasite_data_size (icc_profile),
|
gimp_parasite_data_size (icc_profile),
|
||||||
error);
|
error);
|
||||||
|
|
||||||
if (! profile)
|
if (! profile)
|
||||||
{
|
{
|
||||||
@ -88,16 +88,16 @@ gimp_image_validate_icc_profile (GimpImage *image,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! gimp_lcms_profile_is_rgb (profile))
|
if (! gimp_color_profile_is_rgb (profile))
|
||||||
{
|
{
|
||||||
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
|
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
|
||||||
_("ICC profile validation failed: "
|
_("ICC profile validation failed: "
|
||||||
"Color profile is not for RGB color space"));
|
"Color profile is not for RGB color space"));
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -141,9 +141,9 @@ gimp_image_get_color_profile (GimpImage *image,
|
|||||||
parasite = gimp_image_get_icc_profile (image);
|
parasite = gimp_image_get_icc_profile (image);
|
||||||
|
|
||||||
if (parasite)
|
if (parasite)
|
||||||
return gimp_lcms_profile_open_from_data (gimp_parasite_data (parasite),
|
return gimp_color_profile_open_from_data (gimp_parasite_data (parasite),
|
||||||
gimp_parasite_data_size (parasite),
|
gimp_parasite_data_size (parasite),
|
||||||
error);
|
error);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -163,7 +163,7 @@ gimp_image_set_color_profile (GimpImage *image,
|
|||||||
guint8 *data;
|
guint8 *data;
|
||||||
gsize length;
|
gsize length;
|
||||||
|
|
||||||
data = gimp_lcms_profile_save_to_data (profile, &length, error);
|
data = gimp_color_profile_save_to_data (profile, &length, error);
|
||||||
if (! data)
|
if (! data)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -1405,9 +1405,9 @@ gimp_image_color_managed_get_color_profile (GimpColorManaged *managed)
|
|||||||
const Babl *format = gimp_image_get_layer_format (image, FALSE);
|
const Babl *format = gimp_image_get_layer_format (image, FALSE);
|
||||||
|
|
||||||
if (gimp_babl_format_get_linear (format))
|
if (gimp_babl_format_get_linear (format))
|
||||||
profile = gimp_lcms_create_linear_rgb_profile ();
|
profile = gimp_color_profile_new_linear_rgb ();
|
||||||
else
|
else
|
||||||
profile = gimp_lcms_create_srgb_profile ();
|
profile = gimp_color_profile_new_srgb ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return profile;
|
return profile;
|
||||||
|
@ -459,9 +459,9 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
|
|||||||
profile = gimp_color_managed_get_color_profile (managed);
|
profile = gimp_color_managed_get_color_profile (managed);
|
||||||
|
|
||||||
i += print (title, title_len, i, "%s",
|
i += print (title, title_len, i, "%s",
|
||||||
gimp_lcms_profile_get_label (profile));
|
gimp_color_profile_get_label (profile));
|
||||||
|
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1148,7 +1148,7 @@ gimp_display_shell_get_color_profile (GimpColorManaged *managed)
|
|||||||
return gimp_color_managed_get_color_profile (GIMP_COLOR_MANAGED (image));
|
return gimp_color_managed_get_color_profile (GIMP_COLOR_MANAGED (image));
|
||||||
|
|
||||||
/* never return a NULL profile */
|
/* never return a NULL profile */
|
||||||
return gimp_lcms_create_srgb_profile ();;
|
return gimp_color_profile_new_srgb ();;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -112,5 +112,5 @@ gimp_image_profile_view_update (GimpImageParasiteView *view)
|
|||||||
|
|
||||||
gimp_color_profile_view_set_profile (profile_view->profile_view, profile);
|
gimp_color_profile_view_set_profile (profile_view->profile_view, profile);
|
||||||
|
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
}
|
}
|
||||||
|
@ -18,11 +18,11 @@
|
|||||||
<xi:include href="xml/gimpcmyk.xml" />
|
<xi:include href="xml/gimpcmyk.xml" />
|
||||||
<xi:include href="xml/gimpcolorspace.xml" />
|
<xi:include href="xml/gimpcolorspace.xml" />
|
||||||
<xi:include href="xml/gimpcolormanaged.xml" />
|
<xi:include href="xml/gimpcolormanaged.xml" />
|
||||||
|
<xi:include href="xml/gimpcolorprofile.xml" />
|
||||||
<xi:include href="xml/gimpadaptivesupersample.xml" />
|
<xi:include href="xml/gimpadaptivesupersample.xml" />
|
||||||
<xi:include href="xml/gimpbilinear.xml" />
|
<xi:include href="xml/gimpbilinear.xml" />
|
||||||
<xi:include href="xml/gimpcairo.xml" />
|
<xi:include href="xml/gimpcairo.xml" />
|
||||||
<xi:include href="xml/gimppixbuf.xml" />
|
<xi:include href="xml/gimppixbuf.xml" />
|
||||||
<xi:include href="xml/gimplcms.xml" />
|
|
||||||
</part>
|
</part>
|
||||||
|
|
||||||
<index id="api-index-full">
|
<index id="api-index-full">
|
||||||
|
@ -30,28 +30,6 @@ gimp_hsv_get_type
|
|||||||
gimp_hsl_get_type
|
gimp_hsl_get_type
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
|
||||||
<FILE>gimplcms</FILE>
|
|
||||||
GimpColorProfile
|
|
||||||
GimpColorTransform
|
|
||||||
gimp_lcms_profile_open_from_file
|
|
||||||
gimp_lcms_profile_open_from_data
|
|
||||||
gimp_lcms_profile_close
|
|
||||||
gimp_lcms_profile_save_to_data
|
|
||||||
gimp_lcms_profile_get_description
|
|
||||||
gimp_lcms_profile_get_manufacturer
|
|
||||||
gimp_lcms_profile_get_model
|
|
||||||
gimp_lcms_profile_get_copyright
|
|
||||||
gimp_lcms_profile_get_label
|
|
||||||
gimp_lcms_profile_get_summary
|
|
||||||
gimp_lcms_profile_is_equal
|
|
||||||
gimp_lcms_profile_is_rgb
|
|
||||||
gimp_lcms_profile_is_cmyk
|
|
||||||
gimp_lcms_create_srgb_profile
|
|
||||||
gimp_lcms_create_linear_rgb_profile
|
|
||||||
gimp_lcms_get_format
|
|
||||||
</SECTION>
|
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gimppixbuf</FILE>
|
<FILE>gimppixbuf</FILE>
|
||||||
gimp_pixbuf_get_format
|
gimp_pixbuf_get_format
|
||||||
@ -155,6 +133,29 @@ GIMP_COLOR_MANAGED_GET_INTERFACE
|
|||||||
gimp_color_managed_interface_get_type
|
gimp_color_managed_interface_get_type
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
|
<SECTION>
|
||||||
|
<FILE>gimpcolorprofile</FILE>
|
||||||
|
<TITLE>GimpColorProfile</TITLE>
|
||||||
|
GimpColorProfile
|
||||||
|
GimpColorTransform
|
||||||
|
gimp_color_profile_open_from_file
|
||||||
|
gimp_color_profile_open_from_data
|
||||||
|
gimp_color_profile_save_to_data
|
||||||
|
gimp_color_profile_close
|
||||||
|
gimp_color_profile_get_description
|
||||||
|
gimp_color_profile_get_manufacturer
|
||||||
|
gimp_color_profile_get_model
|
||||||
|
gimp_color_profile_get_copyright
|
||||||
|
gimp_color_profile_get_label
|
||||||
|
gimp_color_profile_get_summary
|
||||||
|
gimp_color_profile_is_equal
|
||||||
|
gimp_color_profile_is_rgb
|
||||||
|
gimp_color_profile_is_cmyk
|
||||||
|
gimp_color_profile_new_srgb
|
||||||
|
gimp_color_profile_new_linear_rgb
|
||||||
|
gimp_color_profile_get_format
|
||||||
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gimpadaptivesupersample</FILE>
|
<FILE>gimpadaptivesupersample</FILE>
|
||||||
<TITLE>GimpAdaptiveSupersample</TITLE>
|
<TITLE>GimpAdaptiveSupersample</TITLE>
|
||||||
|
@ -74,14 +74,14 @@ libgimpcolor_@GIMP_API_VERSION@_la_SOURCES = \
|
|||||||
gimpcmyk.h \
|
gimpcmyk.h \
|
||||||
gimpcolormanaged.c \
|
gimpcolormanaged.c \
|
||||||
gimpcolormanaged.h \
|
gimpcolormanaged.h \
|
||||||
|
gimpcolorprofile.c \
|
||||||
|
gimpcolorprofile.h \
|
||||||
gimpcolorspace.c \
|
gimpcolorspace.c \
|
||||||
gimpcolorspace.h \
|
gimpcolorspace.h \
|
||||||
gimphsl.c \
|
gimphsl.c \
|
||||||
gimphsl.h \
|
gimphsl.h \
|
||||||
gimphsv.c \
|
gimphsv.c \
|
||||||
gimphsv.h \
|
gimphsv.h \
|
||||||
gimplcms.c \
|
|
||||||
gimplcms.h \
|
|
||||||
gimppixbuf.c \
|
gimppixbuf.c \
|
||||||
gimppixbuf.h \
|
gimppixbuf.h \
|
||||||
gimprgb.c \
|
gimprgb.c \
|
||||||
@ -96,10 +96,10 @@ libgimpcolorinclude_HEADERS = \
|
|||||||
gimpcairo.h \
|
gimpcairo.h \
|
||||||
gimpcmyk.h \
|
gimpcmyk.h \
|
||||||
gimpcolormanaged.h \
|
gimpcolormanaged.h \
|
||||||
|
gimpcolorprofile.h \
|
||||||
gimpcolorspace.h \
|
gimpcolorspace.h \
|
||||||
gimphsl.h \
|
gimphsl.h \
|
||||||
gimphsv.h \
|
gimphsv.h \
|
||||||
gimplcms.h \
|
|
||||||
gimppixbuf.h \
|
gimppixbuf.h \
|
||||||
gimprgb.h
|
gimprgb.h
|
||||||
|
|
||||||
|
@ -25,6 +25,22 @@ EXPORTS
|
|||||||
gimp_color_managed_get_icc_profile
|
gimp_color_managed_get_icc_profile
|
||||||
gimp_color_managed_interface_get_type
|
gimp_color_managed_interface_get_type
|
||||||
gimp_color_managed_profile_changed
|
gimp_color_managed_profile_changed
|
||||||
|
gimp_color_profile_close
|
||||||
|
gimp_color_profile_get_copyright
|
||||||
|
gimp_color_profile_get_description
|
||||||
|
gimp_color_profile_get_format
|
||||||
|
gimp_color_profile_get_label
|
||||||
|
gimp_color_profile_get_manufacturer
|
||||||
|
gimp_color_profile_get_model
|
||||||
|
gimp_color_profile_get_summary
|
||||||
|
gimp_color_profile_is_cmyk
|
||||||
|
gimp_color_profile_is_equal
|
||||||
|
gimp_color_profile_is_rgb
|
||||||
|
gimp_color_profile_new_linear_rgb
|
||||||
|
gimp_color_profile_new_srgb
|
||||||
|
gimp_color_profile_open_from_data
|
||||||
|
gimp_color_profile_open_from_file
|
||||||
|
gimp_color_profile_save_to_data
|
||||||
gimp_hsl_get_type
|
gimp_hsl_get_type
|
||||||
gimp_hsl_set
|
gimp_hsl_set
|
||||||
gimp_hsl_set_alpha
|
gimp_hsl_set_alpha
|
||||||
@ -38,22 +54,6 @@ EXPORTS
|
|||||||
gimp_hsv_to_rgb_int
|
gimp_hsv_to_rgb_int
|
||||||
gimp_hsva_set
|
gimp_hsva_set
|
||||||
gimp_hwb_to_rgb
|
gimp_hwb_to_rgb
|
||||||
gimp_lcms_create_linear_rgb_profile
|
|
||||||
gimp_lcms_create_srgb_profile
|
|
||||||
gimp_lcms_get_format
|
|
||||||
gimp_lcms_profile_close
|
|
||||||
gimp_lcms_profile_get_copyright
|
|
||||||
gimp_lcms_profile_get_description
|
|
||||||
gimp_lcms_profile_get_label
|
|
||||||
gimp_lcms_profile_get_manufacturer
|
|
||||||
gimp_lcms_profile_get_model
|
|
||||||
gimp_lcms_profile_get_summary
|
|
||||||
gimp_lcms_profile_is_cmyk
|
|
||||||
gimp_lcms_profile_is_equal
|
|
||||||
gimp_lcms_profile_is_rgb
|
|
||||||
gimp_lcms_profile_open_from_data
|
|
||||||
gimp_lcms_profile_open_from_file
|
|
||||||
gimp_lcms_profile_save_to_data
|
|
||||||
gimp_param_rgb_get_type
|
gimp_param_rgb_get_type
|
||||||
gimp_param_spec_rgb
|
gimp_param_spec_rgb
|
||||||
gimp_param_spec_rgb_has_alpha
|
gimp_param_spec_rgb_has_alpha
|
||||||
|
@ -27,11 +27,11 @@
|
|||||||
#include <libgimpcolor/gimpbilinear.h>
|
#include <libgimpcolor/gimpbilinear.h>
|
||||||
#include <libgimpcolor/gimpcairo.h>
|
#include <libgimpcolor/gimpcairo.h>
|
||||||
#include <libgimpcolor/gimpcolormanaged.h>
|
#include <libgimpcolor/gimpcolormanaged.h>
|
||||||
|
#include <libgimpcolor/gimpcolorprofile.h>
|
||||||
#include <libgimpcolor/gimpcolorspace.h>
|
#include <libgimpcolor/gimpcolorspace.h>
|
||||||
#include <libgimpcolor/gimpcmyk.h>
|
#include <libgimpcolor/gimpcmyk.h>
|
||||||
#include <libgimpcolor/gimphsl.h>
|
#include <libgimpcolor/gimphsl.h>
|
||||||
#include <libgimpcolor/gimphsv.h>
|
#include <libgimpcolor/gimphsv.h>
|
||||||
#include <libgimpcolor/gimplcms.h>
|
|
||||||
#include <libgimpcolor/gimppixbuf.h>
|
#include <libgimpcolor/gimppixbuf.h>
|
||||||
#include <libgimpcolor/gimprgb.h>
|
#include <libgimpcolor/gimprgb.h>
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "gimpcolortypes.h"
|
#include "gimpcolortypes.h"
|
||||||
|
|
||||||
#include "gimpcolormanaged.h"
|
#include "gimpcolormanaged.h"
|
||||||
#include "gimplcms.h"
|
#include "gimpcolorprofile.h"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -135,7 +135,7 @@ gimp_color_managed_get_icc_profile (GimpColorManaged *managed,
|
|||||||
* @managed: an object the implements the #GimpColorManaged interface
|
* @managed: an object the implements the #GimpColorManaged interface
|
||||||
*
|
*
|
||||||
* This function always returns a #GimpColorProfile and falls back to
|
* This function always returns a #GimpColorProfile and falls back to
|
||||||
* gimp_lcms_create_srgb_profile() if the method is not implemented.
|
* gimp_color_profile_new_srgb() if the method is not implemented.
|
||||||
*
|
*
|
||||||
* Return value: The @managed's #GimpColorProfile.
|
* Return value: The @managed's #GimpColorProfile.
|
||||||
*
|
*
|
||||||
@ -154,7 +154,7 @@ gimp_color_managed_get_color_profile (GimpColorManaged *managed)
|
|||||||
return iface->get_color_profile (managed);
|
return iface->get_color_profile (managed);
|
||||||
|
|
||||||
/* never return a NULL profile */
|
/* never return a NULL profile */
|
||||||
return gimp_lcms_create_srgb_profile ();
|
return gimp_color_profile_new_srgb ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* LIBGIMP - The GIMP Library
|
/* LIBGIMP - The GIMP Library
|
||||||
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
||||||
*
|
*
|
||||||
* gimplcms.c
|
* gimpcolorprofile.c
|
||||||
* Copyright (C) 2014 Michael Natterer <mitch@gimp.org>
|
* Copyright (C) 2014 Michael Natterer <mitch@gimp.org>
|
||||||
* Elle Stone <ellestone@ninedegreesbelow.com>
|
* Elle Stone <ellestone@ninedegreesbelow.com>
|
||||||
*
|
*
|
||||||
@ -33,14 +33,14 @@
|
|||||||
|
|
||||||
#include "gimpcolortypes.h"
|
#include "gimpcolortypes.h"
|
||||||
|
|
||||||
#include "gimplcms.h"
|
#include "gimpcolorprofile.h"
|
||||||
|
|
||||||
#include "libgimp/libgimp-intl.h"
|
#include "libgimp/libgimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION: gimplcms
|
* SECTION: gimpcolorprofile
|
||||||
* @title: GimpLcms
|
* @title: GimpColorProfile
|
||||||
* @short_description: Definitions and Functions relating to LCMS.
|
* @short_description: Definitions and Functions relating to LCMS.
|
||||||
*
|
*
|
||||||
* Definitions and Functions relating to LCMS.
|
* Definitions and Functions relating to LCMS.
|
||||||
@ -59,18 +59,18 @@
|
|||||||
|
|
||||||
|
|
||||||
static GQuark
|
static GQuark
|
||||||
gimp_lcms_error_quark (void)
|
gimp_color_profile_error_quark (void)
|
||||||
{
|
{
|
||||||
static GQuark quark = 0;
|
static GQuark quark = 0;
|
||||||
|
|
||||||
if (G_UNLIKELY (quark == 0))
|
if (G_UNLIKELY (quark == 0))
|
||||||
quark = g_quark_from_static_string ("gimp-lcms-error-quark");
|
quark = g_quark_from_static_string ("gimp-color-profile-error-quark");
|
||||||
|
|
||||||
return quark;
|
return quark;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_profile_open_from_file:
|
* gimp_color_profile_open_from_file:
|
||||||
* @file: a #GFile
|
* @file: a #GFile
|
||||||
* @error: return location for #GError
|
* @error: return location for #GError
|
||||||
*
|
*
|
||||||
@ -82,8 +82,8 @@ gimp_lcms_error_quark (void)
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
GimpColorProfile
|
GimpColorProfile
|
||||||
gimp_lcms_profile_open_from_file (GFile *file,
|
gimp_color_profile_open_from_file (GFile *file,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GimpColorProfile profile = NULL;
|
GimpColorProfile profile = NULL;
|
||||||
gchar *path;
|
gchar *path;
|
||||||
@ -148,7 +148,7 @@ gimp_lcms_profile_open_from_file (GFile *file,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! profile && error && *error == NULL)
|
if (! profile && error && *error == NULL)
|
||||||
g_set_error (error, gimp_lcms_error_quark (), 0,
|
g_set_error (error, gimp_color_profile_error_quark (), 0,
|
||||||
_("'%s' does not appear to be an ICC color profile"),
|
_("'%s' does not appear to be an ICC color profile"),
|
||||||
gimp_file_get_utf8_name (file));
|
gimp_file_get_utf8_name (file));
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ gimp_lcms_profile_open_from_file (GFile *file,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_profile_open_from_data:
|
* gimp_color_profile_open_from_data:
|
||||||
* @data: pointer to memory containing an ICC profile
|
* @data: pointer to memory containing an ICC profile
|
||||||
* @length: lenght of the profile in memory, in bytes
|
* @length: lenght of the profile in memory, in bytes
|
||||||
* @error: return location for #GError
|
* @error: return location for #GError
|
||||||
@ -169,9 +169,9 @@ gimp_lcms_profile_open_from_file (GFile *file,
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
GimpColorProfile
|
GimpColorProfile
|
||||||
gimp_lcms_profile_open_from_data (const guint8 *data,
|
gimp_color_profile_open_from_data (const guint8 *data,
|
||||||
gsize length,
|
gsize length,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GimpColorProfile profile;
|
GimpColorProfile profile;
|
||||||
|
|
||||||
@ -182,14 +182,14 @@ gimp_lcms_profile_open_from_data (const guint8 *data,
|
|||||||
profile = cmsOpenProfileFromMem (data, length);
|
profile = cmsOpenProfileFromMem (data, length);
|
||||||
|
|
||||||
if (! profile)
|
if (! profile)
|
||||||
g_set_error_literal (error, gimp_lcms_error_quark (), 0,
|
g_set_error_literal (error, gimp_color_profile_error_quark (), 0,
|
||||||
_("Data does not appear to be an ICC color profile"));
|
_("Data does not appear to be an ICC color profile"));
|
||||||
|
|
||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_profile_dave_to_data:
|
* gimp_color_profile_dave_to_data:
|
||||||
* @profile: a #GimpColorProfile
|
* @profile: a #GimpColorProfile
|
||||||
* @length: return location for the number of bytes written
|
* @length: return location for the number of bytes written
|
||||||
* @error: return location for #GError
|
* @error: return location for #GError
|
||||||
@ -203,9 +203,9 @@ gimp_lcms_profile_open_from_data (const guint8 *data,
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
guint8 *
|
guint8 *
|
||||||
gimp_lcms_profile_save_to_data (GimpColorProfile profile,
|
gimp_color_profile_save_to_data (GimpColorProfile profile,
|
||||||
gsize *length,
|
gsize *length,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
cmsUInt32Number size;
|
cmsUInt32Number size;
|
||||||
|
|
||||||
@ -227,14 +227,14 @@ gimp_lcms_profile_save_to_data (GimpColorProfile profile,
|
|||||||
g_free (data);
|
g_free (data);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_set_error_literal (error, gimp_lcms_error_quark (), 0,
|
g_set_error_literal (error, gimp_color_profile_error_quark (), 0,
|
||||||
_("Could not save color profile to memory"));
|
_("Could not save color profile to memory"));
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_profile_close:
|
* gimp_color_profile_close:
|
||||||
* @profile: a #GimpColorProfile
|
* @profile: a #GimpColorProfile
|
||||||
*
|
*
|
||||||
* This function closes a #GimpColorProfile and frees its memory.
|
* This function closes a #GimpColorProfile and frees its memory.
|
||||||
@ -242,7 +242,7 @@ gimp_lcms_profile_save_to_data (GimpColorProfile profile,
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
void
|
void
|
||||||
gimp_lcms_profile_close (GimpColorProfile profile)
|
gimp_color_profile_close (GimpColorProfile profile)
|
||||||
{
|
{
|
||||||
g_return_if_fail (profile != NULL);
|
g_return_if_fail (profile != NULL);
|
||||||
|
|
||||||
@ -250,8 +250,8 @@ gimp_lcms_profile_close (GimpColorProfile profile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
gimp_lcms_profile_get_info (GimpColorProfile profile,
|
gimp_color_profile_get_info (GimpColorProfile profile,
|
||||||
cmsInfoType info)
|
cmsInfoType info)
|
||||||
{
|
{
|
||||||
cmsUInt32Number size;
|
cmsUInt32Number size;
|
||||||
gchar *text = NULL;
|
gchar *text = NULL;
|
||||||
@ -276,7 +276,7 @@ gimp_lcms_profile_get_info (GimpColorProfile profile,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_profile_get_description:
|
* gimp_color_profile_get_description:
|
||||||
* @profile: a #GimpColorProfile
|
* @profile: a #GimpColorProfile
|
||||||
*
|
*
|
||||||
* Return value: a newly allocated string containing @profile's
|
* Return value: a newly allocated string containing @profile's
|
||||||
@ -285,13 +285,13 @@ gimp_lcms_profile_get_info (GimpColorProfile profile,
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
gchar *
|
gchar *
|
||||||
gimp_lcms_profile_get_description (GimpColorProfile profile)
|
gimp_color_profile_get_description (GimpColorProfile profile)
|
||||||
{
|
{
|
||||||
return gimp_lcms_profile_get_info (profile, cmsInfoDescription);
|
return gimp_color_profile_get_info (profile, cmsInfoDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_profile_get_manufacturer:
|
* gimp_color_profile_get_manufacturer:
|
||||||
* @profile: a #GimpColorProfile
|
* @profile: a #GimpColorProfile
|
||||||
*
|
*
|
||||||
* Return value: a newly allocated string containing @profile's
|
* Return value: a newly allocated string containing @profile's
|
||||||
@ -300,13 +300,13 @@ gimp_lcms_profile_get_description (GimpColorProfile profile)
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
gchar *
|
gchar *
|
||||||
gimp_lcms_profile_get_manufacturer (GimpColorProfile profile)
|
gimp_color_profile_get_manufacturer (GimpColorProfile profile)
|
||||||
{
|
{
|
||||||
return gimp_lcms_profile_get_info (profile, cmsInfoManufacturer);
|
return gimp_color_profile_get_info (profile, cmsInfoManufacturer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_profile_get_model:
|
* gimp_color_profile_get_model:
|
||||||
* @profile: a #GimpColorProfile
|
* @profile: a #GimpColorProfile
|
||||||
*
|
*
|
||||||
* Return value: a newly allocated string containing @profile's
|
* Return value: a newly allocated string containing @profile's
|
||||||
@ -315,13 +315,13 @@ gimp_lcms_profile_get_manufacturer (GimpColorProfile profile)
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
gchar *
|
gchar *
|
||||||
gimp_lcms_profile_get_model (GimpColorProfile profile)
|
gimp_color_profile_get_model (GimpColorProfile profile)
|
||||||
{
|
{
|
||||||
return gimp_lcms_profile_get_info (profile, cmsInfoModel);
|
return gimp_color_profile_get_info (profile, cmsInfoModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_profile_get_copyright:
|
* gimp_color_profile_get_copyright:
|
||||||
* @profile: a #GimpColorProfile
|
* @profile: a #GimpColorProfile
|
||||||
*
|
*
|
||||||
* Return value: a newly allocated string containing @profile's
|
* Return value: a newly allocated string containing @profile's
|
||||||
@ -330,13 +330,13 @@ gimp_lcms_profile_get_model (GimpColorProfile profile)
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
gchar *
|
gchar *
|
||||||
gimp_lcms_profile_get_copyright (GimpColorProfile profile)
|
gimp_color_profile_get_copyright (GimpColorProfile profile)
|
||||||
{
|
{
|
||||||
return gimp_lcms_profile_get_info (profile, cmsInfoCopyright);
|
return gimp_color_profile_get_info (profile, cmsInfoCopyright);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_profile_get_label:
|
* gimp_color_profile_get_label:
|
||||||
* @profile: a #GimpColorProfile
|
* @profile: a #GimpColorProfile
|
||||||
*
|
*
|
||||||
* This function returns a newly allocated string containing
|
* This function returns a newly allocated string containing
|
||||||
@ -348,13 +348,13 @@ gimp_lcms_profile_get_copyright (GimpColorProfile profile)
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
gchar *
|
gchar *
|
||||||
gimp_lcms_profile_get_label (GimpColorProfile profile)
|
gimp_color_profile_get_label (GimpColorProfile profile)
|
||||||
{
|
{
|
||||||
gchar *label;
|
gchar *label;
|
||||||
|
|
||||||
g_return_val_if_fail (profile != NULL, NULL);
|
g_return_val_if_fail (profile != NULL, NULL);
|
||||||
|
|
||||||
label = gimp_lcms_profile_get_description (profile);
|
label = gimp_color_profile_get_description (profile);
|
||||||
|
|
||||||
if (label && ! strlen (label))
|
if (label && ! strlen (label))
|
||||||
{
|
{
|
||||||
@ -363,7 +363,7 @@ gimp_lcms_profile_get_label (GimpColorProfile profile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! label)
|
if (! label)
|
||||||
label = gimp_lcms_profile_get_model (profile);
|
label = gimp_color_profile_get_model (profile);
|
||||||
|
|
||||||
if (label && ! strlen (label))
|
if (label && ! strlen (label))
|
||||||
{
|
{
|
||||||
@ -378,7 +378,7 @@ gimp_lcms_profile_get_label (GimpColorProfile profile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_profile_get_summary:
|
* gimp_color_profile_get_summary:
|
||||||
* @profile: a #GimpColorProfile
|
* @profile: a #GimpColorProfile
|
||||||
*
|
*
|
||||||
* This function return a newly allocated string containing a
|
* This function return a newly allocated string containing a
|
||||||
@ -391,7 +391,7 @@ gimp_lcms_profile_get_label (GimpColorProfile profile)
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
gchar *
|
gchar *
|
||||||
gimp_lcms_profile_get_summary (GimpColorProfile profile)
|
gimp_color_profile_get_summary (GimpColorProfile profile)
|
||||||
{
|
{
|
||||||
GString *string;
|
GString *string;
|
||||||
gchar *text;
|
gchar *text;
|
||||||
@ -400,14 +400,14 @@ gimp_lcms_profile_get_summary (GimpColorProfile profile)
|
|||||||
|
|
||||||
string = g_string_new (NULL);
|
string = g_string_new (NULL);
|
||||||
|
|
||||||
text = gimp_lcms_profile_get_description (profile);
|
text = gimp_color_profile_get_description (profile);
|
||||||
if (text)
|
if (text)
|
||||||
{
|
{
|
||||||
g_string_append (string, text);
|
g_string_append (string, text);
|
||||||
g_free (text);
|
g_free (text);
|
||||||
}
|
}
|
||||||
|
|
||||||
text = gimp_lcms_profile_get_model (profile);
|
text = gimp_color_profile_get_model (profile);
|
||||||
if (text)
|
if (text)
|
||||||
{
|
{
|
||||||
if (string->len > 0)
|
if (string->len > 0)
|
||||||
@ -416,7 +416,7 @@ gimp_lcms_profile_get_summary (GimpColorProfile profile)
|
|||||||
g_string_append (string, text);
|
g_string_append (string, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
text = gimp_lcms_profile_get_manufacturer (profile);
|
text = gimp_color_profile_get_manufacturer (profile);
|
||||||
if (text)
|
if (text)
|
||||||
{
|
{
|
||||||
if (string->len > 0)
|
if (string->len > 0)
|
||||||
@ -425,7 +425,7 @@ gimp_lcms_profile_get_summary (GimpColorProfile profile)
|
|||||||
g_string_append (string, text);
|
g_string_append (string, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
text = gimp_lcms_profile_get_copyright (profile);
|
text = gimp_color_profile_get_copyright (profile);
|
||||||
if (text)
|
if (text)
|
||||||
{
|
{
|
||||||
if (string->len > 0)
|
if (string->len > 0)
|
||||||
@ -438,7 +438,7 @@ gimp_lcms_profile_get_summary (GimpColorProfile profile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_profile_is_equal:
|
* gimp_color_profile_is_equal:
|
||||||
* @profile1: a #GimpColorProfile
|
* @profile1: a #GimpColorProfile
|
||||||
* @profile2: a #GimpColorProfile
|
* @profile2: a #GimpColorProfile
|
||||||
*
|
*
|
||||||
@ -449,7 +449,7 @@ gimp_lcms_profile_get_summary (GimpColorProfile profile)
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
gboolean
|
gboolean
|
||||||
gimp_lcms_profile_is_equal (GimpColorProfile profile1,
|
gimp_color_profile_is_equal (GimpColorProfile profile1,
|
||||||
GimpColorProfile profile2)
|
GimpColorProfile profile2)
|
||||||
{
|
{
|
||||||
cmsUInt8Number digest1[GIMP_LCMS_MD5_DIGEST_LENGTH];
|
cmsUInt8Number digest1[GIMP_LCMS_MD5_DIGEST_LENGTH];
|
||||||
@ -471,7 +471,7 @@ gimp_lcms_profile_is_equal (GimpColorProfile profile1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_profile_is_rgb:
|
* gimp_color_profile_is_rgb:
|
||||||
* @profile: a #GimpColorProfile
|
* @profile: a #GimpColorProfile
|
||||||
*
|
*
|
||||||
* Return value: %TRUE if the profile's color space is RGB, %FALSE
|
* Return value: %TRUE if the profile's color space is RGB, %FALSE
|
||||||
@ -480,7 +480,7 @@ gimp_lcms_profile_is_equal (GimpColorProfile profile1,
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
gboolean
|
gboolean
|
||||||
gimp_lcms_profile_is_rgb (GimpColorProfile profile)
|
gimp_color_profile_is_rgb (GimpColorProfile profile)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (profile != NULL, FALSE);
|
g_return_val_if_fail (profile != NULL, FALSE);
|
||||||
|
|
||||||
@ -488,7 +488,7 @@ gimp_lcms_profile_is_rgb (GimpColorProfile profile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_profile_is_cmyk:
|
* gimp_color_profile_is_cmyk:
|
||||||
* @profile: a #GimpColorProfile
|
* @profile: a #GimpColorProfile
|
||||||
*
|
*
|
||||||
* Return value: %TRUE if the profile's color space is CMYK, %FALSE
|
* Return value: %TRUE if the profile's color space is CMYK, %FALSE
|
||||||
@ -497,7 +497,7 @@ gimp_lcms_profile_is_rgb (GimpColorProfile profile)
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
gboolean
|
gboolean
|
||||||
gimp_lcms_profile_is_cmyk (GimpColorProfile profile)
|
gimp_color_profile_is_cmyk (GimpColorProfile profile)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (profile != NULL, FALSE);
|
g_return_val_if_fail (profile != NULL, FALSE);
|
||||||
|
|
||||||
@ -505,9 +505,9 @@ gimp_lcms_profile_is_cmyk (GimpColorProfile profile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_lcms_profile_set_tag (cmsHPROFILE profile,
|
gimp_color_profile_set_tag (cmsHPROFILE profile,
|
||||||
cmsTagSignature sig,
|
cmsTagSignature sig,
|
||||||
const gchar *tag)
|
const gchar *tag)
|
||||||
{
|
{
|
||||||
cmsMLU *mlu;
|
cmsMLU *mlu;
|
||||||
|
|
||||||
@ -518,7 +518,7 @@ gimp_lcms_profile_set_tag (cmsHPROFILE profile,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GimpColorProfile
|
static GimpColorProfile
|
||||||
gimp_lcms_create_srgb_profile_internal (void)
|
gimp_color_profile_new_srgb_internal (void)
|
||||||
{
|
{
|
||||||
cmsHPROFILE srgb_profile;
|
cmsHPROFILE srgb_profile;
|
||||||
cmsCIExyY d65_srgb_specs = { 0.3127, 0.3290, 1.0 };
|
cmsCIExyY d65_srgb_specs = { 0.3127, 0.3290, 1.0 };
|
||||||
@ -546,14 +546,14 @@ gimp_lcms_create_srgb_profile_internal (void)
|
|||||||
|
|
||||||
cmsFreeToneCurve (srgb_parametric_curve);
|
cmsFreeToneCurve (srgb_parametric_curve);
|
||||||
|
|
||||||
gimp_lcms_profile_set_tag (srgb_profile, cmsSigProfileDescriptionTag,
|
gimp_color_profile_set_tag (srgb_profile, cmsSigProfileDescriptionTag,
|
||||||
"GIMP built-in sRGB");
|
"GIMP built-in sRGB");
|
||||||
gimp_lcms_profile_set_tag (srgb_profile, cmsSigDeviceMfgDescTag,
|
gimp_color_profile_set_tag (srgb_profile, cmsSigDeviceMfgDescTag,
|
||||||
"GIMP");
|
"GIMP");
|
||||||
gimp_lcms_profile_set_tag (srgb_profile, cmsSigDeviceModelDescTag,
|
gimp_color_profile_set_tag (srgb_profile, cmsSigDeviceModelDescTag,
|
||||||
"sRGB");
|
"sRGB");
|
||||||
gimp_lcms_profile_set_tag (srgb_profile, cmsSigCopyrightTag,
|
gimp_color_profile_set_tag (srgb_profile, cmsSigCopyrightTag,
|
||||||
"Public Domain");
|
"Public Domain");
|
||||||
|
|
||||||
/* The following line produces a V2 profile with a point curve TRC.
|
/* The following line produces a V2 profile with a point curve TRC.
|
||||||
* Profiles with point curve TRCs can't be used in LCMS2 unbounded
|
* Profiles with point curve TRCs can't be used in LCMS2 unbounded
|
||||||
@ -569,7 +569,7 @@ gimp_lcms_create_srgb_profile_internal (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_create_srgb_profile:
|
* gimp_color_profile_new_srgb:
|
||||||
*
|
*
|
||||||
* This function is a replacement for cmsCreate_sRGBProfile() and
|
* This function is a replacement for cmsCreate_sRGBProfile() and
|
||||||
* returns an sRGB profile that is functionally the same as the
|
* returns an sRGB profile that is functionally the same as the
|
||||||
@ -600,7 +600,7 @@ gimp_lcms_create_srgb_profile_internal (void)
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
GimpColorProfile
|
GimpColorProfile
|
||||||
gimp_lcms_create_srgb_profile (void)
|
gimp_color_profile_new_srgb (void)
|
||||||
{
|
{
|
||||||
static guint8 *profile_data = NULL;
|
static guint8 *profile_data = NULL;
|
||||||
static gsize profile_length = 0;
|
static gsize profile_length = 0;
|
||||||
@ -609,19 +609,19 @@ gimp_lcms_create_srgb_profile (void)
|
|||||||
{
|
{
|
||||||
GimpColorProfile profile;
|
GimpColorProfile profile;
|
||||||
|
|
||||||
profile = gimp_lcms_create_srgb_profile_internal ();
|
profile = gimp_color_profile_new_srgb_internal ();
|
||||||
|
|
||||||
profile_data = gimp_lcms_profile_save_to_data (profile, &profile_length,
|
profile_data = gimp_color_profile_save_to_data (profile, &profile_length,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
return gimp_lcms_profile_open_from_data (profile_data, profile_length, NULL);
|
return gimp_color_profile_open_from_data (profile_data, profile_length, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GimpColorProfile
|
static GimpColorProfile
|
||||||
gimp_lcms_create_linear_rgb_profile_internal (void)
|
gimp_color_profile_new_linear_rgb_internal (void)
|
||||||
{
|
{
|
||||||
cmsHPROFILE profile;
|
cmsHPROFILE profile;
|
||||||
|
|
||||||
@ -651,20 +651,20 @@ gimp_lcms_create_linear_rgb_profile_internal (void)
|
|||||||
profile = cmsCreateRGBProfile (&whitepoint, &primaries, linear);
|
profile = cmsCreateRGBProfile (&whitepoint, &primaries, linear);
|
||||||
cmsFreeToneCurve (linear[0]);
|
cmsFreeToneCurve (linear[0]);
|
||||||
|
|
||||||
gimp_lcms_profile_set_tag (profile, cmsSigProfileDescriptionTag,
|
gimp_color_profile_set_tag (profile, cmsSigProfileDescriptionTag,
|
||||||
"GIMP built-in Linear RGB");
|
"GIMP built-in Linear RGB");
|
||||||
gimp_lcms_profile_set_tag (profile, cmsSigDeviceMfgDescTag,
|
gimp_color_profile_set_tag (profile, cmsSigDeviceMfgDescTag,
|
||||||
"GIMP");
|
"GIMP");
|
||||||
gimp_lcms_profile_set_tag (profile, cmsSigDeviceModelDescTag,
|
gimp_color_profile_set_tag (profile, cmsSigDeviceModelDescTag,
|
||||||
"Linear RGB");
|
"Linear RGB");
|
||||||
gimp_lcms_profile_set_tag (profile, cmsSigCopyrightTag,
|
gimp_color_profile_set_tag (profile, cmsSigCopyrightTag,
|
||||||
"Public Domain");
|
"Public Domain");
|
||||||
|
|
||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_create_linear_rgb_profile:
|
* gimp_color_profile_new_linear_rgb:
|
||||||
*
|
*
|
||||||
* This function creates a profile for babl_model("RGB"). Please
|
* This function creates a profile for babl_model("RGB"). Please
|
||||||
* somebody write someting smarter here.
|
* somebody write someting smarter here.
|
||||||
@ -674,7 +674,7 @@ gimp_lcms_create_linear_rgb_profile_internal (void)
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
GimpColorProfile
|
GimpColorProfile
|
||||||
gimp_lcms_create_linear_rgb_profile (void)
|
gimp_color_profile_new_linear_rgb (void)
|
||||||
{
|
{
|
||||||
static guint8 *profile_data = NULL;
|
static guint8 *profile_data = NULL;
|
||||||
static gsize profile_length = 0;
|
static gsize profile_length = 0;
|
||||||
@ -683,19 +683,19 @@ gimp_lcms_create_linear_rgb_profile (void)
|
|||||||
{
|
{
|
||||||
GimpColorProfile profile;
|
GimpColorProfile profile;
|
||||||
|
|
||||||
profile = gimp_lcms_create_linear_rgb_profile_internal ();
|
profile = gimp_color_profile_new_linear_rgb_internal ();
|
||||||
|
|
||||||
profile_data = gimp_lcms_profile_save_to_data (profile, &profile_length,
|
profile_data = gimp_color_profile_save_to_data (profile, &profile_length,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
return gimp_lcms_profile_open_from_data (profile_data, profile_length, NULL);
|
return gimp_color_profile_open_from_data (profile_data, profile_length, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_lcms_get_format:
|
* gimp_color_profile_get_format:
|
||||||
* @format: a #Babl format
|
* @format: a #Babl format
|
||||||
* @lcms_format: return location for an lcms format
|
* @lcms_format: return location for an lcms format
|
||||||
*
|
*
|
||||||
@ -713,8 +713,8 @@ gimp_lcms_create_linear_rgb_profile (void)
|
|||||||
* Since: 2.10
|
* Since: 2.10
|
||||||
**/
|
**/
|
||||||
const Babl *
|
const Babl *
|
||||||
gimp_lcms_get_format (const Babl *format,
|
gimp_color_profile_get_format (const Babl *format,
|
||||||
guint32 *lcms_format)
|
guint32 *lcms_format)
|
||||||
{
|
{
|
||||||
const Babl *output_format = NULL;
|
const Babl *output_format = NULL;
|
||||||
const Babl *type;
|
const Babl *type;
|
68
libgimpcolor/gimpcolorprofile.h
Normal file
68
libgimpcolor/gimpcolorprofile.h
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
/* LIBGIMP - The GIMP Library
|
||||||
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* gimpcolorprofile.h
|
||||||
|
* Copyright (C) 2014 Michael Natterer <mitch@gimp.org>
|
||||||
|
* Elle Stone <ellestone@ninedegreesbelow.com>
|
||||||
|
*
|
||||||
|
* This library is free software: you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 3 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 Lesser General Public
|
||||||
|
* License along with this library. If not, see
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if !defined (__GIMP_COLOR_H_INSIDE__) && !defined (GIMP_COLOR_COMPILATION)
|
||||||
|
#error "Only <libgimpcolor/gimpcolor.h> can be included directly."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __GIMP_COLOR_PROFILE_H__
|
||||||
|
#define __GIMP_COLOR_PROFILE_H__
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
/* For information look into the C source or the html documentation */
|
||||||
|
|
||||||
|
|
||||||
|
GimpColorProfile gimp_color_profile_open_from_file (GFile *file,
|
||||||
|
GError **error);
|
||||||
|
GimpColorProfile gimp_color_profile_open_from_data (const guint8 *data,
|
||||||
|
gsize length,
|
||||||
|
GError **error);
|
||||||
|
guint8 * gimp_color_profile_save_to_data (GimpColorProfile profile,
|
||||||
|
gsize *length,
|
||||||
|
GError **error);
|
||||||
|
void gimp_color_profile_close (GimpColorProfile profile);
|
||||||
|
|
||||||
|
gchar * gimp_color_profile_get_description (GimpColorProfile profile);
|
||||||
|
gchar * gimp_color_profile_get_manufacturer (GimpColorProfile profile);
|
||||||
|
gchar * gimp_color_profile_get_model (GimpColorProfile profile);
|
||||||
|
gchar * gimp_color_profile_get_copyright (GimpColorProfile profile);
|
||||||
|
|
||||||
|
gchar * gimp_color_profile_get_label (GimpColorProfile profile);
|
||||||
|
gchar * gimp_color_profile_get_summary (GimpColorProfile profile);
|
||||||
|
|
||||||
|
gboolean gimp_color_profile_is_equal (GimpColorProfile profile1,
|
||||||
|
GimpColorProfile profile2);
|
||||||
|
|
||||||
|
gboolean gimp_color_profile_is_rgb (GimpColorProfile profile);
|
||||||
|
gboolean gimp_color_profile_is_cmyk (GimpColorProfile profile);
|
||||||
|
|
||||||
|
GimpColorProfile gimp_color_profile_new_srgb (void);
|
||||||
|
GimpColorProfile gimp_color_profile_new_linear_rgb (void);
|
||||||
|
|
||||||
|
const Babl * gimp_color_profile_get_format (const Babl *format,
|
||||||
|
guint32 *lcms_format);
|
||||||
|
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __GIMP_COLOR_PROFILE_H__ */
|
@ -1,68 +0,0 @@
|
|||||||
/* LIBGIMP - The GIMP Library
|
|
||||||
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
|
||||||
*
|
|
||||||
* gimplcms.h
|
|
||||||
* Copyright (C) 2014 Michael Natterer <mitch@gimp.org>
|
|
||||||
* Elle Stone <ellestone@ninedegreesbelow.com>
|
|
||||||
*
|
|
||||||
* This library is free software: you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 3 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 Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !defined (__GIMP_COLOR_H_INSIDE__) && !defined (GIMP_COLOR_COMPILATION)
|
|
||||||
#error "Only <libgimpcolor/gimpcolor.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __GIMP_LCMS_H__
|
|
||||||
#define __GIMP_LCMS_H__
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
/* For information look into the C source or the html documentation */
|
|
||||||
|
|
||||||
|
|
||||||
GimpColorProfile gimp_lcms_profile_open_from_file (GFile *file,
|
|
||||||
GError **error);
|
|
||||||
GimpColorProfile gimp_lcms_profile_open_from_data (const guint8 *data,
|
|
||||||
gsize length,
|
|
||||||
GError **error);
|
|
||||||
guint8 * gimp_lcms_profile_save_to_data (GimpColorProfile profile,
|
|
||||||
gsize *length,
|
|
||||||
GError **error);
|
|
||||||
void gimp_lcms_profile_close (GimpColorProfile profile);
|
|
||||||
|
|
||||||
gchar * gimp_lcms_profile_get_description (GimpColorProfile profile);
|
|
||||||
gchar * gimp_lcms_profile_get_manufacturer (GimpColorProfile profile);
|
|
||||||
gchar * gimp_lcms_profile_get_model (GimpColorProfile profile);
|
|
||||||
gchar * gimp_lcms_profile_get_copyright (GimpColorProfile profile);
|
|
||||||
|
|
||||||
gchar * gimp_lcms_profile_get_label (GimpColorProfile profile);
|
|
||||||
gchar * gimp_lcms_profile_get_summary (GimpColorProfile profile);
|
|
||||||
|
|
||||||
gboolean gimp_lcms_profile_is_equal (GimpColorProfile profile1,
|
|
||||||
GimpColorProfile profile2);
|
|
||||||
|
|
||||||
gboolean gimp_lcms_profile_is_rgb (GimpColorProfile profile);
|
|
||||||
gboolean gimp_lcms_profile_is_cmyk (GimpColorProfile profile);
|
|
||||||
|
|
||||||
GimpColorProfile gimp_lcms_create_srgb_profile (void);
|
|
||||||
GimpColorProfile gimp_lcms_create_linear_rgb_profile(void);
|
|
||||||
|
|
||||||
const Babl * gimp_lcms_get_format (const Babl *format,
|
|
||||||
guint32 *lcms_format);
|
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GIMP_LCMS_H__ */
|
|
@ -383,11 +383,11 @@ gimp_color_config_get_rgb_profile (GimpColorConfig *config,
|
|||||||
{
|
{
|
||||||
GFile *file = g_file_new_for_path (config->rgb_profile);
|
GFile *file = g_file_new_for_path (config->rgb_profile);
|
||||||
|
|
||||||
profile = gimp_lcms_profile_open_from_file (file, error);
|
profile = gimp_color_profile_open_from_file (file, error);
|
||||||
|
|
||||||
if (profile && ! gimp_lcms_profile_is_rgb (profile))
|
if (profile && ! gimp_color_profile_is_rgb (profile))
|
||||||
{
|
{
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
profile = NULL;
|
profile = NULL;
|
||||||
|
|
||||||
g_set_error (error, GIMP_CONFIG_ERROR, 0,
|
g_set_error (error, GIMP_CONFIG_ERROR, 0,
|
||||||
@ -414,11 +414,11 @@ gimp_color_config_get_cmyk_profile (GimpColorConfig *config,
|
|||||||
{
|
{
|
||||||
GFile *file = g_file_new_for_path (config->cmyk_profile);
|
GFile *file = g_file_new_for_path (config->cmyk_profile);
|
||||||
|
|
||||||
profile = gimp_lcms_profile_open_from_file (file, error);
|
profile = gimp_color_profile_open_from_file (file, error);
|
||||||
|
|
||||||
if (profile && ! gimp_lcms_profile_is_cmyk (profile))
|
if (profile && ! gimp_color_profile_is_cmyk (profile))
|
||||||
{
|
{
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
profile = NULL;
|
profile = NULL;
|
||||||
|
|
||||||
g_set_error (error, GIMP_CONFIG_ERROR, 0,
|
g_set_error (error, GIMP_CONFIG_ERROR, 0,
|
||||||
@ -445,7 +445,7 @@ gimp_color_config_get_display_profile (GimpColorConfig *config,
|
|||||||
{
|
{
|
||||||
GFile *file = g_file_new_for_path (config->display_profile);
|
GFile *file = g_file_new_for_path (config->display_profile);
|
||||||
|
|
||||||
profile = gimp_lcms_profile_open_from_file (file, error);
|
profile = gimp_color_profile_open_from_file (file, error);
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -465,7 +465,7 @@ gimp_color_config_get_printer_profile (GimpColorConfig *config,
|
|||||||
{
|
{
|
||||||
GFile *file = g_file_new_for_path (config->printer_profile);
|
GFile *file = g_file_new_for_path (config->printer_profile);
|
||||||
|
|
||||||
profile = gimp_lcms_profile_open_from_file (file, error);
|
profile = gimp_color_profile_open_from_file (file, error);
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -487,11 +487,11 @@ gimp_color_config_set_rgb_profile (GimpColorConfig *config,
|
|||||||
GimpColorProfile profile;
|
GimpColorProfile profile;
|
||||||
GFile *file = g_file_new_for_path (filename);
|
GFile *file = g_file_new_for_path (filename);
|
||||||
|
|
||||||
profile = gimp_lcms_profile_open_from_file (file, error);
|
profile = gimp_color_profile_open_from_file (file, error);
|
||||||
|
|
||||||
if (profile)
|
if (profile)
|
||||||
{
|
{
|
||||||
if (! gimp_lcms_profile_is_rgb (profile))
|
if (! gimp_color_profile_is_rgb (profile))
|
||||||
{
|
{
|
||||||
g_set_error (error, GIMP_CONFIG_ERROR, 0,
|
g_set_error (error, GIMP_CONFIG_ERROR, 0,
|
||||||
_("Color profile '%s' is not for RGB color space."),
|
_("Color profile '%s' is not for RGB color space."),
|
||||||
@ -499,7 +499,7 @@ gimp_color_config_set_rgb_profile (GimpColorConfig *config,
|
|||||||
success = FALSE;
|
success = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -528,11 +528,11 @@ gimp_color_config_set_cmyk_profile (GimpColorConfig *config,
|
|||||||
GimpColorProfile profile;
|
GimpColorProfile profile;
|
||||||
GFile *file = g_file_new_for_path (filename);
|
GFile *file = g_file_new_for_path (filename);
|
||||||
|
|
||||||
profile = gimp_lcms_profile_open_from_file (file, error);
|
profile = gimp_color_profile_open_from_file (file, error);
|
||||||
|
|
||||||
if (profile)
|
if (profile)
|
||||||
{
|
{
|
||||||
if (! gimp_lcms_profile_is_cmyk (profile))
|
if (! gimp_color_profile_is_cmyk (profile))
|
||||||
{
|
{
|
||||||
g_set_error (error, GIMP_CONFIG_ERROR, 0,
|
g_set_error (error, GIMP_CONFIG_ERROR, 0,
|
||||||
_("Color profile '%s' is not for CMYK color space."),
|
_("Color profile '%s' is not for CMYK color space."),
|
||||||
@ -540,7 +540,7 @@ gimp_color_config_set_cmyk_profile (GimpColorConfig *config,
|
|||||||
success = FALSE;
|
success = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -569,11 +569,11 @@ gimp_color_config_set_display_profile (GimpColorConfig *config,
|
|||||||
GimpColorProfile profile;
|
GimpColorProfile profile;
|
||||||
GFile *file = g_file_new_for_path (filename);
|
GFile *file = g_file_new_for_path (filename);
|
||||||
|
|
||||||
profile = gimp_lcms_profile_open_from_file (file, error);
|
profile = gimp_color_profile_open_from_file (file, error);
|
||||||
|
|
||||||
if (profile)
|
if (profile)
|
||||||
{
|
{
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -602,11 +602,11 @@ gimp_color_config_set_printer_profile (GimpColorConfig *config,
|
|||||||
GimpColorProfile profile;
|
GimpColorProfile profile;
|
||||||
GFile *file = g_file_new_for_path (filename);
|
GFile *file = g_file_new_for_path (filename);
|
||||||
|
|
||||||
profile = gimp_lcms_profile_open_from_file (file, error);
|
profile = gimp_color_profile_open_from_file (file, error);
|
||||||
|
|
||||||
if (profile)
|
if (profile)
|
||||||
{
|
{
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -198,7 +198,7 @@ gimp_color_profile_chooser_dialog_update_preview (GimpColorProfileChooserDialog
|
|||||||
switch (g_file_query_file_type (file, G_FILE_QUERY_INFO_NONE, NULL))
|
switch (g_file_query_file_type (file, G_FILE_QUERY_INFO_NONE, NULL))
|
||||||
{
|
{
|
||||||
case G_FILE_TYPE_REGULAR:
|
case G_FILE_TYPE_REGULAR:
|
||||||
profile = gimp_lcms_profile_open_from_file (file, &error);
|
profile = gimp_color_profile_open_from_file (file, &error);
|
||||||
|
|
||||||
if (! profile)
|
if (! profile)
|
||||||
{
|
{
|
||||||
@ -210,7 +210,7 @@ gimp_color_profile_chooser_dialog_update_preview (GimpColorProfileChooserDialog
|
|||||||
{
|
{
|
||||||
gimp_color_profile_view_set_profile (dialog->priv->profile_view,
|
gimp_color_profile_view_set_profile (dialog->priv->profile_view,
|
||||||
profile);
|
profile);
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -428,7 +428,7 @@ gimp_color_profile_combo_box_set_active (GimpColorProfileComboBox *combo,
|
|||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
file = g_file_new_for_path (filename);
|
file = g_file_new_for_path (filename);
|
||||||
profile = gimp_lcms_profile_open_from_file (file, &error);
|
profile = gimp_color_profile_open_from_file (file, &error);
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
|
|
||||||
if (! profile)
|
if (! profile)
|
||||||
@ -438,8 +438,8 @@ gimp_color_profile_combo_box_set_active (GimpColorProfileComboBox *combo,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
l = gimp_lcms_profile_get_label (profile);
|
l = gimp_color_profile_get_label (profile);
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -118,8 +118,8 @@ gimp_color_profile_view_set_profile (GimpColorProfileView *view,
|
|||||||
|
|
||||||
gtk_text_buffer_get_start_iter (buffer, &iter);
|
gtk_text_buffer_get_start_iter (buffer, &iter);
|
||||||
|
|
||||||
label = gimp_lcms_profile_get_label (profile);
|
label = gimp_color_profile_get_label (profile);
|
||||||
summary = gimp_lcms_profile_get_summary (profile);
|
summary = gimp_color_profile_get_summary (profile);
|
||||||
|
|
||||||
if (label && strlen (label))
|
if (label && strlen (label))
|
||||||
{
|
{
|
||||||
|
@ -391,7 +391,7 @@ gimp_widget_get_color_profile (GtkWidget *widget)
|
|||||||
0, 64 * 1024 * 1024, FALSE,
|
0, 64 * 1024 * 1024, FALSE,
|
||||||
&type, &format, &nitems, &data) && nitems > 0)
|
&type, &format, &nitems, &data) && nitems > 0)
|
||||||
{
|
{
|
||||||
profile = gimp_lcms_profile_open_from_data (data, nitems, NULL);
|
profile = gimp_color_profile_open_from_data (data, nitems, NULL);
|
||||||
g_free (data);
|
g_free (data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -421,9 +421,9 @@ gimp_widget_get_color_profile (GtkWidget *widget)
|
|||||||
CFDataGetBytes (data, CFRangeMake (0, CFDataGetLength (data)),
|
CFDataGetBytes (data, CFRangeMake (0, CFDataGetLength (data)),
|
||||||
buffer);
|
buffer);
|
||||||
|
|
||||||
profile = gimp_lcms_profile_open_from_data (data,
|
profile = gimp_color_profile_open_from_data (data,
|
||||||
CFDataGetLength (data),
|
CFDataGetLength (data),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
g_free (buffer);
|
g_free (buffer);
|
||||||
CFRelease (data);
|
CFRelease (data);
|
||||||
@ -446,7 +446,7 @@ gimp_widget_get_color_profile (GtkWidget *widget)
|
|||||||
{
|
{
|
||||||
GFile *file = g_file_new_for_path (path);
|
GFile *file = g_file_new_for_path (path);
|
||||||
|
|
||||||
profile = gimp_lcms_profile_open_from_file (file, NULL);
|
profile = gimp_color_profile_open_from_file (file, NULL);
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -472,7 +472,7 @@ get_display_profile (GtkWidget *widget,
|
|||||||
profile = gimp_color_config_get_display_profile (config, NULL);
|
profile = gimp_color_config_get_display_profile (config, NULL);
|
||||||
|
|
||||||
if (! profile)
|
if (! profile)
|
||||||
profile = gimp_lcms_create_srgb_profile ();
|
profile = gimp_color_profile_new_srgb ();
|
||||||
|
|
||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
@ -513,8 +513,8 @@ gimp_widget_get_color_transform (GtkWidget *widget,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
*src_format = gimp_lcms_get_format (*src_format, &lcms_src_format);
|
*src_format = gimp_color_profile_get_format (*src_format, &lcms_src_format);
|
||||||
*dest_format = gimp_lcms_get_format (*dest_format, &lcms_dest_format);
|
*dest_format = gimp_color_profile_get_format (*dest_format, &lcms_dest_format);
|
||||||
|
|
||||||
if (proof_profile)
|
if (proof_profile)
|
||||||
{
|
{
|
||||||
@ -550,9 +550,9 @@ gimp_widget_get_color_transform (GtkWidget *widget,
|
|||||||
config->display_intent,
|
config->display_intent,
|
||||||
softproof_flags);
|
softproof_flags);
|
||||||
|
|
||||||
gimp_lcms_profile_close (proof_profile);
|
gimp_color_profile_close (proof_profile);
|
||||||
}
|
}
|
||||||
else if (! gimp_lcms_profile_is_equal (src_profile, dest_profile))
|
else if (! gimp_color_profile_is_equal (src_profile, dest_profile))
|
||||||
{
|
{
|
||||||
cmsUInt32Number display_flags = 0;
|
cmsUInt32Number display_flags = 0;
|
||||||
|
|
||||||
@ -568,8 +568,8 @@ gimp_widget_get_color_transform (GtkWidget *widget,
|
|||||||
display_flags);
|
display_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_lcms_profile_close (src_profile);
|
gimp_color_profile_close (src_profile);
|
||||||
gimp_lcms_profile_close (dest_profile);
|
gimp_color_profile_close (dest_profile);
|
||||||
|
|
||||||
return transform;
|
return transform;
|
||||||
}
|
}
|
||||||
|
@ -381,13 +381,13 @@ colorsel_cmyk_config_changed (ColorselCmyk *module)
|
|||||||
cmyk_profile = gimp_color_config_get_cmyk_profile (config, NULL);
|
cmyk_profile = gimp_color_config_get_cmyk_profile (config, NULL);
|
||||||
|
|
||||||
if (! rgb_profile)
|
if (! rgb_profile)
|
||||||
rgb_profile = gimp_lcms_create_srgb_profile ();
|
rgb_profile = gimp_color_profile_new_srgb ();
|
||||||
|
|
||||||
if (! cmyk_profile)
|
if (! cmyk_profile)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
label = gimp_lcms_profile_get_label (cmyk_profile);
|
label = gimp_color_profile_get_label (cmyk_profile);
|
||||||
summary = gimp_lcms_profile_get_summary (cmyk_profile);
|
summary = gimp_color_profile_get_summary (cmyk_profile);
|
||||||
|
|
||||||
text = g_strdup_printf (_("Profile: %s"), label);
|
text = g_strdup_printf (_("Profile: %s"), label);
|
||||||
gtk_label_set_text (GTK_LABEL (module->name_label), text);
|
gtk_label_set_text (GTK_LABEL (module->name_label), text);
|
||||||
@ -415,10 +415,10 @@ colorsel_cmyk_config_changed (ColorselCmyk *module)
|
|||||||
out:
|
out:
|
||||||
|
|
||||||
if (rgb_profile)
|
if (rgb_profile)
|
||||||
gimp_lcms_profile_close (rgb_profile);
|
gimp_color_profile_close (rgb_profile);
|
||||||
|
|
||||||
if (cmyk_profile)
|
if (cmyk_profile)
|
||||||
gimp_lcms_profile_close (cmyk_profile);
|
gimp_color_profile_close (cmyk_profile);
|
||||||
|
|
||||||
if (! module->in_destruction)
|
if (! module->in_destruction)
|
||||||
colorsel_cmyk_set_color (selector, &selector->rgb, &selector->hsv);
|
colorsel_cmyk_set_color (selector, &selector->rgb, &selector->hsv);
|
||||||
|
@ -373,8 +373,8 @@ cdisplay_lcms_update_profile_label (CdisplayLcms *lcms,
|
|||||||
|
|
||||||
if (profile)
|
if (profile)
|
||||||
{
|
{
|
||||||
text = gimp_lcms_profile_get_label (profile);
|
text = gimp_color_profile_get_label (profile);
|
||||||
tooltip = gimp_lcms_profile_get_summary (profile);
|
tooltip = gimp_color_profile_get_summary (profile);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -389,7 +389,7 @@ cdisplay_lcms_update_profile_label (CdisplayLcms *lcms,
|
|||||||
g_free (tooltip);
|
g_free (tooltip);
|
||||||
|
|
||||||
if (profile)
|
if (profile)
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -336,10 +336,10 @@ cdisplay_proof_changed (GimpColorDisplay *display)
|
|||||||
if (! proof->profile)
|
if (! proof->profile)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
rgb_profile = gimp_lcms_create_srgb_profile ();
|
rgb_profile = gimp_color_profile_new_srgb ();
|
||||||
|
|
||||||
file = g_file_new_for_path (proof->profile);
|
file = g_file_new_for_path (proof->profile);
|
||||||
proof_profile = gimp_lcms_profile_open_from_file (file, NULL);
|
proof_profile = gimp_color_profile_open_from_file (file, NULL);
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
|
|
||||||
if (proof_profile)
|
if (proof_profile)
|
||||||
@ -356,8 +356,8 @@ cdisplay_proof_changed (GimpColorDisplay *display)
|
|||||||
proof->intent,
|
proof->intent,
|
||||||
flags);
|
flags);
|
||||||
|
|
||||||
cmsCloseProfile (proof_profile);
|
gimp_color_profile_close (proof_profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
cmsCloseProfile (rgb_profile);
|
gimp_color_profile_close (rgb_profile);
|
||||||
}
|
}
|
||||||
|
@ -547,7 +547,7 @@ lcms_icc_apply (GimpColorConfig *config,
|
|||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
dest_profile = gimp_lcms_profile_open_from_file (file, &error);
|
dest_profile = gimp_color_profile_open_from_file (file, &error);
|
||||||
|
|
||||||
if (! dest_profile)
|
if (! dest_profile)
|
||||||
{
|
{
|
||||||
@ -557,12 +557,12 @@ lcms_icc_apply (GimpColorConfig *config,
|
|||||||
return GIMP_PDB_EXECUTION_ERROR;
|
return GIMP_PDB_EXECUTION_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! gimp_lcms_profile_is_rgb (dest_profile))
|
if (! gimp_color_profile_is_rgb (dest_profile))
|
||||||
{
|
{
|
||||||
g_message (_("Color profile '%s' is not for RGB color space."),
|
g_message (_("Color profile '%s' is not for RGB color space."),
|
||||||
gimp_file_get_utf8_name (file));
|
gimp_file_get_utf8_name (file));
|
||||||
|
|
||||||
gimp_lcms_profile_close (dest_profile);
|
gimp_color_profile_close (dest_profile);
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
return GIMP_PDB_EXECUTION_ERROR;
|
return GIMP_PDB_EXECUTION_ERROR;
|
||||||
}
|
}
|
||||||
@ -580,18 +580,18 @@ lcms_icc_apply (GimpColorConfig *config,
|
|||||||
return GIMP_PDB_SUCCESS;
|
return GIMP_PDB_SUCCESS;
|
||||||
|
|
||||||
if (! src_profile)
|
if (! src_profile)
|
||||||
src_profile = gimp_lcms_create_srgb_profile ();
|
src_profile = gimp_color_profile_new_srgb ();
|
||||||
|
|
||||||
if (! dest_profile)
|
if (! dest_profile)
|
||||||
dest_profile = gimp_lcms_create_srgb_profile ();
|
dest_profile = gimp_color_profile_new_srgb ();
|
||||||
|
|
||||||
if (gimp_lcms_profile_is_equal (src_profile, dest_profile))
|
if (gimp_color_profile_is_equal (src_profile, dest_profile))
|
||||||
{
|
{
|
||||||
gchar *src_label = gimp_lcms_profile_get_label (src_profile);
|
gchar *src_label = gimp_color_profile_get_label (src_profile);
|
||||||
gchar *dest_label = gimp_lcms_profile_get_label (dest_profile);
|
gchar *dest_label = gimp_color_profile_get_label (dest_profile);
|
||||||
|
|
||||||
gimp_lcms_profile_close (src_profile);
|
gimp_color_profile_close (src_profile);
|
||||||
gimp_lcms_profile_close (dest_profile);
|
gimp_color_profile_close (dest_profile);
|
||||||
|
|
||||||
g_printerr ("lcms: skipping conversion because profiles seem to be equal:\n");
|
g_printerr ("lcms: skipping conversion because profiles seem to be equal:\n");
|
||||||
g_printerr (" %s\n", src_label);
|
g_printerr (" %s\n", src_label);
|
||||||
@ -620,8 +620,8 @@ lcms_icc_apply (GimpColorConfig *config,
|
|||||||
status = GIMP_PDB_EXECUTION_ERROR;
|
status = GIMP_PDB_EXECUTION_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_lcms_profile_close (src_profile);
|
gimp_color_profile_close (src_profile);
|
||||||
gimp_lcms_profile_close (dest_profile);
|
gimp_color_profile_close (dest_profile);
|
||||||
|
|
||||||
if (file)
|
if (file)
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
@ -651,13 +651,13 @@ lcms_icc_info (GimpColorConfig *config,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! profile)
|
if (! profile)
|
||||||
profile = gimp_lcms_create_srgb_profile ();
|
profile = gimp_color_profile_new_srgb ();
|
||||||
|
|
||||||
if (name) *name = gimp_lcms_profile_get_model (profile);
|
if (name) *name = gimp_color_profile_get_model (profile);
|
||||||
if (desc) *desc = gimp_lcms_profile_get_description (profile);
|
if (desc) *desc = gimp_color_profile_get_description (profile);
|
||||||
if (info) *info = gimp_lcms_profile_get_summary (profile);
|
if (info) *info = gimp_color_profile_get_summary (profile);
|
||||||
|
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
|
|
||||||
return GIMP_PDB_SUCCESS;
|
return GIMP_PDB_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -671,16 +671,16 @@ lcms_icc_file_info (GFile *file,
|
|||||||
{
|
{
|
||||||
cmsHPROFILE profile;
|
cmsHPROFILE profile;
|
||||||
|
|
||||||
profile = gimp_lcms_profile_open_from_file (file, error);
|
profile = gimp_color_profile_open_from_file (file, error);
|
||||||
|
|
||||||
if (! profile)
|
if (! profile)
|
||||||
return GIMP_PDB_EXECUTION_ERROR;
|
return GIMP_PDB_EXECUTION_ERROR;
|
||||||
|
|
||||||
*name = gimp_lcms_profile_get_model (profile);
|
*name = gimp_color_profile_get_model (profile);
|
||||||
*desc = gimp_lcms_profile_get_description (profile);
|
*desc = gimp_color_profile_get_description (profile);
|
||||||
*info = gimp_lcms_profile_get_summary (profile);
|
*info = gimp_color_profile_get_summary (profile);
|
||||||
|
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
|
|
||||||
return GIMP_PDB_SUCCESS;
|
return GIMP_PDB_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -699,9 +699,9 @@ lcms_image_get_profile (GimpColorConfig *config,
|
|||||||
|
|
||||||
if (parasite)
|
if (parasite)
|
||||||
{
|
{
|
||||||
profile = gimp_lcms_profile_open_from_data (gimp_parasite_data (parasite),
|
profile = gimp_color_profile_open_from_data (gimp_parasite_data (parasite),
|
||||||
gimp_parasite_data_size (parasite),
|
gimp_parasite_data_size (parasite),
|
||||||
error);
|
error);
|
||||||
if (! profile)
|
if (! profile)
|
||||||
g_prefix_error (error, _("Error parsing 'icc-profile': "));
|
g_prefix_error (error, _("Error parsing 'icc-profile': "));
|
||||||
|
|
||||||
@ -731,7 +731,7 @@ lcms_image_set_profile (gint32 image,
|
|||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
/* check that this file is actually an ICC profile */
|
/* check that this file is actually an ICC profile */
|
||||||
file_profile = gimp_lcms_profile_open_from_file (file, &error);
|
file_profile = gimp_color_profile_open_from_file (file, &error);
|
||||||
|
|
||||||
if (! file_profile)
|
if (! file_profile)
|
||||||
{
|
{
|
||||||
@ -741,10 +741,10 @@ lcms_image_set_profile (gint32 image,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
profile_data = gimp_lcms_profile_save_to_data (file_profile,
|
profile_data = gimp_color_profile_save_to_data (file_profile,
|
||||||
&profile_length,
|
&profile_length,
|
||||||
&error);
|
&error);
|
||||||
gimp_lcms_profile_close (file_profile);
|
gimp_color_profile_close (file_profile);
|
||||||
|
|
||||||
if (! profile_data)
|
if (! profile_data)
|
||||||
{
|
{
|
||||||
@ -801,8 +801,8 @@ lcms_image_apply_profile (gint32 image,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
src_label = gimp_lcms_profile_get_label (src_profile);
|
src_label = gimp_color_profile_get_label (src_profile);
|
||||||
dest_label = gimp_lcms_profile_get_label (dest_profile);
|
dest_label = gimp_color_profile_get_label (dest_profile);
|
||||||
|
|
||||||
gimp_progress_init_printf (_("Converting from '%s' to '%s'"),
|
gimp_progress_init_printf (_("Converting from '%s' to '%s'"),
|
||||||
src_label, dest_label);
|
src_label, dest_label);
|
||||||
@ -900,8 +900,8 @@ lcms_layers_transform_rgb (gint *layers,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
iter_format = gimp_lcms_get_format (gimp_drawable_get_format (layer_id),
|
iter_format = gimp_color_profile_get_format (gimp_drawable_get_format (layer_id),
|
||||||
&lcms_format);
|
&lcms_format);
|
||||||
|
|
||||||
transform = cmsCreateTransform (src_profile, lcms_format,
|
transform = cmsCreateTransform (src_profile, lcms_format,
|
||||||
dest_profile, lcms_format,
|
dest_profile, lcms_format,
|
||||||
@ -1031,7 +1031,7 @@ lcms_icc_profile_src_label_new (gint32 image,
|
|||||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||||
gtk_widget_show (label);
|
gtk_widget_show (label);
|
||||||
|
|
||||||
name = gimp_lcms_profile_get_label (profile);
|
name = gimp_color_profile_get_label (profile);
|
||||||
label = g_object_new (GTK_TYPE_LABEL,
|
label = g_object_new (GTK_TYPE_LABEL,
|
||||||
"label", name,
|
"label", name,
|
||||||
"wrap", TRUE,
|
"wrap", TRUE,
|
||||||
@ -1058,7 +1058,7 @@ lcms_icc_profile_dest_label_new (cmsHPROFILE profile)
|
|||||||
gchar *name;
|
gchar *name;
|
||||||
gchar *text;
|
gchar *text;
|
||||||
|
|
||||||
name = gimp_lcms_profile_get_label (profile);
|
name = gimp_color_profile_get_label (profile);
|
||||||
text = g_strdup_printf (_("Convert the image to the RGB working space (%s)?"),
|
text = g_strdup_printf (_("Convert the image to the RGB working space (%s)?"),
|
||||||
name);
|
name);
|
||||||
g_free (name);
|
g_free (name);
|
||||||
@ -1178,13 +1178,13 @@ lcms_icc_combo_box_new (GimpColorConfig *config,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! profile)
|
if (! profile)
|
||||||
profile = gimp_lcms_create_srgb_profile ();
|
profile = gimp_color_profile_new_srgb ();
|
||||||
|
|
||||||
name = gimp_lcms_profile_get_label (profile);
|
name = gimp_color_profile_get_label (profile);
|
||||||
label = g_strdup_printf (_("RGB workspace (%s)"), name);
|
label = g_strdup_printf (_("RGB workspace (%s)"), name);
|
||||||
g_free (name);
|
g_free (name);
|
||||||
|
|
||||||
gimp_lcms_profile_close (profile);
|
gimp_color_profile_close (profile);
|
||||||
|
|
||||||
gimp_color_profile_combo_box_add (GIMP_COLOR_PROFILE_COMBO_BOX (combo),
|
gimp_color_profile_combo_box_add (GIMP_COLOR_PROFILE_COMBO_BOX (combo),
|
||||||
rgb_filename, label);
|
rgb_filename, label);
|
||||||
@ -1223,7 +1223,7 @@ lcms_dialog (GimpColorConfig *config,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! src_profile)
|
if (! src_profile)
|
||||||
src_profile = gimp_lcms_create_srgb_profile ();
|
src_profile = gimp_color_profile_new_srgb ();
|
||||||
|
|
||||||
gimp_ui_init (PLUG_IN_BINARY, FALSE);
|
gimp_ui_init (PLUG_IN_BINARY, FALSE);
|
||||||
|
|
||||||
@ -1259,7 +1259,7 @@ lcms_dialog (GimpColorConfig *config,
|
|||||||
gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
|
||||||
gtk_widget_show (frame);
|
gtk_widget_show (frame);
|
||||||
|
|
||||||
name = gimp_lcms_profile_get_label (src_profile);
|
name = gimp_color_profile_get_label (src_profile);
|
||||||
|
|
||||||
label = gtk_label_new (name);
|
label = gtk_label_new (name);
|
||||||
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||||
@ -1333,7 +1333,7 @@ lcms_dialog (GimpColorConfig *config,
|
|||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
dest_profile = gimp_lcms_profile_open_from_file (file, &error);
|
dest_profile = gimp_color_profile_open_from_file (file, &error);
|
||||||
|
|
||||||
if (! dest_profile)
|
if (! dest_profile)
|
||||||
{
|
{
|
||||||
@ -1343,12 +1343,12 @@ lcms_dialog (GimpColorConfig *config,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dest_profile = gimp_lcms_create_srgb_profile ();
|
dest_profile = gimp_color_profile_new_srgb ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dest_profile)
|
if (dest_profile)
|
||||||
{
|
{
|
||||||
if (gimp_lcms_profile_is_rgb (dest_profile))
|
if (gimp_color_profile_is_rgb (dest_profile))
|
||||||
{
|
{
|
||||||
if (apply)
|
if (apply)
|
||||||
success = lcms_image_apply_profile (image,
|
success = lcms_image_apply_profile (image,
|
||||||
@ -1365,7 +1365,7 @@ lcms_dialog (GimpColorConfig *config,
|
|||||||
g_message (_("Destination profile is not for RGB color space."));
|
g_message (_("Destination profile is not for RGB color space."));
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_lcms_profile_close (dest_profile);
|
gimp_color_profile_close (dest_profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file)
|
if (file)
|
||||||
@ -1379,7 +1379,7 @@ lcms_dialog (GimpColorConfig *config,
|
|||||||
|
|
||||||
gtk_widget_destroy (dialog);
|
gtk_widget_destroy (dialog);
|
||||||
|
|
||||||
gimp_lcms_profile_close (src_profile);
|
gimp_color_profile_close (src_profile);
|
||||||
|
|
||||||
return (run ?
|
return (run ?
|
||||||
(success ? GIMP_PDB_SUCCESS : GIMP_PDB_EXECUTION_ERROR) :
|
(success ? GIMP_PDB_SUCCESS : GIMP_PDB_EXECUTION_ERROR) :
|
||||||
|
@ -604,13 +604,13 @@ jpeg_load_cmyk_transform (guint8 *profile_data,
|
|||||||
/* try to load the embedded CMYK profile */
|
/* try to load the embedded CMYK profile */
|
||||||
if (profile_data)
|
if (profile_data)
|
||||||
{
|
{
|
||||||
cmyk_profile = gimp_lcms_profile_open_from_data (profile_data,
|
cmyk_profile = gimp_color_profile_open_from_data (profile_data,
|
||||||
profile_len,
|
profile_len,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (cmyk_profile && ! gimp_lcms_profile_is_cmyk (cmyk_profile))
|
if (cmyk_profile && ! gimp_color_profile_is_cmyk (cmyk_profile))
|
||||||
{
|
{
|
||||||
gimp_lcms_profile_close (cmyk_profile);
|
gimp_color_profile_close (cmyk_profile);
|
||||||
cmyk_profile = NULL;
|
cmyk_profile = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -631,7 +631,7 @@ jpeg_load_cmyk_transform (guint8 *profile_data,
|
|||||||
|
|
||||||
/* make the real sRGB profile as a fallback */
|
/* make the real sRGB profile as a fallback */
|
||||||
if (! rgb_profile)
|
if (! rgb_profile)
|
||||||
rgb_profile = gimp_lcms_create_srgb_profile ();
|
rgb_profile = gimp_color_profile_new_srgb ();
|
||||||
|
|
||||||
if (config->display_intent ==
|
if (config->display_intent ==
|
||||||
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC)
|
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC)
|
||||||
@ -644,8 +644,8 @@ jpeg_load_cmyk_transform (guint8 *profile_data,
|
|||||||
config->display_intent,
|
config->display_intent,
|
||||||
flags);
|
flags);
|
||||||
|
|
||||||
gimp_lcms_profile_close (cmyk_profile);
|
gimp_color_profile_close (cmyk_profile);
|
||||||
gimp_lcms_profile_close (rgb_profile);
|
gimp_color_profile_close (rgb_profile);
|
||||||
|
|
||||||
g_object_unref (config);
|
g_object_unref (config);
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ libgimpbase/gimpmemsize.c
|
|||||||
libgimpbase/gimpmetadata.c
|
libgimpbase/gimpmetadata.c
|
||||||
libgimpbase/gimputils.c
|
libgimpbase/gimputils.c
|
||||||
|
|
||||||
libgimpcolor/gimplcms.c
|
libgimpcolor/gimpcolorprofile.c
|
||||||
|
|
||||||
libgimpconfig/gimpcolorconfig.c
|
libgimpconfig/gimpcolorconfig.c
|
||||||
libgimpconfig/gimpcolorconfig-enums.c
|
libgimpconfig/gimpcolorconfig-enums.c
|
||||||
|
Reference in New Issue
Block a user