8 #ifndef BOOST_GIL_IO_SCANLINE_READ_ITERATOR_HPP 9 #define BOOST_GIL_IO_SCANLINE_READ_ITERATOR_HPP 11 #include <boost/gil/io/error.hpp> 12 #include <boost/gil/io/typedefs.hpp> 14 #include <boost/iterator/iterator_facade.hpp> 20 namespace boost {
namespace gil {
22 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) 24 #pragma warning(disable:4512) //assignment operator could not be generated 28 template<
typename Reader >
31 , std::input_iterator_tag
36 using base_t = boost::iterator_facade
40 std::input_iterator_tag
50 , _read_scanline(
true )
51 , _skip_scanline(
true )
54 _buffer = std::make_shared< buffer_t >( buffer_t( _reader._scanline_length ));
55 _buffer_start = &_buffer->front();
59 friend class boost::iterator_core_access;
63 if( _skip_scanline ==
true )
65 _reader.skip( _buffer_start
72 _skip_scanline =
true;
73 _read_scanline =
true;
78 return _pos == rhs._pos;
81 typename base_t::reference dereference()
const 83 if( _read_scanline ==
true )
85 _reader.read( _buffer_start
90 _skip_scanline =
false;
91 _read_scanline =
false;
101 mutable bool _read_scanline;
102 mutable bool _skip_scanline;
104 using buffer_t = std::vector<byte_t>;
105 using buffer_ptr_t = std::shared_ptr<buffer_t>;
107 buffer_ptr_t _buffer;
108 mutable byte_t* _buffer_start;
111 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) Input iterator to read images.
Definition: scanline_read_iterator.hpp:29
BOOST_FORCEINLINE bool equal(boost::gil::iterator_from_2d< Loc1 > first, boost::gil::iterator_from_2d< Loc1 > last, boost::gil::iterator_from_2d< Loc2 > first2)
std::equal(I1,I1,I2) with I1 and I2 being a iterator_from_2d
Definition: algorithm.hpp:1029