[babl/wip/icc-cluts: 1/5] babl: add rendering intent argument to icc loading API



commit bab5adc95e4d5929a02500cf151b461a3061fe77
Author: Øyvind Kolås <pippin gimp org>
Date:   Fri Sep 8 21:26:04 2017 +0200

    babl: add rendering intent argument to icc loading API

 babl/babl-icc.c          |    1 +
 babl/babl.h              |    9 +++++++++
 tools/babl-icc-rewrite.c |    2 +-
 3 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/babl/babl-icc.c b/babl/babl-icc.c
index 7d79051..48dec13 100644
--- a/babl/babl-icc.c
+++ b/babl/babl-icc.c
@@ -671,6 +671,7 @@ static char *decode_string (ICC *state, const char *tag, const char *lang, const
 const Babl *
 babl_space_from_icc (const char   *icc_data,
                      int           icc_length,
+                     BablIccIntent intent,
                      const char  **error)
 {
   ICC  *state = icc_state_new ((char*)icc_data, icc_length, 0);
diff --git a/babl/babl.h b/babl/babl.h
index 80f342b..c6a3ace 100644
--- a/babl/babl.h
+++ b/babl/babl.h
@@ -90,6 +90,13 @@ const Babl * babl_model     (const char *name);
  */
 const Babl * babl_space (const char *name);
 
+typedef enum {
+  BABL_ICC_INTENT_PERCEPTUAL,
+  BABL_ICC_INTENT_RELATIVE_COLORIMETRIC,
+  BABL_ICC_INTENT_ABSOLUTE_COLORIMETRIC,
+  BABL_ICC_INTENT_SATURATION
+} BablIccIntent;
+
 /**
  * babl_space_from_icc:
  *
@@ -113,6 +120,7 @@ const Babl * babl_space (const char *name);
  */
 const Babl *babl_space_from_icc (const char       *icc_data,
                                  int               icc_length,
+                                 BablIccIntent     intent,
                                  const char      **error);
 
 /* babl_icc_get_key:
@@ -128,6 +136,7 @@ const Babl *babl_space_from_icc (const char       *icc_data,
  * "copyright", "manufacturer", "device", "profile-class", "color-space" and
  * "pcs".
  */
+
 char *babl_icc_get_key (const char *icc_data,
                         int         icc_length,
                         const char *key,
diff --git a/tools/babl-icc-rewrite.c b/tools/babl-icc-rewrite.c
index 0746d50..f30b20e 100644
--- a/tools/babl-icc-rewrite.c
+++ b/tools/babl-icc-rewrite.c
@@ -79,7 +79,7 @@ main (int    argc,
       free (str);
     }
   }
-  babl = babl_space_from_icc (icc_data, icc_len, &error);
+  babl = babl_space_from_icc (icc_data, icc_len, 0, &error);
   free (icc_data);
   if (error || !babl)
   {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]