libgimpcolor: support "CIE Lab (alpha)" in gimp_color_profile_get_format()

Return "RGB(A) float", babl will do the needed conversions.
This commit is contained in:
Michael Natterer 2017-02-24 12:50:57 +01:00
parent dc74ac9470
commit 0edecc8d56
1 changed files with 17 additions and 1 deletions

View File

@ -1472,7 +1472,7 @@ gimp_color_profile_new_d50_gray_lab_trc (void)
* R'G'B'A, Y, YA, Y', Y'A and the cairo-RGB24 and cairo-ARGB32 formats.
*
* Return value: the #Babl format to be used instead of @format, or %NULL
* is the passed @format is not supported at all.
* if the passed @format is not supported at all.
*
* Since: 2.10
**/
@ -1546,6 +1546,22 @@ gimp_color_profile_get_format (const Babl *format,
{
cmyk = TRUE;
}
else if (model == babl_model ("CIE Lab") ||
model == babl_model ("CIE Lab alpha"))
{
if (has_alpha)
{
*lcms_format = TYPE_RGBA_FLT;
return babl_format ("RGBA float");
}
else
{
*lcms_format = TYPE_RGB_FLT;
return babl_format ("RGB float");
}
}
else if (babl_format_is_palette (format))
{
if (has_alpha)