summaryrefslogtreecommitdiffstats
path: root/debian/lcms/lcms-1.19.dfsg2/python/testbed/gamma.py
blob: 1a1e7247698e7aa717210ff12af26a2bfd75391a (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#
# Sample: Gamma tables
#

from lcms import *


#
# Allocate a gamma table
#

Gamma22 = GAMMATABLE(2.2)

print Gamma22

#
# Specify num. of sampled points
#

Gamma22 = GAMMATABLE(2.2, 1024)

print Gamma22

#
# Reverse a gamma table
#

Gamma28 = GAMMATABLE(2.8, 1024)
Rev28   = cmsReverseGamma(1024, Gamma28)
print Rev28

#
# Joint a Gamma 2.8 with inverse of 2.4
#

Joined = cmsJoinGamma(Gamma28, Gamma22)
print Joined

#
# Same, specifying num. of points
#

Joined = cmsJoinGammaEx(Gamma28, Gamma22, 2048)
print Joined

#
#  "Smooth" a curve. Second parameter is smothness lambda
#
cmsSmoothGamma(Joined, 0.8)
print Joined


#
# This should result on a line
#
Straight = cmsJoinGammaEx(Joined, Joined, 2048)
print Straight