You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I was surprised to see that arithmetic operations on pixel compiles but without explicit support from the library. pixels are actually implicitly converted to their underlying type.
Describe the solution you'd like
Provide a set of arithmetic operators, at least for pixel_gray32f_t and pixel_gray64f_t.
C++ Example
#include<type_traits>
#include<boost/gil/pixel.hpp>usingpixel_t = boost::gil::pixel<float, boost::gil::layout<boost::mp11::mp_list<boost::gil::gray_color_t> > >;
intmain()
{
pixel_ta(1.0f), b(2.0f);
auto c = a + b;
static_assert(std::is_same_v<std::decay_t<decltype(c)>, float>); //OK , but is implicit conversion right?static_assert(std::is_same_v<std::decay_t<decltype(c)>, pixel_t>); //Fails, but should be OK?return0;
}
Is your feature request related to a problem? Please describe.
I was surprised to see that arithmetic operations on
pixel
compiles but without explicit support from the library.pixel
s are actually implicitly converted to their underlying type.Describe the solution you'd like
Provide a set of arithmetic operators, at least for
pixel_gray32f_t
andpixel_gray64f_t
.C++ Example
Additional context
Discussed first on Slack
The text was updated successfully, but these errors were encountered: