In order to build an histogram from an image view, I need to retrieve channels' base value type. Unfortunately it does not work for channels that use scoped_channel_value as value_type.
For the moment, I have added : typedef BaseChannelValue base_type; in scoped_channel_value's declaration. Yet, it's not a viable solution, especially if other people use my program.
Is there another way to retrieve the BaseChannelValue from a scoped_channel_value ?
Best regards,
Hugo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
In order to build an histogram from an image view, I need to retrieve channels' base value type. Unfortunately it does not work for channels that use scoped_channel_value as value_type.
For the moment, I have added : typedef BaseChannelValue base_type; in scoped_channel_value's declaration. Yet, it's not a viable solution, especially if other people use my program.
Is there another way to retrieve the BaseChannelValue from a scoped_channel_value ?
Best regards,
Hugo
Hugo,
You can always do something non-intrusive like your own metafunction:
template <typename Channel>
struct base_channel_value {
typedef typename channel_traits<Channel>::value_type type;
};
template <typename BaseChannelValue, typename MinVal, typename MaxVal>
struct scoped_channel_value {
typedef BaseChannelValue type;
};
Lubomir
Sorry I meant the second one to be specialization:
template <typename BaseChannelValue, typename MinV, typename MaxV>
struct base_channel_value<scoped_channel_value<BaseChannelValue,MinV,MaxV> > {
typedef BaseChannelValue type;
};