Boost logo

Boost :

Subject: Re: [Boost-users] GIL: New file io, almost there, but can't compile 'write_view'
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2018-12-08 20:04:55


On Sat, 8 Dec 2018 at 20:19, Dan Bloomquist via Boost-users
<boost-users_at_[hidden]> wrote:
> Mateusz Loskot via Boost-users wrote:
> >>
> >> 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!

Dan,

Hmm, it should compile with gil::view as well.
I have just checked the resize.cpp modified with VS2017

    bg::rgb8_image_t square100x100(100, 100);
    bg::resize_view(bg::view(img), bg::view(square100x100),
bg::bilinear_sampler{});
    bg::write_view("out-resize.jpg", bg::view(square100x100), bg::jpeg_tag{});

It compiles.

If you still encoutner the problem, I suggest you to open a new issue
at https://github.com/boostorg/gil
and include minimal example to reproduce the problem

Best regards,

-- 
Mateusz Loskot, http://mateusz.loskot.net

Boost list run by Boost-Gil-Owners