Boost logo

Boost Users :

From: Stefan Seiffarth (StefanSeiffarth_at_[hidden])
Date: 2008-08-30 13:32:44


Hello,
I'm a bit confused about the source code snippet at
http://www.boost.org/doc/libs/1_36_0/libs/gil/doc/html/gildesignguide.html#ImageViewsExampleDG
and especially, since I can't find any way to get that snippet compiled:
step3=color_converted_view<rgb8_view_t,gray8_pixel_t>(step2);

1.) What's the proper return type of color_converted_view in this example?
2.) Is the snippet above correct at all?, the template is defined as:
00181 template <typename DstP, typename View>
00182 inline typename color_converted_view_type<View,DstP>::type
00183 color_converted_view(const View& src) {
00184 return color_converted_view<DstP>(src,default_color_converter());
00185 }

in http://www.boost.org/doc/libs/1_36_0/libs/gil/doc/html/g_i_l_0221.html

So shouldn't it be color_converted_view<gray8_pixel_t,rgb8_view_t>?, with
pixel type first and view type second
Which leads me to the next question why is the type order swapped for the
return value type definition?

The following snippet:

 rgb8_image_t img;
 jpeg_read_image("bild.jpg", img);
 jpeg_write_view("bild_transform.jpg",
color_converted_view<gray8_pixel_t,rgb8_view_t>(view(img)));

atleast outputs a properly grayscaled image, the original line from the
example obviously throws an error during compilation,
but I still like to know what the proper return type of color_converted_view
is.

Thanks for any help,
Stefan


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net