Boost logo

Boost Users :

Subject: Re: [Boost-users] GIL: New file io, almost there, but can't compile 'write_view'
From: Dan Bloomquist (boost_at_[hidden])
Date: 2018-12-08 19:18:57


Mateusz Loskot via Boost-users wrote:
>
> At glance, the docs look fine.
>
>> With either:
>> bg::write_view( path_to, destImg, bg::jpeg_tag() );
>> or:
>> bg::image_write_info<bg::jpeg_tag> write_setttings;
>> bg::write_view( path_to, destImg, write_setttings );
>>
>> ms140 complains:
>> 1>c:\cpp\boost_1_68_0\boost\gil\extension\toolbox\metafunctions\get_pixel_type.hpp(33): error C2039: 'reference': is not a member of 'boost::gil::image<boost::gil::rgb8_pixel_t,false,std::allocator<unsigned char>>'
>> 1> c:\cpp\boost_1_68_0\boost\gil\typedefs.hpp(176): note: see declaration of 'boost::gil::image<boost::gil::rgb8_pixel_t,false,std::allocator<unsigned char>>'
>> 1> c:\cpp\he_14\resize_jpeg\console_test.cpp(341): note: see reference to class template instantiation 'boost::gil::get_pixel_type<boost::gil::rgb8_image_t>' being compiled
>>
> I suspect, you are missing some headers.

Hi Mateusz,
Thanks. So your example worked. I had a lot of headers so started there.
I finally commented just about every thing I had and still had the
issue. Even with VS2017.

I should have started by just looking at your example write to file line
for a subtle difference.. Here is what it was...

 Â Â Â      bg::write_view( path_to, const_view( destImg), bg::jpeg_tag() );

 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  ^^^^^^^^ need to use
const_view!
> p.s. FYI, if you prefer, there is also
> https://lists.boost.org/mailman/listinfo.cgi/boost-gil

More thanks. And I cross posted in case the likes of this comes up again.
Best, Dan.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net