Boost logo

Boost :

Subject: [boost] [GIL] scoped_channel_value type
From: fabien.castan_at_[hidden]
Date: 2010-07-22 10:05:50


Hi,

I would like to get the value type of the channels depending on an image view.
So I can get the scoped channel type, from MyView type, like this:
typedef typename boost::gil::channel_type<MyView>::type MyScopedChannel;

But I can't get the primitive type used by the scoped channel.

For example, if the type is scoped_channel_value<float,float_zero,float_one>, I can't get the float type.

/// \ingroup ScopedChannelValue
/// \brief A channel adaptor that modifies the range of the source channel. Models: ChannelValueConcept
template <typename BaseChannelValue, // base channel (models ChannelValueConcept)
          typename MinVal, typename MaxVal> // classes with a static apply() function returning the minimum/maximum channel values
struct scoped_channel_value {
    typedef BaseChannelValue base_channel_t; //< missing typedef
    //...
}

So this will allows to use:
typedef typename boost::gil::channel_type<MyView>::type::base_channel_t ChannelBaseType;

Are you agree to add this typedef ?

Best regards,
Fabien Castan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk