|
![](/i/fill.gif) |
Hello!
I'm currently implementing color space conversion for my shader patch.
It includes conversion between rgb, xyz, xyY, hsv, hsl and yiq spaces.
It seemed to be good idea to put this conversion function to color.c
file (err, coloUr.c). Now I'm wondering, whether it is good idea to
make those conversion functions available from POV-Ray as well? Is there
any use for them? One thing, that comes to my mind, is post-processing:
with conversion from rgb to hsl (or hsv) it would be easy to add or
reduce saturation, or change hue.
If this is good idea, then how should it be implemented? As functions?
Which form would be preferable:
rgb2hsv(COLOUR) or
COLOUR rgb2hsv(COLOUR)?
First modifies parameter given color, second returns converted color.
I think that in order to limit number of functions, "orthogonal"
approach should be used, i.e. conversion functions only from/to rgb
should be implemented (this is how my conversion currently works).
P.S. I know that there are macros for conversion between rgb and hsv
(and/or hsl), but as this conversion code will be there for shader
patch, then it would be good idea to reuse it.
Post a reply to this message
|
![](/i/fill.gif) |