[gegl] buffer: force nearest neighbor scaling for CMYK buffers
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] buffer: force nearest neighbor scaling for CMYK buffers
- Date: Mon, 26 Nov 2018 11:28:51 +0000 (UTC)
commit da209085ec13de57d9120771c8704c0993dd8e2c
Author: Øyvind Kolås <pippin gimp org>
Date: Fri Nov 23 04:30:27 2018 +0100
buffer: force nearest neighbor scaling for CMYK buffers
This makes it possible to work with CMYK based buffers in the ui of
the standalone GEGL binary at zoom factors <100%. The problem this
works around is RGB assumptions in the 2x2 downscale and boxfilter
algorithms for GeglBuffer.
gegl/buffer/gegl-buffer-access.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index 5d4599e37..e89007353 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -2015,6 +2015,7 @@ _gegl_buffer_get_unlocked (GeglBuffer *buffer,
g_return_if_fail (scale > 0.0f);
+
if (format == NULL)
format = buffer->soft_format;
@@ -2090,6 +2091,17 @@ _gegl_buffer_get_unlocked (GeglBuffer *buffer,
gint interpolation = (flags & GEGL_BUFFER_FILTER_ALL);
gint factor = 1;
+ /* XXX: temporary, force nearest neighbor filter for blit saling of
+ CMYK based buffers
+ */
+ const Babl *bfmt = gegl_buffer_get_format (buffer);
+ const char *babl_name = babl_get_name (bfmt);
+ if (babl_name[0] == 'c' ||
+ babl_name[0] == 'C')
+ {
+ interpolation = GEGL_BUFFER_FILTER_NEAREST;
+ }
+
while (scale <= 0.5)
{
x1 = 0 < x1 ? x1 / 2 : (x1 - 1) / 2;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]