22 #ifndef LSST_GEOM_INTERVAL_H 23 #define LSST_GEOM_INTERVAL_H 91 template <
typename Iter>
94 for (
auto i = first; i != last; ++i) {
211 swap(_size, other._size);
212 swap(_min, other._min);
259 ndarray::View<boost::fusion::vector1<ndarray::index::Range> >
getSlice()
const;
262 bool isEmpty() const noexcept {
return _size == 0; }
374 template <
typename T>
375 static IntervalI _fromMinMaxChecked(T min, T max);
433 template <typename Iter>
436 for (
auto i = first; i != last; ++i) {
576 Element getCenter()
const noexcept;
static IntervalI fromMaxSize(Element max, Element size)
Construct an interval from its upper bound and size.
Element getBegin() const noexcept
IntervalD erodedBy(Element buffer) const
Decrease the size of the interval by the given amount in both directions (returning a new object)...
static IntervalD fromSpannedPoints(ndarray::Array< Element const, 1 > const &elements)
Construct an interval that contains all of the given points.
EdgeHandlingEnum
Enum used to indicate how to handle conversions from floating-point to integer intervals.
size_t operator()(argument_type const &x) const noexcept
Element getMax() const noexcept
~IntervalI() noexcept=default
bool isEmpty() const noexcept
Return true if the interval contains no points.
static IntervalI fromSpannedPoints(Iter first, Iter last)
Construct an interval that contains all of the given points.
IntervalI erodedBy(Element buffer) const
Decrease the size of the interval by the given amount in both directions (returning a new object)...
IntervalI clippedTo(IntervalI const &other) const noexcept
Shrink an interval to ensure that it is contained by other (returning a new)
bool overlaps(IntervalI const &other) const noexcept
Return true if there are any points in both this and other.
bool contains(Element point) const noexcept
Return true if the interval contains the point.
IntervalI expandedTo(Element other) const
Expand an interval to ensure that contains(other) is true (returning a new object).
ItemVariant const * other
Element getMin() const noexcept
IntervalI dilatedBy(Element buffer) const
Increase the size of the interval by the given amount in both directions (returning a new object)...
Element getMax() const noexcept
bool isDisjointFrom(IntervalI const &other) const noexcept
Return true if there are no points in both this and other.
IntervalI reflectedAbout(Element point) const
Reflect an interval about a point (returning a new object).
Include all pixels that overlap the floating-point interval at all.
Element getEnd() const noexcept
A floating-point coordinate rectangle geometry.
IntervalI shiftedBy(Element offset) const
Shift the position of the interval by the given offset (returning a new object).) ...
static IntervalI fromMinMax(Element min, Element max)
Construct an interval from its lower and upper bounds.
static IntervalI fromCenterSize(double center, Element size)
Create an interval centered as closely as possible on a particular point.
void swap(IntervalI &other) noexcept
A base class for image defects.
size_t operator()(argument_type const &x) const noexcept
bool operator==(IntervalI const &other) const noexcept
Compare two intervals for equality.
IntervalI & operator=(IntervalI const &) noexcept=default
Standard copy assignment operator.
bool isEmpty() const noexcept
Return true if the interval contains no points.
IntervalD expandedTo(Element other) const
Expand an interval to ensure that contains(other) is true.
Element getSize() const noexcept
Return slice to extract the interval's region from an ndarray::Array.
std::ostream & operator<<(std::ostream &os, lsst::geom::AffineTransform const &transform)
Element getMin() const noexcept
static IntervalI fromMinSize(Element min, Element size)
Construct an interval from its lower bound and size.
Include only pixels that are wholly contained by the floating-point interval.
bool isFinite() const noexcept
Return true if the interval's size is finite.
bool operator!=(IntervalI const &other) const noexcept
Compare two intervals for equality.
ndarray::View< boost::fusion::vector1< ndarray::index::Range > > getSlice() const
Return slice to extract the interval's region from an ndarray::Array.
A 1-d integer coordinate range.
static IntervalD fromSpannedPoints(std::vector< Element > const &elements)
Construct an interval that contains all of the given points.
void swap(IntervalD &other) noexcept
bool intersects(IntervalI const &other) const noexcept
Return slice to extract the interval's region from an ndarray::Array.
static IntervalI fromSpannedPoints(ndarray::Array< Element const, 1 > const &elements)
Construct an interval that contains all of the given points.
std::string toString() const
std::size_t hash_value() const noexcept
Return a hash of this object.
static IntervalI fromSpannedPoints(std::vector< Element > const &elements)
Construct an interval that contains all of the given points.
bool intersects(IntervalD const &other) const noexcept
Return true if any points in other are also in this.
IntervalI() noexcept
Construct an empty interval.