[gegl] gegl: improve GEGL_BABL_VARIANT_ALPHA
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] gegl: improve GEGL_BABL_VARIANT_ALPHA
- Date: Tue, 4 Dec 2018 16:22:58 +0000 (UTC)
commit a0ddc68432d241b6abcce789e01d9b1ce7f22cc4
Author: Øyvind Kolås <pippin gimp org>
Date: Tue Dec 4 17:18:36 2018 +0100
gegl: improve GEGL_BABL_VARIANT_ALPHA
gegl/gegl-utils.c | 36 ++++++++++++++++++++++++++++--------
1 file changed, 28 insertions(+), 8 deletions(-)
---
diff --git a/gegl/gegl-utils.c b/gegl/gegl-utils.c
index a2ea3e8b2..1fcad4ac9 100644
--- a/gegl/gegl-utils.c
+++ b/gegl/gegl-utils.c
@@ -344,7 +344,8 @@ static const Babl *gegl_babl_format_float (const Babl *format)
static const Babl *gegl_babl_format_alpha (const Babl *format)
{
const Babl *model = babl_format_get_model (format);
- if (babl_get_model_flags (model) & BABL_MODEL_FLAG_ALPHA)
+ BablModelFlag model_flags = babl_get_model_flags (model);
+ if (model_flags & BABL_MODEL_FLAG_ALPHA)
{
const Babl *type = babl_format_get_type (format, 0);
if (type == babl_type ("float"))
@@ -359,23 +360,42 @@ static const Babl *gegl_babl_format_alpha (const Babl *format)
{
return babl_format_with_space ("YA float", format);
}
- else if (babl_model_is (model, "RGB"))
+ else if (babl_model_is (model, "RGB")||
+ babl_model_is (model, "RGBA"))
{
return babl_format_with_space ("RGBA float", format);
}
- else if (babl_model_is (model, "R'G'B'"))
+ else if (babl_model_is (model, "RaGaBaA"))
+ {
+ return babl_format_with_space ("RaGaBaA float", format);
+ }
+ else if (babl_model_is (model, "R'aG'aB'aA"))
+ {
+ return babl_format_with_space ("R'aG'aB'aA float", format);
+ }
+ else if (babl_model_is (model, "R'G'B'")||
+ babl_model_is (model, "R'G'B'A"))
{
return babl_format_with_space ("R'G'B'A float", format);
}
else if (babl_model_is (model, "cmyk") ||
- babl_model_is (model, "CMYK") ||
- babl_model_is (model, "CMYKA") ||
- babl_model_is (model, "cmykA") ||
- babl_model_is (model, "CaMaYaKaA") ||
- babl_model_is (model, "camayakaA"))
+ babl_model_is (model, "cmykA"))
{
return babl_format_with_space ("cmykA float", format);
}
+ else if (babl_model_is (model, "CMYK") ||
+ babl_model_is (model, "CMYKA"))
+ {
+ return babl_format_with_space ("cmykA float", format);
+ }
+ else if (babl_model_is (model, "CaMaYaKaA"))
+ {
+ return babl_format_with_space ("CaMaYaKaA float", format);
+ }
+ else if (babl_model_is (model, "camayakaA"))
+ {
+ return babl_format_with_space ("camayakaA float", format);
+ }
return babl_format_with_space ("RGBA float", format);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]