All,
Several months ago I submitted a patch to prevent warnings when
performing certain channel conversions [1]. After some discussion
with Christian a part of the patch was removed in favor of using the
unsigned_integral_max_value metafunction. After tweaking my
specializations of that metafunction my code compiled fine.
Recently I modified my code to use GIL more extensively. I'm pleased
with the reduced code footprint (a 5000 line file was reduced to ~150
lines), but unfortunately there are more warnings due to unsafe
conversions with my now-more-extensive testing.
Attached is a file which adds a base_channel_type metafunction which
correctly determines the type which the channel constructor is
expecting. I believe this is more correct than using
unsigned_integral_max_value as the value_type of *max_value is not the
same as the channel type for, e.g., 8-bit unsigned channels.
Something like this metafunction has also been requested recently [2].
The following demonstrates its use for the built-in channel type
models I'm aware of:
///////////BEGIN CODE////////////////////
#include