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)
28 template <
typename Reader>
30 :
public boost::iterator_facade<scanline_read_iterator<Reader>, byte_t*, std::input_iterator_tag>
33 using base_t = boost::iterator_facade
37 std::input_iterator_tag
41 : reader_(reader), pos_(pos)
43 buffer_ = std::make_shared<buffer_t>(buffer_t(reader_._scanline_length));
44 buffer_start_ = &buffer_->front();
48 friend class boost::iterator_core_access;
54 reader_.skip(buffer_start_, pos_);
59 skip_scanline_ =
true;
60 read_scanline_ =
true;
65 return pos_ == rhs.pos_;
68 typename base_t::reference dereference()
const
72 reader_.read(buffer_start_, pos_);
74 skip_scanline_ =
false;
75 read_scanline_ =
false;
84 mutable bool read_scanline_ =
true;
85 mutable bool skip_scanline_ =
true;
87 using buffer_t = std::vector<byte_t>;
88 using buffer_ptr_t = std::shared_ptr<buffer_t>;
90 mutable byte_t* buffer_start_ =
nullptr;
93 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
Input iterator to read images.
Definition: scanline_read_iterator.hpp:31
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:1087
defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
Definition: algorithm.hpp:36