24 #ifndef LSST_AFW_GEOM_Span_h_INCLUDED 25 #define LSST_AFW_GEOM_Span_h_INCLUDED 30 #include "boost/serialization/nvp.hpp" 37 namespace serialization {
62 : _y(y), _x0(x0), _x1(x1) {}
65 Span() : _y(0), _x0(0), _x1(-1) {}
69 Span& operator=(
Span const&) =
default;
79 int getX0()
const {
return _x0; }
81 int getX1()
const {
return _x1; }
83 int getY()
const {
return _y; }
97 bool contains(
int x)
const {
return (x >= _x0) && (x <= _x1); }
98 bool contains(
int x,
int y)
const {
return (x >= _x0) && (x <= _x1) && (y == _y); }
117 return other.
getY() == getY() && other.
getMinX() == getMinX() && other.
getMaxX() == getMaxX();
125 bool operator<(
const Span&
b)
const;
130 friend class boost::serialization::access;
131 template <
typename Archive>
132 void serialize(Archive& ar,
const unsigned int version) {
133 ar& boost::serialization::make_nvp(
"y", _y) & boost::serialization::make_nvp(
"x0", _x0) &
134 boost::serialization::make_nvp(
"x1", _x1);
145 #endif // LSST_AFW_GEOM_Span_h_INCLUDED An iterator that yields lsst::geom::Point2I and increases in the x direction.
int getEndX() const
End (exclusive) x-value.
bool isEmpty() const
Return true if the span contains no pixels.
friend std::ostream & operator<<(std::ostream &os, Span const &span)
Stream output; delegates to toString().
Iterator end() const
Return an iterator to one past the last pixel in the Span.
A range of pixels within one row of an Image.
ItemVariant const * other
lsst::geom::Point2I const getMin() const
Point corresponding to minimum x.
int & getX1()
Return the ending x-value.
int getWidth() const
Return the number of pixels.
int getX0() const
Return the starting x-value.
int & getY()
Return the y-value.
A base class for image defects.
void shift(int dx, int dy)
bool contains(lsst::geom::Point2I const &point) const
bool operator!=(Span const &other) const
bool contains(int x, int y) const
lsst::geom::Point2I const getMax() const
Point corresponding to maximum x.
int & getX0()
Return the starting x-value.
bool operator==(Span const &other) const
int getMaxX() const
Maximum x-value.
int getX1() const
Return the ending x-value.
lsst::afw::detection::Footprint Footprint
int getY() const
Return the y-value.
bool contains(int x) const
Span()
Construct an empty Span with zero width at the origin.
int getBeginX() const
Begin (inclusive) x-value.
SpanPixelIterator Iterator
An iterator over points in the Span.
std::string toString() const
Return a string-representation of a Span.
int getMinX() const
Minimum x-value.
Span(int y, int x0, int x1)
Iterator begin() const
Return an iterator to the first pixel in the Span.