[gil] raw image resizing problem
Hi there, I'm trying to resize an image that comes as a raw RGB8 interleaved buffer into another buffer. According to the resize.cpp sample that comes with boost that should work like this: #include <boost/gil/image.hpp> #include <boost/gil/image_view_factory.hpp> #include <boost/gil/typedefs.hpp> #include <boost/gil/extension/numeric/sampler.hpp> #include <boost/gil/extension/numeric/resample.hpp> using namespace boost::gil; rgb8_view_t view = interleaved_view(orig_width, orig_height, reinterpret_cast<rgb8_ptr_t>(original_buffer), orig_width * 3); rgb8_image_t scaled(new_width, new_height); resize_view(view, view(scaled), bilinear_sampler()); I'm getting an compile error in the resize_image line though and don't know what to make of it: : error C2664: 'boost::gil::pixel<ChannelValue,Layout> &boost::gil::image_view<Loc>::operator ()(const boost::gil::point2<T> &) const' : cannot convert parameter 1 from 'boost::gil::rgb8_image_t' to 'const boost::gil::point2<T> &' 1> with 1> [ 1> ChannelValue=boost::gil::bits8, 1> Layout=boost::gil::rgb_layout_t, 1> Loc=boost::gil::rgb8_loc_t, 1> T=ptrdiff_t 1> ] 1> and 1> [ 1> T=ptrdiff_t 1> ] 1> Reason: cannot convert from 'boost::gil::rgb8_image_t' to 'const boost::gil::point2<T>' 1> with 1> [ 1> T=ptrdiff_t 1> ] 1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called Any ideas? Thanks... Stephan
Hi Stephan, please rename your interleaved view from "view" to something else. That worked for me. Regards, Christian On Mon, May 4, 2009 at 8:58 AM, Stephan Menzel <stephan.menzel@gmx.eu> wrote:
Hi there,
I'm trying to resize an image that comes as a raw RGB8 interleaved buffer into another buffer.
According to the resize.cpp sample that comes with boost that should work like this:
#include <boost/gil/image.hpp> #include <boost/gil/image_view_factory.hpp> #include <boost/gil/typedefs.hpp> #include <boost/gil/extension/numeric/sampler.hpp> #include <boost/gil/extension/numeric/resample.hpp>
using namespace boost::gil;
rgb8_view_t view = interleaved_view(orig_width, orig_height, reinterpret_cast<rgb8_ptr_t>(original_buffer), orig_width * 3); rgb8_image_t scaled(new_width, new_height); resize_view(view, view(scaled), bilinear_sampler());
I'm getting an compile error in the resize_image line though and don't know what to make of it:
: error C2664: 'boost::gil::pixel<ChannelValue,Layout> &boost::gil::image_view<Loc>::operator ()(const boost::gil::point2<T> &) const' : cannot convert parameter 1 from 'boost::gil::rgb8_image_t' to 'const boost::gil::point2<T> &' 1> with 1> [ 1> ChannelValue=boost::gil::bits8, 1> Layout=boost::gil::rgb_layout_t, 1> Loc=boost::gil::rgb8_loc_t, 1> T=ptrdiff_t 1> ] 1> and 1> [ 1> T=ptrdiff_t 1> ] 1> Reason: cannot convert from 'boost::gil::rgb8_image_t' to 'const boost::gil::point2<T>' 1> with 1> [ 1> T=ptrdiff_t 1> ] 1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Any ideas?
Thanks...
Stephan _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Am Montag, 4. Mai 2009 16:26:28 schrieb Christian Henning:
Hi Stephan, please rename your interleaved view from "view" to something else. That worked for me.
And so it does for me. Thanks. Even though I tookthis from the examples, I remember. that resize example throws the same error for me on both win and g++. Weird. Cheers, Stephan
participants (2)
-
Christian Henning
-
Stephan Menzel