[gegl] exr-load: set up babl space from chromaticities
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] exr-load: set up babl space from chromaticities
- Date: Mon, 9 Jul 2018 15:58:29 +0000 (UTC)
commit 25c0c9c4a1f78782e357865e50e1792782727434
Author: Øyvind Kolås <pippin gimp org>
Date: Mon Jul 9 16:51:03 2018 +0200
exr-load: set up babl space from chromaticities
operations/external/exr-load.cpp | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/operations/external/exr-load.cpp b/operations/external/exr-load.cpp
index e4c98f757..fb0487d4e 100644
--- a/operations/external/exr-load.cpp
+++ b/operations/external/exr-load.cpp
@@ -37,6 +37,7 @@ extern "C" {
#include <ImfChannelList.h>
#include <ImfRgbaFile.h>
#include <ImfRgbaYca.h>
+#include <ImfChromaticities.h>
#include <ImfStandardAttributes.h>
#include <stdio.h>
@@ -538,6 +539,7 @@ query_exr (const gchar *path,
{
gchar format_string[16];
gint format_flags = 0;
+ const Babl *space = NULL;
try
{
@@ -550,6 +552,13 @@ query_exr (const gchar *path,
*width = dw.max.x - dw.min.x + 1;
*height = dw.max.y - dw.min.y + 1;
+ if (hasChromaticities(file.header()))
+ {
+ const Chromaticities &c2 = chromaticities (file.header());
+ space = babl_chromaticities_make_space
+ (NULL, c2.white[0], c2.white[1], c2.red[0], c2.red[1], c2.green[0], c2.green[1], c2.blue[0], c2.blue[1],
babl_trc ("linear"), babl_trc ("linear"), babl_trc ("linear"), 1);
+ }
+
if (ch.findChannel ("R") || ch.findChannel ("G") || ch.findChannel ("B"))
{
strcpy (format_string, "RGB");
@@ -604,6 +613,8 @@ query_exr (const gchar *path,
strcat (format_string, " float");
break;
}
+
+
}
catch (...)
{
@@ -612,7 +623,7 @@ query_exr (const gchar *path,
}
*ff_ptr = format_flags;
- *format = (void*)babl_format (format_string);
+ *format = (void*)babl_format_with_space (format_string, space);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]