|
Boost : |
From: Christian Henning (chhenning_at_[hidden])
Date: 2007-04-30 22:45:23
Hi Lubomir, just added hsv color space. If you want to check the
formulars just use the hsl.cpp test code. It generates some color
plates that show the formulars seems working.
> One suggestion: It is trivial to make it work for any HSB channel (not
> just bits32f).
> Simply channel_convert from the source to your intermediate format
> (bits32f) and then channel_convert the result back to the destination.
> For improved performance, in the future we can add specializations for
> concrete channel types that could use shortcut formulas, but for now
> converting to/from float should be fine.
I was sticking to bits32f for now since I don't know how to handle the
hue value correctly. I would like to add some algorithms where the hue
value is represented in degrees, you know like 60 ( can't find the
small circle on my keyboard ;-) ). So, such a value doesn't quite fit
in 0...255 but in 0...359. Any ideas are welcome.
I actually stumpled on an "interesting" problem with defining the
channel names. Both the hsl and the hsv spaces share the same hue_t
and saturation_t structs. Please review my solution and write me what
you think.
The more I work with the more I like it. I learn quite a bit I can tell you. ;-)
Christian
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk