[gil] added hsl color space to gil

Hi guys, I have added the HSL color space as an extension to gil. The code is structured similar to other color spaces, like rgb. You can get the code at http://gil-contributions.googlecode.com/svn/trunk/gil_2/boost/gil/extension/... To construct a hsl view from a rgb image use the gil way: color_converted_view<hsl32f_pixel_t>( rgb_view, hsl_view ); The other way around would be: color_converted_view<rgb8_pixel_t>( hsl_view, rgb_view ); So far, there is only hsl32f_xxx_t possible. But I think that's OK for a start. Please let me know what you think. Next will be the HSV color space. Christian

Christian, I looked at your code and it looks great. Thanks! (though I haven't verified the formulas). 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. Lubomir
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost- bounces@lists.boost.org] On Behalf Of Christian Henning Sent: Monday, April 30, 2007 6:04 AM To: boost@lists.boost.org Subject: [boost] [gil] added hsl color space to gil
Hi guys, I have added the HSL color space as an extension to gil. The code is structured similar to other color spaces, like rgb. You can get the code at
contributions.googlecode.com/svn/trunk/gil_2/boost/gil/extension/toolbo
x/hsl.hpp
To construct a hsl view from a rgb image use the gil way:
color_converted_view<hsl32f_pixel_t>( rgb_view, hsl_view );
The other way around would be:
color_converted_view<rgb8_pixel_t>( hsl_view, rgb_view );
So far, there is only hsl32f_xxx_t possible. But I think that's OK for a start.
Please let me know what you think. Next will be the HSV color space.
Christian _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

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

I have had the same problem on (internal) code and I use hsv::hue (the 'hue' class is an inner class). John -----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Christian Henning Sent: Monday, April 30, 2007 7:45 PM To: boost@lists.boost.org Subject: Re: [boost] [gil] added hsl color space to gil 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 _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (3)
-
Christian Henning
-
John Femiani
-
Lubomir Bourdev