25#ifndef LSST_AFW_GEOM_SpanPixelIterator_h_INCLUDED
26#define LSST_AFW_GEOM_SpanPixelIterator_h_INCLUDED
28#include "boost/iterator/iterator_facade.hpp"
42class SpanPixelIterator :
public boost::iterator_facade<SpanPixelIterator, lsst::geom::Point2I const,
43 boost::random_access_traversal_tag> {
56 lsst::geom::
Point2I const& dereference()
const {
return _p; }
58 void increment() { ++_p.getX(); }
60 void decrement() { --_p.getX(); }
62 void advance(
int n) { _p.getX() += n; }
64 bool equal(SpanPixelIterator
const& other)
const {
65 return _p.getX() == other._p.getX() && _p.getY() == other._p.getY();
68 int distance_to(SpanPixelIterator
const& other)
const {
69 assert(other._p.getY() == _p.getY());
70 return other._p.getX() - _p.getX();
An iterator that yields lsst::geom::Point2I and increases in the x direction.
SpanPixelIterator(SpanPixelIterator &&) noexcept=default
SpanPixelIterator(lsst::geom::Point2I const &p=lsst::geom::Point2I()) noexcept
SpanPixelIterator(SpanPixelIterator const &) noexcept=default
friend class boost::iterator_core_access