summaryrefslogtreecommitdiffstats
path: root/debian/lcms/lcms-1.19.dfsg2/python/testbed/createmsh.py
blob: b4e15cb8eee92ffd6a855e8e02cb2369e7b7a8c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#
# Sample: Creates and saves a matrix-shaper profile
#

from lcms import *

Rec709Primaries = cmsCIExyYTRIPLE(cmsCIExyY(0.6400, 0.3300, 1.0),
                                  cmsCIExyY(0.3000, 0.6000, 1.0),
                                  cmsCIExyY(0.1500, 0.0600, 1.0))


Gamma22 = GAMMATABLE(2.2, 4096)
D65 = cmsCIExyY()
cmsWhitePointFromTemp(6504, D65)

hVirtual_sRGB = cmsCreateRGBProfile(D65,
                             Rec709Primaries,
                            (Gamma22, Gamma22, Gamma22));



#
# This should probably be bettered somehow...
#

icSigProfileDescriptionTag  = icTagSignature(0x64657363)
text = StrPointer("Sample sRGB profile")


cmsAddTag(hVirtual_sRGB, icSigProfileDescriptionTag, text)


cmsSaveProfile(hVirtual_sRGB, "Virtual_sRGB.icm")

cmsCloseProfile(hVirtual_sRGB)