[gimp/goat-invasion: 286/418] app: correct usage of babl formats
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/goat-invasion: 286/418] app: correct usage of babl formats
- Date: Wed, 4 Apr 2012 10:49:50 +0000 (UTC)
commit 6cd043590ab1471a0194456c4c6f91a2f97bd5da
Author: Ãyvind KolÃs <pippin gimp org>
Date: Tue Mar 27 21:31:47 2012 +0100
app: correct usage of babl formats
GIMP was doing evil hacks lying to GEGL about it's pixels being in a linear
color space when they are not. This causes incorrect rendering, makes gaussian
blur misbehave etc.
The legacy projection modes should be implemented using the same 2.2 gamma
formats that are correct to specify for sRGB data. (for proper color
management in higher bitdepths; icc backend babl formats should be used.)
For the old image modes correct babl formats are:
R'G'B'A u8 - 8 bit RGB with 2.2 gamma (sRGB) with linear alpha component
R'G'B' u8 - 8 bit RGB with 2.2 gamma (sRGB)
Y'A u8 - 8 bit Grayscale with 2.2 gamma with linear alpha component
Y' u8 - 8 bit Grayscale with 2.2 gamma
Y u8 - 8 bit linear data, used for masks/channels
A u8 - 8 bit linear alpha
-----------------------------------------------
RGBA float - 32bit floating point linear light RGB
RaGaBaA float - 32bit floating point linear light RGB, premultiplied alpha
to be used for processing that needs to scale by the alpha,
(blurs, resampling etc)
R'G'B'A float - 32bit floating point sRGB with gamma, to be used where
the result depends on being closer to perceptual when
processing, can be used a cheaper alternative to CIE Lab
based modes.
-----------------------------------------------
The legacy layer modes should use the formats with gamma 2.2 only for loading
and rendering legacy XCF files correctly, in the brave new world compositing
should most likely be done in linear light with "RGBA float" and even better
"RaGaBaA float" like GEGL does for porter duff and other compositing modes.
The ability to chose the legacy layer modes should probably be hidden from the
user unless an old .xcf has been opened.
app/core/gimpbrushclipboard.c | 2 +-
app/core/gimpbuffer.c | 3 +-
app/core/gimpdrawable.c | 8 ++--
app/core/gimpimage.c | 34 +++++++-------
app/core/gimppattern.c | 2 +-
app/core/gimppatternclipboard.c | 2 +-
app/core/gimpprojection.c | 4 +-
app/core/gimpselection.c | 4 +-
app/gegl/gimp-gegl-utils.c | 75 ++++++++------------------------
app/gegl/gimp-gegl-utils.h | 6 +--
app/gegl/gimp-gegl.c | 16 +++---
app/gegl/gimpoperationpointlayermode.c | 8 ++--
app/gegl/gimpoperationsetalpha.c | 4 +-
app/gegl/gimptilebackendtilemanager.c | 4 +-
app/paint/gimpbrushcore.c | 4 +-
app/paint/gimpclone.c | 2 +-
app/text/gimptextlayer.c | 2 +-
libgimp/gimptilebackendplugin.c | 10 ++--
18 files changed, 75 insertions(+), 115 deletions(-)
---
diff --git a/app/core/gimpbrushclipboard.c b/app/core/gimpbrushclipboard.c
index 31fd838..21c8208 100644
--- a/app/core/gimpbrushclipboard.c
+++ b/app/core/gimpbrushclipboard.c
@@ -233,7 +233,7 @@ gimp_brush_clipboard_buffer_changed (Gimp *gimp,
/* copy the color channels into the brush's pixmap */
dest_buffer =
gegl_buffer_linear_new_from_data (temp_buf_get_data (brush->pixmap),
- babl_format ("RGB u8"),
+ babl_format ("R'G'B' u8"),
&rect,
width * brush->pixmap->bytes,
NULL, NULL);
diff --git a/app/core/gimpbuffer.c b/app/core/gimpbuffer.c
index 63328a6..a64fef3 100644
--- a/app/core/gimpbuffer.c
+++ b/app/core/gimpbuffer.c
@@ -205,8 +205,7 @@ gimp_buffer_get_new_preview (GimpViewable *viewable,
NULL,
MIN ((gdouble) width / (gdouble) gimp_buffer_get_width (buffer),
(gdouble) height / (gdouble) gimp_buffer_get_height (buffer)),
- gimp_bpp_to_babl_format (gimp_buffer_get_bytes (buffer),
- TRUE),
+ gimp_bpp_to_babl_format (gimp_buffer_get_bytes (buffer)),
temp_buf_get_data (preview),
width * gimp_buffer_get_bytes (buffer),
GEGL_ABYSS_NONE);
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 7b1f350..6f8b0da 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -1689,13 +1689,13 @@ gimp_drawable_type (const GimpDrawable *drawable)
format = drawable->private->format;
- if (format == babl_format ("Y u8"))
+ if (format == babl_format ("Y' u8"))
return GIMP_GRAY_IMAGE;
- else if (format == babl_format ("YA u8"))
+ else if (format == babl_format ("Y'A u8"))
return GIMP_GRAYA_IMAGE;
- else if (format == babl_format ("RGB u8"))
+ else if (format == babl_format ("R'G'B' u8"))
return GIMP_RGB_IMAGE;
- else if (format == babl_format ("RGBA u8"))
+ else if (format == babl_format ("R'G'B'A u8"))
return GIMP_RGBA_IMAGE;
else
{
diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c
index 4661197..40ad834 100644
--- a/app/core/gimpimage.c
+++ b/app/core/gimpimage.c
@@ -1181,11 +1181,11 @@ gimp_image_real_colormap_changed (GimpImage *image,
if (private->colormap)
{
babl_palette_set_palette (private->babl_palette_rgb,
- babl_format ("RGB u8"),
+ babl_format ("R'G'B' u8"),
private->colormap,
private->n_colors);
babl_palette_set_palette (private->babl_palette_rgba,
- babl_format ("RGB u8"),
+ babl_format ("R'G'B' u8"),
private->colormap,
private->n_colors);
}
@@ -1492,10 +1492,10 @@ gimp_image_get_format (const GimpImage *image,
switch (type)
{
- case GIMP_RGB_IMAGE: return babl_format ("RGB u8");
- case GIMP_RGBA_IMAGE: return babl_format ("RGBA u8");
- case GIMP_GRAY_IMAGE: return babl_format ("Y u8");
- case GIMP_GRAYA_IMAGE: return babl_format ("YA u8");
+ case GIMP_RGB_IMAGE: return babl_format ("R'G'B' u8");
+ case GIMP_RGBA_IMAGE: return babl_format ("R'G'B'A u8");
+ case GIMP_GRAY_IMAGE: return babl_format ("Y' u8");
+ case GIMP_GRAYA_IMAGE: return babl_format ("Y'A u8");
case GIMP_INDEXED_IMAGE: return gimp_image_colormap_get_rgb_format (image);
case GIMP_INDEXEDA_IMAGE: return gimp_image_colormap_get_rgba_format (image);
}
@@ -1514,9 +1514,9 @@ gimp_image_get_format_with_alpha (const GimpImage *image,
switch (type)
{
case GIMP_RGB_IMAGE:
- case GIMP_RGBA_IMAGE: return babl_format ("RGBA u8");
+ case GIMP_RGBA_IMAGE: return babl_format ("R'G'B'A u8");
case GIMP_GRAY_IMAGE:
- case GIMP_GRAYA_IMAGE: return babl_format ("YA u8");
+ case GIMP_GRAYA_IMAGE: return babl_format ("Y'A u8");
case GIMP_INDEXED_IMAGE:
case GIMP_INDEXEDA_IMAGE: return gimp_image_colormap_get_rgba_format (image);
}
@@ -1535,9 +1535,9 @@ gimp_image_get_format_without_alpha (const GimpImage *image,
switch (type)
{
case GIMP_RGB_IMAGE:
- case GIMP_RGBA_IMAGE: return babl_format ("RGB u8");
+ case GIMP_RGBA_IMAGE: return babl_format ("R'G'B' u8");
case GIMP_GRAY_IMAGE:
- case GIMP_GRAYA_IMAGE: return babl_format ("Y u8");
+ case GIMP_GRAYA_IMAGE: return babl_format ("Y' u8");
case GIMP_INDEXED_IMAGE:
case GIMP_INDEXEDA_IMAGE: return gimp_image_colormap_get_rgb_format (image);
}
@@ -2054,11 +2054,11 @@ gimp_image_get_component_format (const GimpImage *image,
switch (channel)
{
- case GIMP_RED_CHANNEL: return babl_format ("R u8");
- case GIMP_GREEN_CHANNEL: return babl_format ("G u8");
- case GIMP_BLUE_CHANNEL: return babl_format ("B u8");
- case GIMP_GRAY_CHANNEL: return babl_format ("Y u8");
- case GIMP_INDEXED_CHANNEL: return babl_format ("Y u8");
+ case GIMP_RED_CHANNEL: return babl_format ("R' u8");
+ case GIMP_GREEN_CHANNEL: return babl_format ("G' u8");
+ case GIMP_BLUE_CHANNEL: return babl_format ("B' u8");
+ case GIMP_GRAY_CHANNEL: return babl_format ("Y' u8");
+ case GIMP_INDEXED_CHANNEL: return babl_format ("Y' u8"); /* XXX: seems wrong */
case GIMP_ALPHA_CHANNEL: return babl_format ("A u8");
}
@@ -2729,7 +2729,7 @@ gimp_image_transform_rgb (const GimpImage *dest_image,
gimp_rgba_get_uchar (rgb, &col[0], &col[1], &col[2], &col[3]);
- babl_process (babl_fish (babl_format ("RGBA u8"), dest_format),
+ babl_process (babl_fish (babl_format ("R'G'B'A u8"), dest_format),
col, color, 1);
}
@@ -2747,7 +2747,7 @@ gimp_image_transform_temp_buf (const GimpImage *dest_image,
g_return_val_if_fail (temp_buf != NULL, NULL);
g_return_val_if_fail (new_buf != NULL, NULL);
- buf_format = gimp_bpp_to_babl_format (temp_buf->bytes, TRUE);
+ buf_format = gimp_bpp_to_babl_format (temp_buf->bytes);
ret_format = gimp_image_get_format (dest_image, dest_type);
/* If the pattern doesn't match the image in terms of color type,
diff --git a/app/core/gimppattern.c b/app/core/gimppattern.c
index 6bf163c..a54fa42 100644
--- a/app/core/gimppattern.c
+++ b/app/core/gimppattern.c
@@ -278,7 +278,7 @@ gimp_pattern_create_buffer (const GimpPattern *pattern)
bytes = pattern->mask->bytes;
return gegl_buffer_linear_new_from_data (temp_buf_get_data (pattern->mask),
- gimp_bpp_to_babl_format (bytes, TRUE),
+ gimp_bpp_to_babl_format (bytes),
GIMP_GEGL_RECT(0,0,width,height),
width * bytes,
NULL, NULL);
diff --git a/app/core/gimppatternclipboard.c b/app/core/gimppatternclipboard.c
index 2dbedfe..f685980 100644
--- a/app/core/gimppatternclipboard.c
+++ b/app/core/gimppatternclipboard.c
@@ -201,7 +201,7 @@ gimp_pattern_clipboard_buffer_changed (Gimp *gimp,
gegl_buffer_get (gimp_buffer_get_buffer (buffer),
GIMP_GEGL_RECT (0,0,width,height), 1.0,
- gimp_bpp_to_babl_format (bytes, TRUE),
+ gimp_bpp_to_babl_format (bytes),
temp_buf_get_data (pattern->mask),
width * gimp_buffer_get_bytes (buffer),
GEGL_ABYSS_NONE);
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index 92a355e..3320ac9 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -307,10 +307,10 @@ gimp_projection_get_format (GimpPickable *pickable)
{
case GIMP_RGB:
case GIMP_INDEXED:
- return babl_format ("RGBA u8");
+ return babl_format ("R'G'B'A u8");
case GIMP_GRAY:
- return babl_format ("YA u8");
+ return babl_format ("Y'A u8");
}
g_assert_not_reached ();
diff --git a/app/core/gimpselection.c b/app/core/gimpselection.c
index 9ca77de..533ef0c 100644
--- a/app/core/gimpselection.c
+++ b/app/core/gimpselection.c
@@ -691,9 +691,9 @@ gimp_selection_extract (GimpSelection *selection,
{
if (add_alpha ||
GIMP_IMAGE_TYPE_HAS_ALPHA (gimp_pickable_get_image_type (pickable)))
- format = babl_format ("RGBA u8");
+ format = babl_format ("R'G'B'A u8");
else
- format = babl_format ("RGB u8");
+ format = babl_format ("R'G'B' u8");
}
break;
diff --git a/app/gegl/gimp-gegl-utils.c b/app/gegl/gimp-gegl-utils.c
index 3feeb01..09374b5 100644
--- a/app/gegl/gimp-gegl-utils.c
+++ b/app/gegl/gimp-gegl-utils.c
@@ -36,7 +36,6 @@
/**
* gimp_bpp_to_babl_format:
* @bpp: bytes per pixel
- * @linear: whether the pixels are linear or gamma-corrected.
*
* Return the Babl format to use for a given number of bytes per pixel.
* This function assumes that the data is 8bit.
@@ -44,38 +43,20 @@
* Return value: the Babl format to use
**/
const Babl *
-gimp_bpp_to_babl_format (guint bpp,
- gboolean linear)
+gimp_bpp_to_babl_format (guint bpp)
{
g_return_val_if_fail (bpp > 0 && bpp <= 4, NULL);
- if (linear)
+ switch (bpp)
{
- switch (bpp)
- {
- case 1:
- return babl_format ("Y u8");
- case 2:
- return babl_format ("YA u8");
- case 3:
- return babl_format ("RGB u8");
- case 4:
- return babl_format ("RGBA u8");
- }
- }
- else
- {
- switch (bpp)
- {
- case 1:
- return babl_format ("Y' u8");
- case 2:
- return babl_format ("Y'A u8");
- case 3:
- return babl_format ("R'G'B' u8");
- case 4:
- return babl_format ("R'G'B'A u8");
- }
+ case 1:
+ return babl_format ("Y' u8");
+ case 2:
+ return babl_format ("Y'A u8");
+ case 3:
+ return babl_format ("R'G'B' u8");
+ case 4:
+ return babl_format ("R'G'B'A u8");
}
return NULL;
@@ -84,7 +65,6 @@ gimp_bpp_to_babl_format (guint bpp,
/**
* gimp_bpp_to_babl_format_with_alpha:
* @bpp: bytes per pixel
- * @linear: whether the pixels are linear or gamma-corrected.
*
* Return the Babl format to use for a given number of bytes per pixel.
* This function assumes that the data is 8bit.
@@ -92,34 +72,18 @@ gimp_bpp_to_babl_format (guint bpp,
* Return value: the Babl format to use
**/
const Babl *
-gimp_bpp_to_babl_format_with_alpha (guint bpp,
- gboolean linear)
+gimp_bpp_to_babl_format_with_alpha (guint bpp)
{
g_return_val_if_fail (bpp > 0 && bpp <= 4, NULL);
- if (linear)
+ switch (bpp)
{
- switch (bpp)
- {
- case 1:
- case 2:
- return babl_format ("YA u8");
- case 3:
- case 4:
- return babl_format ("RGBA u8");
- }
- }
- else
- {
- switch (bpp)
- {
- case 1:
- case 2:
- return babl_format ("Y'A u8");
- case 3:
- case 4:
- return babl_format ("R'G'B'A u8");
- }
+ case 1:
+ case 2:
+ return babl_format ("Y'A u8");
+ case 3:
+ case 4:
+ return babl_format ("R'G'B'A u8");
}
return NULL;
@@ -157,8 +121,7 @@ gimp_pixbuf_create_buffer (GdkPixbuf *pixbuf)
channels = gdk_pixbuf_get_n_channels (pixbuf);
return gegl_buffer_linear_new_from_data (gdk_pixbuf_get_pixels (pixbuf),
- gimp_bpp_to_babl_format (channels,
- TRUE),
+ gimp_bpp_to_babl_format (channels),
GIMP_GEGL_RECT (0,0,width,height),
rowstride,
(GDestroyNotify) g_object_unref,
diff --git a/app/gegl/gimp-gegl-utils.h b/app/gegl/gimp-gegl-utils.h
index fdbb89c..415b74b 100644
--- a/app/gegl/gimp-gegl-utils.h
+++ b/app/gegl/gimp-gegl-utils.h
@@ -25,10 +25,8 @@
#include <gdk-pixbuf/gdk-pixbuf.h> /* temp hack */
-const Babl * gimp_bpp_to_babl_format (guint bpp,
- gboolean linear) G_GNUC_CONST;
-const Babl * gimp_bpp_to_babl_format_with_alpha (guint bpp,
- gboolean linear) G_GNUC_CONST;
+const Babl * gimp_bpp_to_babl_format (guint bpp) G_GNUC_CONST;
+const Babl * gimp_bpp_to_babl_format_with_alpha (guint bpp) G_GNUC_CONST;
const gchar * gimp_interpolation_to_gegl_filter (GimpInterpolationType interpolation) G_GNUC_CONST;
diff --git a/app/gegl/gimp-gegl.c b/app/gegl/gimp-gegl.c
index ca784fe..10fa874 100644
--- a/app/gegl/gimp-gegl.c
+++ b/app/gegl/gimp-gegl.c
@@ -102,23 +102,23 @@ gimp_gegl_init (Gimp *gimp)
G_CALLBACK (gimp_gegl_notify_tile_cache_size),
NULL);
- babl_format_new ("name", "R u8",
- babl_model ("RGBA"),
+ babl_format_new ("name", "R' u8",
+ babl_model ("R'G'B'A"),
babl_type ("u8"),
babl_component ("R"),
NULL);
- babl_format_new ("name", "G u8",
- babl_model ("RGBA"),
+ babl_format_new ("name", "G' u8",
+ babl_model ("R'G'B'A"),
babl_type ("u8"),
babl_component ("G"),
NULL);
- babl_format_new ("name", "B u8",
- babl_model ("RGBA"),
+ babl_format_new ("name", "B' u8",
+ babl_model ("R'G'B'A"),
babl_type ("u8"),
babl_component ("B"),
NULL);
- babl_format_new ("name", "A u8",
- babl_model ("RGBA"),
+ babl_format_new ("name", "A' u8",
+ babl_model ("R'G'B'A"),
babl_type ("u8"),
babl_component ("A"),
NULL);
diff --git a/app/gegl/gimpoperationpointlayermode.c b/app/gegl/gimpoperationpointlayermode.c
index 0d26d8b..450bacb 100644
--- a/app/gegl/gimpoperationpointlayermode.c
+++ b/app/gegl/gimpoperationpointlayermode.c
@@ -203,9 +203,9 @@ gimp_operation_point_layer_mode_prepare (GeglOperation *operation)
const Babl *format;
if (self->premultiplied)
- format = babl_format ("RaGaBaA float");
+ format = babl_format ("R'aG'aB'aA float");
else
- format = babl_format ("RGBA float");
+ format = babl_format ("R'G'B'A float");
gegl_operation_set_format (operation, "input", format);
gegl_operation_set_format (operation, "output", format);
@@ -221,10 +221,10 @@ gimp_operation_point_layer_mode_get_new_color_lchab (GimpLayerModeEffects blend
float in_lchab[3];
float lay_lchab[3];
float new_lchab[3];
- const Babl *ragabaa_to_lchab = babl_fish (babl_format ("RaGaBaA float"),
+ const Babl *ragabaa_to_lchab = babl_fish (babl_format ("R'aG'aB'aA float"),
babl_format ("CIE LCH(ab) float"));
const Babl *lchab_to_ragabaa = babl_fish (babl_format ("CIE LCH(ab) float"),
- babl_format ("RaGaBaA float"));
+ babl_format ("R'aG'aB'aA float"));
babl_process (ragabaa_to_lchab, (void*)in, (void*)in_lchab, 1);
babl_process (ragabaa_to_lchab, (void*)lay, (void*)lay_lchab, 1);
diff --git a/app/gegl/gimpoperationsetalpha.c b/app/gegl/gimpoperationsetalpha.c
index bbf8bcd..fea77c2 100644
--- a/app/gegl/gimpoperationsetalpha.c
+++ b/app/gegl/gimpoperationsetalpha.c
@@ -133,9 +133,9 @@ gimp_operation_set_alpha_set_property (GObject *object,
static void
gimp_operation_set_alpha_prepare (GeglOperation *operation)
{
- gegl_operation_set_format (operation, "input", babl_format ("RGBA float"));
+ gegl_operation_set_format (operation, "input", babl_format ("R'G'B'A float"));
gegl_operation_set_format (operation, "aux", babl_format ("Y float"));
- gegl_operation_set_format (operation, "output", babl_format ("RGBA float"));
+ gegl_operation_set_format (operation, "output", babl_format ("R'G'B'A float"));
}
static gboolean
diff --git a/app/gegl/gimptilebackendtilemanager.c b/app/gegl/gimptilebackendtilemanager.c
index c498de0..a5f0aba 100644
--- a/app/gegl/gimptilebackendtilemanager.c
+++ b/app/gegl/gimptilebackendtilemanager.c
@@ -378,14 +378,14 @@ gimp_tile_backend_tile_manager_new (TileManager *tm,
g_return_val_if_fail (format == NULL ||
babl_format_get_bytes_per_pixel (format) ==
- babl_format_get_bytes_per_pixel (gimp_bpp_to_babl_format (bpp, TRUE)),
+ babl_format_get_bytes_per_pixel (gimp_bpp_to_babl_format (bpp)),
NULL);
if (tm->validate_proc)
mul = 1;
if (! format)
- format = gimp_bpp_to_babl_format (bpp, TRUE);
+ format = gimp_bpp_to_babl_format (bpp);
ret = g_object_new (GIMP_TYPE_TILE_BACKEND_TILE_MANAGER,
"tile-width", TILE_WIDTH * mul,
diff --git a/app/paint/gimpbrushcore.c b/app/paint/gimpbrushcore.c
index ea9bded..507c4de 100644
--- a/app/paint/gimpbrushcore.c
+++ b/app/paint/gimpbrushcore.c
@@ -1627,7 +1627,7 @@ gimp_brush_core_paint_line_pixmap_mask (GimpImage *dest,
guchar *l = line_buf;
gint i;
- fish = babl_fish (gimp_bpp_to_babl_format_with_alpha (pixmap_mask->bytes, TRUE),
+ fish = babl_fish (gimp_bpp_to_babl_format_with_alpha (pixmap_mask->bytes),
gimp_drawable_get_format_with_alpha (drawable));
/* put the source pixmap's pixels, plus the mask's alpha, into
@@ -1655,7 +1655,7 @@ gimp_brush_core_paint_line_pixmap_mask (GimpImage *dest,
guchar *l = line_buf;
gint i;
- fish = babl_fish (gimp_bpp_to_babl_format (pixmap_mask->bytes, TRUE),
+ fish = babl_fish (gimp_bpp_to_babl_format (pixmap_mask->bytes),
gimp_drawable_get_format_with_alpha (drawable));
/* put the source pixmap's pixels, into one line, so we can use
diff --git a/app/paint/gimpclone.c b/app/paint/gimpclone.c
index 0ce1cdd..7a0e316 100644
--- a/app/paint/gimpclone.c
+++ b/app/paint/gimpclone.c
@@ -207,7 +207,7 @@ gimp_clone_motion (GimpSourceCore *source_core,
PixelRegion destPR;
gpointer pr;
- fish = babl_fish (gimp_bpp_to_babl_format (pattern->mask->bytes, TRUE),
+ fish = babl_fish (gimp_bpp_to_babl_format (pattern->mask->bytes),
gimp_drawable_get_format_with_alpha (drawable));
pixel_region_init_temp_buf (&destPR, paint_area,
diff --git a/app/text/gimptextlayer.c b/app/text/gimptextlayer.c
index b185792..c8bbc58 100644
--- a/app/text/gimptextlayer.c
+++ b/app/text/gimptextlayer.c
@@ -682,7 +682,7 @@ gimp_text_layer_render_layout (GimpTextLayer *layer,
buffer = gimp_drawable_get_buffer (drawable);
format = gimp_drawable_get_format (drawable);
- fish = babl_fish (babl_format ("RGBA u8"), format);
+ fish = babl_fish (babl_format ("R'G'B'A u8"), format);
bytes = babl_format_get_bytes_per_pixel (format);
iter = gegl_buffer_iterator_new (buffer, NULL, 0, format,
diff --git a/libgimp/gimptilebackendplugin.c b/libgimp/gimptilebackendplugin.c
index 17d564b..5fcee1f 100644
--- a/libgimp/gimptilebackendplugin.c
+++ b/libgimp/gimptilebackendplugin.c
@@ -50,10 +50,10 @@ static const Babl *get_format (gint32 drawable_ID)
{
switch (gimp_drawable_type (drawable_ID))
{
- case GIMP_RGB_IMAGE: return babl_format ("RGB u8");
- case GIMP_RGBA_IMAGE: return babl_format ("RGBA u8");
- case GIMP_GRAY_IMAGE: return babl_format ("Y u8");
- case GIMP_GRAYA_IMAGE: return babl_format ("YA u8");
+ case GIMP_RGB_IMAGE: return babl_format ("R'G'B' u8");
+ case GIMP_RGBA_IMAGE: return babl_format ("R'G'B'A u8");
+ case GIMP_GRAY_IMAGE: return babl_format ("Y' u8");
+ case GIMP_GRAYA_IMAGE: return babl_format ("Y'A u8");
case GIMP_INDEXED_IMAGE:
case GIMP_INDEXEDA_IMAGE:
{
@@ -62,7 +62,7 @@ static const Babl *get_format (gint32 drawable_ID)
gint ncols;
guchar *cmap = gimp_image_get_colormap (image_ID, &ncols);
babl_new_palette (NULL, &pal, &pala);
- babl_palette_set_palette (pal, babl_format ("RGB u8"),
+ babl_palette_set_palette (pal, babl_format ("R'G'B' u8"),
cmap, ncols);
g_free (cmap);
if (gimp_drawable_type (drawable_ID) == GIMP_INDEXEDA_IMAGE)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]