Commits

Robert Kern  committed bf97dca

Add convenience property on profiles for getting the double-based format for its colorspace.

  • Participants
  • Parent commits 569b7ab

Comments (0)

Files changed (1)

                 nchannels = _cmsChannelsOf(space)
                 return ('?',) * nchannels
 
+
+    property double_format:
+        def __get__(self):
+            cdef icColorSpaceSignature space
+
+            space = cmsGetColorSpace(self.profile_ptr)
+            if space == icSigXYZData:
+                return formats.xyz
+            elif space == icSigLabData:
+                return formats.lab
+            elif space == icSigRgbData:
+                return formats.rgb
+            elif space == icSigGrayData:
+                return formats.gray
+            elif space == icSigCmykData:
+                return formats.cmyk
+            else:
+                return None
+
+
     def __new__(self, *args, **kwds):
         self.profile_ptr = NULL