Boost logo

Boost :

Subject: Re: [boost] [GIL] color_convert
From: fabien.castan_at_[hidden]
Date: 2010-08-05 04:20:43


> I cannot recreate your problem. Here is a little test app that works
> fine on my machine ( VC10 )

The problem is that I define a generic conversion like that:

/// \ingroup ColorConvert
/// \brief Converting HSL to any pixel type. Note: Supports homogeneous pixels only.
/// Done by an intermediate RGB conversion
template <typename C2>
struct default_color_converter_impl<hsl_t,C2>
    template <typename P1, typename P2>
    void operator()(const P1& src, P2& dst) const
        typedef hsl_t C1;
        typedef typename channel_type<P1>::type T1;
        typedef typename channel_type<P2>::type T2;
        pixel<T2,rgb_layout_t> tmp;
        default_color_converter_impl<C1,rgb_t>()(src, tmp);
        default_color_converter_impl<rgb_t,C2>()(tmp, dst);

So it's in conflict with:
template <typename C1> struct default_color_converter_impl<C1, rgba_t>,
if I use color_convert( hslPixel, rgbaPixel ).

The goal of creating this generic conversion is that I can still make the conversion using an intermediate rgb colorspace if there is no specialization.
I think we can have a good solution, if we apply this method to all colorspaces:

 * define a generic conversion to another colorspace using an intermediate rgb colorspace conversion,
only in one direction MyColorspace -> typename C2 (so without typename C1 -> MyColorspace).
That's why I would like to remove typename C1 -> rgba_t implementation.
 * redefine the conversion for colorspaces we want to make a direct conversion

Boost list run by bdawes at, gregod at, cpdaniel at, john at