summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-26 08:53:53 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-26 08:54:01 +0100
commita63b75696de54b7342501e35230b373453ee6d81 (patch)
treeabae485ac155252acc3b7c4eae4041019e55555d
parentadd missing \n (diff)
downloadblueshift-a63b75696de54b7342501e35230b373453ee6d81.tar.gz
blueshift-a63b75696de54b7342501e35230b373453ee6d81.tar.bz2
blueshift-a63b75696de54b7342501e35230b373453ee6d81.tar.xz
m + add cie_temperature
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--TODO2
-rw-r--r--examples/textconf.conf2
-rw-r--r--info/blueshift.texinfo12
-rw-r--r--src/curve.py27
4 files changed, 36 insertions, 7 deletions
diff --git a/TODO b/TODO
index d4f5386..d90c10f 100644
--- a/TODO
+++ b/TODO
@@ -5,10 +5,10 @@ High priority:
Medium priority:
Add a section in manual for information on which order
to apply settings and how it affects the result.
+ Test and demo cie_temperature
Low priority:
Raw ramp applying functions with precalcuated interpolation, polynomial
- Add cie_temperature
Add support for proxies such as Tor in weather
Add support for temporarily closing DRM connection so that multiple users can run in DRM
diff --git a/examples/textconf.conf b/examples/textconf.conf
index 849272d..6205e86 100644
--- a/examples/textconf.conf
+++ b/examples/textconf.conf
@@ -83,7 +83,7 @@ points = solar 3 -6 ; (default)
; space. ‘cie’ (which is only supported where used in this example)
; performs the adjustments in CIE xyY colour space. ‘linear’ and ‘cie’
; can be combined but should not be combined as it has no proper meaning.
-; Additional, while possible, ‘linear’ should not be used with ‘linear’,
+; Additional, while possible, ‘linear’ should not be used with ‘icc’,
; as that too has no proper meaning.
; All of this adjustments can have multiple values, but in this example
diff --git a/info/blueshift.texinfo b/info/blueshift.texinfo
index e1bfad0..e76fbe1 100644
--- a/info/blueshift.texinfo
+++ b/info/blueshift.texinfo
@@ -682,8 +682,16 @@ Some of these algorithms (including @code{cmf_10deg})
are not very good by themself and should be wrapped
with @code{divide_by_maximum} or @code{clip_whitepoint}
((red, green, blue) @click{} (red, green, blue) functions.)
-For example, instead of using @code{cmf_10deg}, you
-can use @code{lambda t : divide_by_maximum(cmf_10deg(t))}.
+For example, instead of using @code{cmf_10deg}, you can use
+@code{lambda t : clip_whitepoint(divide_by_maximum(cmf_10deg(t)))}.
+
+@item rgb_temperature(temperature, algorithm)
+This function is a synonym for @code{temperature}.
+
+@item cie_temperature(temperature, algorithm)
+This works the same way as @code{temperature},
+except that subpixel brightness adjustment is
+done in CIE xyY colour space rather than sRGB.
@item lower_resolution(x, y)
Emulate low resolution. @code{x} is the number of
diff --git a/src/curve.py b/src/curve.py
index cca8a5a..4be11fc 100644
--- a/src/curve.py
+++ b/src/curve.py
@@ -53,15 +53,36 @@ def curves(r, g, b):
def temperature(temperature, algorithm):
'''
- Change colour temperature according to the CIE illuminant series D
+ Change colour temperature according to the CIE illuminant series D using CIE sRBG
+
+ @param temperature:float The blackbody temperature in kelvins
+ @param algorithm:(float)→(float, float, float) Algorithm for calculating a white point, for example `cmf_10deg`
+ '''
+ rgb_temperature(temperature, algorithm)
+
+
+def rgb_temperature(temperature, algorithm):
+ '''
+ Change colour temperature according to the CIE illuminant series D using CIE sRBG
+
+ @param temperature:float The blackbody temperature in kelvins
+ @param algorithm:(float)→(float, float, float) Algorithm for calculating a white point, for example `cmf_10deg`
+ '''
+ if temperature == 6500:
+ return
+ rgb_brightness(*(algorithm(temperature)))
+
+
+def cie_temperature(temperature, algorithm):
+ '''
+ Change colour temperature according to the CIE illuminant series D using CIE xyY
@param temperature:float The blackbody temperature in kelvins
@param algorithm:(float)→(float, float, float) Algorithm for calculating a white point, for example `cmf_10deg`
'''
if temperature == 6500:
return
- (r, g, b) = algorithm(temperature)
- rgb_brightness(r, g, b)
+ cie_brightness(*(algorithm(temperature)))
def rgb_contrast(r, g = ..., b = ...):