24 #ifndef LSST_AFW_GEOM_Span_h_INCLUDED 25 #define LSST_AFW_GEOM_Span_h_INCLUDED 55 : _y(y), _x0(x0), _x1(x1) {}
58 Span() noexcept : _y(0), _x0(0), _x1(-1) {}
60 Span(
Span const&) noexcept =
default;
62 Span& operator=(
Span const&) noexcept =
default;
63 Span& operator=(
Span&&) noexcept =
default;
64 ~
Span() noexcept =
default;
72 int getX0() const noexcept {
return _x0; }
73 int&
getX0() noexcept {
return _x0; }
74 int getX1() const noexcept {
return _x1; }
75 int&
getX1() noexcept {
return _x1; }
76 int getY() const noexcept {
return _y; }
77 int&
getY() noexcept {
return _y; }
78 int getWidth() const noexcept {
return _x1 - _x0 + 1; }
79 int getMinX() const noexcept {
return _x0; }
80 int getMaxX() const noexcept {
return _x1; }
82 int getEndX() const noexcept {
return _x1 + 1; }
90 bool contains(
int x)
const noexcept {
return (
x >= _x0) && (
x <= _x1); }
91 bool contains(
int x,
int y)
const noexcept {
return (
x >= _x0) && (
x <= _x1) && (
y == _y); }
93 return contains(point.getX(), point.getY());
97 bool isEmpty() const noexcept {
return _x1 < _x0; }
102 void shift(
int dx,
int dy) noexcept {
112 return other.getY() == getY() &&
other.getMinX() == getMinX() &&
other.getMaxX() == getMaxX();
126 bool operator<(
const Span&
b)
const noexcept;
148 #endif // LSST_AFW_GEOM_Span_h_INCLUDED int getBeginX() const noexcept
Begin (inclusive) x-value.
lsst::geom::Point2I const getMin() const noexcept
Point corresponding to minimum x.
An iterator that yields lsst::geom::Point2I and increases in the x direction.
bool contains(VertexIterator const begin, VertexIterator const end, UnitVector3d const &v)
Iterator end() const noexcept
Return an iterator to one past the last pixel in the Span.
friend std::ostream & operator<<(std::ostream &os, Span const &span)
Stream output; delegates to toString().
A range of pixels within one row of an Image.
int getMaxX() const noexcept
Maximum x-value.
Span() noexcept
Construct an empty Span with zero width at the origin.
int & getX1() noexcept
Return the ending x-value.
lsst::geom::Point2I const getMax() const noexcept
Point corresponding to maximum x.
bool contains(int x) const noexcept
bool contains(lsst::geom::Point2I const &point) const noexcept
int & getX0() noexcept
Return the starting x-value.
FastFinder::Iterator Iterator
int & getY() noexcept
Return the y-value.
A base class for image defects.
int getWidth() const noexcept
Return the number of pixels.
Iterator begin() const noexcept
Return an iterator to the first pixel in the Span.
int getEndX() const noexcept
End (exclusive) x-value.
void shift(int dx, int dy) noexcept
int getMinX() const noexcept
Minimum x-value.
std::size_t hash_value() const noexcept
Return a hash of this object.
bool operator!=(Span const &other) const noexcept
lsst::afw::detection::Footprint Footprint
bool isEmpty() const noexcept
Return true if the span contains no pixels.
bool contains(int x, int y) const noexcept
int getX1() const noexcept
Return the ending x-value.
ItemVariant const * other
int getY() const noexcept
Return the y-value.
result_type operator()(argument_type const &obj) const noexcept
SpanPixelIterator Iterator
An iterator over points in the Span.
std::size_t hashCombine(std::size_t seed) noexcept
Combine hashes.
std::string toString() const
Return a string-representation of a Span.
bool operator==(Span const &other) const noexcept
Span(int y, int x0, int x1)
int getX0() const noexcept
Return the starting x-value.