I have been experimenting with Boost.GIL, and I have run into something
that I'm not sure if it's a problem on my end or with Boost.GIL. In
essence, I'm trying to make a grayscale image with channels limited to
14 bits. I am using scoped_channel_value to do this. The problem
happens when I try to convert the 14 bit image to a 16 bit grayscale
image I get compilation errors. I am including the code I am using
below:
//START CODE
#include
#include <cstdint>
using namespace std;
using namespace boost::gil;
namespace detail
{
struct bits14_min { static std::uint16_t apply() { return 0;} };
struct bits14_max
{ static std::uint16_t apply() { return 0x3FF;} };
}
typedef scoped_channel_value
bits14_t;
typedef pixel Pixel1;
typedef image<Pixel1> Frame1;
int main()
{
Frame1 image(
Frame1::point_t(100, 100),
Frame1::value_type((1 << 14)-1),
0);
gray16_image_t image2(image.dimensions());
Frame1::view_t view1(view(image));
gray16_image_t::view_t view2(view(image2));
copy_and_convert_pixels(view1, view2);
return 0;
}
//END CODE
The interesting thing is that the program compiles if change
typedef scoped_channel_value
bits14_t;
to
typedef scoped_channel_value
bits14_t;
I think the relevant error in the log is this:
/usr/include/boost/gil/channel_algorithm.hpp:54:8: error:
‘struct boost::gil::scoped_channel_value’ is not a
valid type for a template non-type parameter
struct unsigned_integral_max_value : public
mpl::integral_c {};
I am attaching the full compile log to this email. Thank you for any
help with this matter!
Sincerely,
Gabriel E. Marcano