summaryrefslogtreecommitdiffstats
path: root/debian/lcms/lcms-1.19.dfsg2/python/testbed/sRGB2adobe.py
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-09-11 14:38:47 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-09-11 14:38:47 +0900
commit884c8093d63402a1ad0b502244b791e3c6782be3 (patch)
treea600d4ab0d431a2bdfe4c15b70df43c14fbd8dd0 /debian/lcms/lcms-1.19.dfsg2/python/testbed/sRGB2adobe.py
parent14e1aa2006796f147f3f4811fb908a6b01e79253 (diff)
downloadextra-dependencies-884c8093d63402a1ad0b502244b791e3c6782be3.tar.gz
extra-dependencies-884c8093d63402a1ad0b502244b791e3c6782be3.zip
Added debian extra dependency packages.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/lcms/lcms-1.19.dfsg2/python/testbed/sRGB2adobe.py')
-rwxr-xr-xdebian/lcms/lcms-1.19.dfsg2/python/testbed/sRGB2adobe.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/debian/lcms/lcms-1.19.dfsg2/python/testbed/sRGB2adobe.py b/debian/lcms/lcms-1.19.dfsg2/python/testbed/sRGB2adobe.py
new file mode 100755
index 00000000..06c22f10
--- /dev/null
+++ b/debian/lcms/lcms-1.19.dfsg2/python/testbed/sRGB2adobe.py
@@ -0,0 +1,51 @@
+
+#
+# Sample: Convert from sRGB to AdobeRGB, perceptual intent
+#
+
+from lcms import *
+
+
+print "Enter sRGB values"
+
+#
+# Create placeholders
+#
+
+RGB = COLORB()
+
+RGB[0] = input("R?")
+RGB[1] = input("G?")
+RGB[2] = input("B?")
+
+
+#
+# Open profiles
+#
+
+hsRGB = cmsCreate_sRGBProfile()
+hAdobe = cmsOpenProfileFromFile("AdobeRGB1998.icc", "r")
+
+#
+# The transform
+#
+
+xform = cmsCreateTransform(hsRGB, TYPE_RGB_8, hAdobe, TYPE_RGB_8, INTENT_PERCEPTUAL, cmsFLAGS_NOTPRECALC)
+
+cmsDoTransform(xform, RGB, RGB, 1)
+
+#
+# Print results
+#
+
+print "AdobeRGB = ", RGB[0], RGB[1], RGB[2]
+
+
+#
+# Free all stuff
+#
+
+cmsDeleteTransform(xform)
+cmsCloseProfile(hAdobe)
+cmsCloseProfile(hsRGB)
+