[gimp] app, libgimpcolor: handle palette formats across babl_format_with_space()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app, libgimpcolor: handle palette formats across babl_format_with_space()
- Date: Tue, 1 Jan 2019 15:37:59 +0000 (UTC)
commit 78f5d39e1a5bcbc7f94d7cbd1f3f40dfac6704bb
Author: Michael Natterer <mitch gimp org>
Date: Tue Jan 1 16:34:57 2019 +0100
app, libgimpcolor: handle palette formats across babl_format_with_space()
Don't just pass the input format's encoding because that loses the
palette. Instead, pass the input format directly so
babl_format_with_space() can do its job of preserving the palette.
app/core/gimplayer.c | 2 +-
libgimpcolor/gimpcolorprofile.c | 2 +-
libgimpcolor/gimpcolortransform.c | 20 ++++++++------------
3 files changed, 10 insertions(+), 14 deletions(-)
---
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index a3b8eeeb13..d7a51c0ebf 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -1425,7 +1425,7 @@ gimp_layer_convert_type (GimpDrawable *drawable,
dest_space = gimp_image_get_layer_space (dest_image);
}
- space_format = babl_format_with_space (babl_format_get_encoding (new_format),
+ space_format = babl_format_with_space ((const gchar *) new_format,
dest_space);
GIMP_LAYER_GET_CLASS (layer)->convert_type (layer, dest_image, space_format,
diff --git a/libgimpcolor/gimpcolorprofile.c b/libgimpcolor/gimpcolorprofile.c
index 805f0cfc42..fd7cc74d8e 100644
--- a/libgimpcolor/gimpcolorprofile.c
+++ b/libgimpcolor/gimpcolorprofile.c
@@ -1516,7 +1516,7 @@ gimp_color_profile_get_format (GimpColorProfile *profile,
if (! space)
return NULL;
- return babl_format_with_space (babl_format_get_encoding (format), space);
+ return babl_format_with_space ((const gchar *) format, space);
}
/**
diff --git a/libgimpcolor/gimpcolortransform.c b/libgimpcolor/gimpcolortransform.c
index 4ffb76ef78..b0b113e7e8 100644
--- a/libgimpcolor/gimpcolortransform.c
+++ b/libgimpcolor/gimpcolortransform.c
@@ -251,10 +251,8 @@ gimp_color_transform_new (GimpColorProfile *src_profile,
* spaces, gimp_color_profile_get_lcms_format() might return the
* same format and it must be without space
*/
- src_format = babl_format_with_space (babl_format_get_encoding (src_format),
- NULL);
- dest_format = babl_format_with_space (babl_format_get_encoding (dest_format),
- NULL);
+ src_format = babl_format_with_space ((const gchar *) src_format, NULL);
+ dest_format = babl_format_with_space ((const gchar *) dest_format, NULL);
priv->src_format = gimp_color_profile_get_lcms_format (src_format,
&lcms_src_format);
@@ -347,10 +345,8 @@ gimp_color_transform_new_proofing (GimpColorProfile *src_profile,
/* see gimp_color_transform_new(), we can't have color spaces
* on the formats
*/
- src_format = babl_format_with_space (babl_format_get_encoding (src_format),
- NULL);
- dest_format = babl_format_with_space (babl_format_get_encoding (dest_format),
- NULL);
+ src_format = babl_format_with_space ((const gchar *) src_format, NULL);
+ dest_format = babl_format_with_space ((const gchar *) dest_format, NULL);
priv->src_format = gimp_color_profile_get_lcms_format (src_format,
&lcms_src_format);
@@ -432,10 +428,10 @@ gimp_color_transform_process_pixels (GimpColorTransform *transform,
* input and output color spaces.
*/
src_format =
- babl_format_with_space (babl_format_get_encoding (src_format),
+ babl_format_with_space ((const gchar *) src_format,
babl_format_get_space (priv->src_format));
dest_format =
- babl_format_with_space (babl_format_get_encoding (dest_format),
+ babl_format_with_space ((const gchar *) dest_format,
babl_format_get_space (priv->dest_format));
if (src_format != priv->src_format)
@@ -540,10 +536,10 @@ gimp_color_transform_process_buffer (GimpColorTransform *transform,
dest_format = gegl_buffer_get_format (dest_buffer);
src_format =
- babl_format_with_space (babl_format_get_encoding (priv->src_format),
+ babl_format_with_space ((const gchar *) priv->src_format,
babl_format_get_space (src_format));
dest_format =
- babl_format_with_space (babl_format_get_encoding (priv->dest_format),
+ babl_format_with_space ((const gchar *) priv->dest_format,
babl_format_get_space (dest_format));
if (src_buffer != dest_buffer)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]