This is used for the gimp_color_is_perceptually_identical() function, because the Euclidean distance in LCH is extremely limited, if not wrong in many cases. Indeed LCH is not perfectly perceptually uniform, and for this exact reason, the CIE defined the specific Delta E algorithms. Later versions are also based on LCH values, so my intuition to use it for distance was on a good start, yet these algorithms were refined a few times to allow for corrections in perceptual uniformity imperfections. This was in particular needed to verify if a color is out of a CMYK space gamut. The idea is to compare the distance of the RGB (or other) and the CMYK version, since we cannot just check if the CMYK color is out of the [0; 1] range (it never is). Instead if both colors are perceptually identical, then we consider that the RGB color was inside the CMYK space gamut. The naive algorithm was giving any (or nearly) color as out-of-gamut. Now using CIEDE2000, I get a much nicer results.
79 lines
1.6 KiB
Meson
79 lines
1.6 KiB
Meson
|
|
libgimpcolor_sources = files(
|
|
'gimpadaptivesupersample.c',
|
|
'gimpbilinear.c',
|
|
'gimpcairo.c',
|
|
'gimpcmyk.c',
|
|
'gimpcolor.c',
|
|
'gimpcolor-parse.c',
|
|
'gimpcolormanaged.c',
|
|
'gimpcolorprofile.c',
|
|
'gimpcolorspace.c',
|
|
'gimpcolortransform.c',
|
|
'gimphsl.c',
|
|
'gimphsv.c',
|
|
'gimppixbuf.c',
|
|
'gimprgb-parse.c',
|
|
'gimprgb.c',
|
|
)
|
|
|
|
libgimpcolor_headers_introspectable = files(
|
|
'gimpcolortypes.h',
|
|
'gimpadaptivesupersample.h',
|
|
'gimpbilinear.h',
|
|
'gimpcairo.h',
|
|
'gimpcmyk.h',
|
|
'gimpcolormanaged.h',
|
|
'gimpcolorprofile.h',
|
|
'gimpcolorspace.h',
|
|
'gimpcolortransform.h',
|
|
'gimphsl.h',
|
|
'gimphsv.h',
|
|
'gimppixbuf.h',
|
|
'gimprgb.h',
|
|
|
|
'gimpcolor.h',
|
|
)
|
|
|
|
libgimpcolor_headers = [
|
|
libgimpcolor_headers_introspectable,
|
|
]
|
|
|
|
libgimpcolor_introspectable = [
|
|
libgimpcolor_sources,
|
|
libgimpcolor_headers_introspectable,
|
|
]
|
|
|
|
|
|
libgimpcolor = library('gimpcolor-' + gimp_api_version,
|
|
libgimpcolor_sources,
|
|
include_directories: rootInclude,
|
|
dependencies: [
|
|
cairo, gdk_pixbuf, gegl, lcms, math,
|
|
],
|
|
c_args: [ '-DG_LOG_DOMAIN="LibGimpColor"', '-DGIMP_COLOR_COMPILATION', ],
|
|
link_with: [ libgimpbase, ],
|
|
vs_module_defs: 'gimpcolor.def',
|
|
install: true,
|
|
version: so_version,
|
|
)
|
|
|
|
install_headers(
|
|
libgimpcolor_headers,
|
|
subdir: gimp_api_name / 'libgimpcolor',
|
|
)
|
|
|
|
|
|
# Test program, not installed
|
|
executable('test-color-parser',
|
|
'test-color-parser.c',
|
|
include_directories: rootInclude,
|
|
dependencies: [
|
|
cairo, gdk_pixbuf, gegl, lcms, math,
|
|
babl,
|
|
# glib,
|
|
],
|
|
c_args: '-DG_LOG_DOMAIN="LibGimpColor"',
|
|
link_with: [ libgimpbase, libgimpcolor, ],
|
|
install: false,
|
|
)
|