libgimpcolor: gimp_color_profile_get_format: support premultiplied formats

This commit is contained in:
Michael Natterer 2016-06-08 00:00:36 +02:00
parent 3e01419b0c
commit 06aa05e422
1 changed files with 18 additions and 11 deletions

View File

@ -1513,29 +1513,36 @@ gimp_color_profile_get_format (const Babl *format,
return babl_format ("R'G'B'A u8"); return babl_format ("R'G'B'A u8");
} }
else if (model == babl_model ("RGB") || else if (model == babl_model ("RGB") ||
model == babl_model ("RGBA")) model == babl_model ("RGBA") ||
model == babl_model ("RaGaBaA"))
{ {
rgb = TRUE; rgb = TRUE;
linear = TRUE; linear = TRUE;
} }
else if (model == babl_model ("R'G'B'") || else if (model == babl_model ("R'G'B'") ||
model == babl_model ("R'G'B'A")) model == babl_model ("R'G'B'A") ||
model == babl_model ("R'aG'aB'aA"))
{ {
rgb = TRUE; rgb = TRUE;
} }
else if (model == babl_model ("Y") || else if (model == babl_model ("Y") ||
model == babl_model ("YA")) model == babl_model ("YA") ||
model == babl_model ("YaA"))
{ {
gray = TRUE; gray = TRUE;
linear = TRUE; linear = TRUE;
} }
else if (model == babl_model ("Y'") || else if (model == babl_model ("Y'") ||
model == babl_model ("Y'A")) model == babl_model ("Y'A") ||
model == babl_model ("Y'aA"))
{ {
gray = TRUE; gray = TRUE;
} }
else if (model == babl_model ("CMYK") || else if (model == babl_model ("CMYK"))
model == babl_model ("CMYKA")) #if 0
/* FIXME missing from babl */
|| model == babl_model ("CMYKA"))
#endif
{ {
cmyk = TRUE; cmyk = TRUE;
} }
@ -1687,7 +1694,7 @@ gimp_color_profile_get_format (const Babl *format,
if (*lcms_format == 0) if (*lcms_format == 0)
{ {
g_printerr ("%s: layer format %s not supported, " g_printerr ("%s: format %s not supported, "
"falling back to float\n", "falling back to float\n",
G_STRFUNC, babl_get_name (format)); G_STRFUNC, babl_get_name (format));