lsst.afw
19.0.0-23-g9b026a6e0
|
Go to the documentation of this file.
27 #ifndef LSST_AFW_GEOM_SPANSETFUNCTORGETTERS_H
28 #define LSST_AFW_GEOM_SPANSETFUNCTORGETTERS_H
30 #include <type_traits>
54 template <
typename T,
typename... Args>
62 x.checkExtents(box, area);
65 template <
typename T,
typename... Args>
76 template <
typename T,
typename... Args>
126 template <
typename T>
148 T
get()
const {
return _const; }
154 template <
typename T,
int N,
int C>
158 using Reference =
typename ndarray::Array<T, N, C>::Reference::Reference;
161 : _array(array), _xy0(xy0) {}
175 "SpanSet bounding box lands outside array");
180 auto _iterY = _array.begin() + (span.
getY() - _xy0.getY());
181 _iterX = (*_iterY).begin() + (span.
getMinX() - _xy0.getX());
189 ndarray::Array<T, N, C> _array;
191 typename ndarray::Array<T, N, C>::Reference::Iterator _iterX;
194 template <
typename T,
int inA,
int inC>
198 using Reference =
typename ndarray::Array<T, inA, inC>::Reference;
200 explicit FlatNdGetter(ndarray::Array<T, inA, inC>
const& array) : _array(array), _iter(_array.begin()) {}
211 auto shape = _array.getShape();
212 if (area >
static_cast<int>(shape[0])) {
214 "SpanSet has dimensionality greater than array");
225 ndarray::Array<T, inA, inC> _array;
226 typename ndarray::Array<T, inA, inC>::Iterator _iter;
238 template <
typename T,
int inA,
int inC>
244 template <
typename T,
int inA,
int inB>
250 template <
typename T>
256 template <
typename T>
262 template <
typename T>
268 template <
typename T>
274 template <
typename T>
285 template <
typename T,
typename =
void>
288 template <
typename T>
290 !std::is_same<typename std::iterator_traits<T>::value_type, void>::value>
::type>
293 template <
typename T>
308 template <
typename T,
int inA,
int inB>
332 template <
typename T,
int inA,
int inB>
340 #endif // LSST_AFW_GEOM_SPANSETFUNCTORGETTERS_H
details::ImageNdGetter< T, inA, inB > ndImage(ndarray::Array< T, inA, inB > const &array, lsst::geom::Point2I xy0=lsst::geom::Point2I())
Marks a ndarray to be interpreted as an image when applying a functor from a SpanSet.
ImageNdGetter(ndarray::Array< T, N, C > const &array, lsst::geom::Point2I const &xy0)
void checkExtents(lsst::geom::Box2I const &bbox, int area) const
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
ImageNdGetter & operator=(ImageNdGetter &&)=default
A range of pixels within one row of an Image.
FlatNdGetter(FlatNdGetter &&)=default
std::iterator_traits< T >::reference get() const
Represent a 2-dimensional array of bitmask pixels.
void checkExtents(lsst::geom::Box2I const &bbox, int area) const
ImageNdGetter & operator=(ImageNdGetter const &)=default
typename ndarray::Array< T, inA, inC >::Reference Reference
ConstantGetter(T constant)
FlatNdGetter & operator=(FlatNdGetter &&)=default
void setSpan(Span const &span)
void setSpan(Span const &span)
ConstantGetter(ConstantGetter const &)=default
~ConstantGetter()=default
IterGetter(IterGetter &&)=default
FlatNdGetter & operator=(FlatNdGetter const &)=default
int getY() const noexcept
Return the y-value.
void setSpan(Span const &span)
details::FlatNdGetter< T, inA, inB > ndFlat(ndarray::Array< T, inA, inB > const &array)
Marks a ndarray to be interpreted as a 1D vector when applying a functor from a SpanSet.
typename std::iterator_traits< T >::value_type type
bool contains(Point2I const &point) const noexcept
ConstantGetter(ConstantGetter &&)=default
FlatNdGetter(ndarray::Array< T, inA, inC > const &array)
int getMinX() const noexcept
Minimum x-value.
FlatNdGetter(FlatNdGetter const &)=default
FlatNdGetter< T, inA, inC > makeGetter(FlatNdGetter< T, inA, inC > &getter)
void checkExtents(lsst::geom::Box2I const &bbox, int area) const
void checkExtents(lsst::geom::Box2I const &bbox, int area) const
A base class for image defects.
#define LSST_EXCEPT(type,...)
ConstantGetter & operator=(ConstantGetter &&)=default
IterGetter & operator=(IterGetter &&)=default
void variadicIncrementPosition(T &x)
void variadicBoundChecker(lsst::geom::Box2I const box, int area, T const &x)
IterGetter(IterGetter const &)=default
ConstantGetter & operator=(ConstantGetter const &)=default
A class to represent a 2-dimensional array of pixels.
typename ndarray::Array< T, N, C >::Reference::Reference Reference
ImageNdGetter(ImageNdGetter const &)=default
ImageNdGetter(ImageNdGetter &&)=default
IterGetter & operator=(IterGetter const &)=default
void setSpan(Span const &span)
void variadicSpanSetter(Span const spn, T &x)