Commit Graph

12 Commits

Author SHA1 Message Date
Michael Natterer 4cfeb53d09 libgimpcolor: use gimp_color_profile_get_format() in GimpColorTransform
and use babl to convert between profiles if possible. With the default
BABL_TOLERANCE this is about 5 times faster than lcms on my test image.

Using babl can be disabled by setting GIMP_COLOR_TRANSFORM_DISABLE_BABL.
2017-09-02 20:32:50 +02:00
Michael Natterer c63d812be8 libgimpcolor: rename gimp_color_profile_get_format() to _get_lcms_format() 2017-09-02 18:47:04 +02:00
Michael Natterer f59a635604 libgimpcolor: use the new cmsFLAGS_COPY_ALPHA in GimpColorTransform
and remove all manual alpha copying.
2017-09-02 17:11:45 +02:00
Michael Natterer 60a50096fa libgimpcolor: some doc fixes and updates 2017-06-03 21:03:25 +02:00
Michael Natterer b4f34375b7 Bug 767062 - Lags when zooming or dragging zoomed image (cmsFLAGS_NOOPTIMIZE)
Use cmsFLAGS_NOOPTIMIZE only for actual image buffer or single color
transforms, but not for previews or the image display. Makes things a
lot more responsive again.
2016-06-05 16:50:02 +02:00
Michael Natterer 726552b085 libgimpcolor: return a NULL transform if cmsCreate[Proofing]Transform() fails
It doesn't really "fail", we check if an error was logged during
transform creation and get rid of the transform even if lcms returned
a pointer. This totally sucks but is better than crashing on a corrupt
transform.
2016-05-30 12:48:54 +02:00
Michael Natterer d8271ed33f libgimpcolor: return NULL GimpColorTransform if creating cmsHTRANSFORM fails 2016-05-30 10:58:48 +02:00
Michael Natterer 4bad9b2144 libgimpcolor: optimize gimp_color_transform_process_buffer()
for the case we're transforming the same buffer in place.
2016-05-29 20:24:37 +02:00
Michael Natterer 984e3d8f5a libgimpcolor: small optimization in gimp_color_transform_process_pixels()
no need to copy the alpha channel separately if src and dest are the
same.
2016-05-27 21:58:46 +02:00
Michael Natterer ca349f88cd libgimpcolor: add gimp_color_transform_can_gegl_copy()
Which takes two profiles and returns TRUE if converting between
them works correctly without a GimpColorTransform. Use it in
gimp_color_transform_new() to return a NULL transform if none
is needed. Took the code from gimp-gegl-loops.c.
2016-05-26 23:14:57 +02:00
Michael Natterer 0bfa402c1a Argh, this was meant to be squashed into the previous commit... 2016-05-26 22:18:50 +02:00
Michael Natterer cc92887908 libgimpcolor: add new object GimpColorTransform
which encapsulates a cmsHTRANSFORM and does all the pixel format
conversion magic. It has API to create transforms and proofing
transforms, and to convert pixels arrays and GeglBuffers.

Before, each place which has a transform had to keep around the
transform and its input and output Babl formats, and had to implement
lots of stuff itself. Now all that lives in GimpColorTransform,
removing lots of logic from many places, and pretty much removing lcms
from the public API entirely.

This removes including <lcms2.h>, LCMS_LIBS and LCMS_CFLAGS from
almost all directories and potentially allows to replace lcms by
something else.
2016-05-26 22:15:54 +02:00