Hi Olivier,
Great, thank you! What about my first solution?
Yes. I think it's the right way. Here is what I have which uses
transform_pixels.
#include
#include
namespace boost { namespace gil {
typedef double bits64F;
GIL_DEFINE_BASE_TYPEDEFS(64F,gray)
typedef float bits32F;
GIL_DEFINE_BASE_TYPEDEFS(32F,gray)
} }
using namespace boost;
using namespace gil;
template< typename DST, typename SRC1, typename SRC2 >
DST generate_diff( const SRC1& src1, const SRC2& src2 )
{
return pixel_minus_t()(src1, src1);
}
int main(int argc, char** argv)
{
gray16s_image_t mns( 10, 10 );
gray32F_image_t mnt( 10, 10 ), mne( 10, 10 );
fill_pixels( view( mns ), gray16s_image_t::value_type( 12 ));
fill_pixels( view( mnt ), gray32F_image_t::value_type( 5 ));
fill_pixels( view( mne ), gray32F_image_t::value_type( 0 ));
auto fun = generate_diff< gray16s_image_t::value_type
, gray32F_image_t::value_type
, gray32F_image_t::value_type
>;
transform_pixels( view(mne), view(mns), view(mnt), fun );
return 0;
}
Next I'll try dynamic_image.
Regards,
Christian