LSSTApplications
19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
30 #ifndef LSST_AFW_IMAGE_IMAGEBASE_H
31 #define LSST_AFW_IMAGE_IMAGEBASE_H
52 struct ImageWriteOptions;
65 template <
typename ImageT>
77 operator bool()
const {
return _check; }
84 template <
typename PixelT>
86 typedef typename boost::gil::channel_traits<PixelT>::reference
type;
89 template <
typename PixelT>
91 typedef typename boost::gil::channel_traits<PixelT>::const_reference
type;
101 template <
typename PixelT>
104 typedef typename lsst::afw::image::detail::types_traits<PixelT>::view_t _view_t;
105 typedef typename lsst::afw::image::detail::types_traits<PixelT>::const_view_t _const_view_t;
107 typedef ndarray::Manager Manager;
149 typedef typename ndarray::Array<PixelT, 2, 1>
Array;
151 typedef typename ndarray::Array<PixelT const, 2, 1>
ConstArray;
153 template <
typename OtherPixelT>
157 template <
typename SinglePixelT>
167 template <
typename,
typename,
typename>
209 const bool deep =
false);
216 template <
typename OtherPixelT>
220 "Only deep copies are permitted for ImageBases with different pixel types");
224 copy_and_convert_pixels(rhs._gilView, tmp._gilView);
304 int getX0()
const {
return _origin.getX(); }
312 int getY0()
const {
return _origin.getY(); }
333 int const roundedIndex =
static_cast<int>(fullIndex + 0.5);
334 double const residual = fullIndex - roundedIndex;
452 Manager::Ptr _manager;
461 const _view_t& view);
468 template <
typename PixelT>
469 void swap(ImageBase<PixelT>&
a, ImageBase<PixelT>&
b);
473 template <
typename PixelT>
475 int rowStride =
reinterpret_cast<PixelT*
>(row_begin(1)) -
reinterpret_cast<PixelT*
>(row_begin(0));
476 return ndarray::external(
reinterpret_cast<PixelT*
>(row_begin(0)),
477 ndarray::makeVector(getHeight(), getWidth()), ndarray::makeVector(rowStride, 1),
481 template <
typename PixelT>
483 int rowStride =
reinterpret_cast<PixelT*
>(row_begin(1)) -
reinterpret_cast<PixelT*
>(row_begin(0));
484 return ndarray::external(
reinterpret_cast<PixelT*
>(row_begin(0)),
485 ndarray::makeVector(getHeight(), getWidth()), ndarray::makeVector(rowStride, 1),
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
y_iterator col_begin(int x) const
Return an y_iterator to the start of the y'th row.
static _view_t _allocateView(lsst::geom::Extent2I const &dimensions, Manager::Ptr &manager)
A container for an Image and its associated metadata.
ndarray::Array< PixelT, 2, 1 > Array
A mutable ndarray representation of the image.
void assign(ImageBase const &rhs, lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT)
Copy pixels from another image to a specified subregion of this image.
reverse_iterator rbegin() const
Return an STL compliant reverse iterator to the start of the image.
ndarray::Array< PixelT const, 2, 1 > ConstArray
An immutable ndarray representation of the image.
ImageBase(const ImageBase< OtherPixelT > &rhs, const bool deep)
generalised copy constructor
bool isContiguous() const
_view_t::y_iterator xy_y_iterator
An iterator for traversing the pixels in a row, created from an xy_locator.
const double PixelZeroPos
position of center of pixel 0
_const_view_t::reverse_iterator const_reverse_iterator
An STL compliant const reverse iterator.
y_iterator y_at(int x, int y) const
Return an y_iterator to the point (x, y) in the image.
reverse_iterator rend() const
Return an STL compliant reverse iterator to the end of the image.
iterator at(int x, int y) const
Return an STL compliant iterator at the point (x, y)
iterator end() const
Return an STL compliant iterator to the end of the image.
x_iterator row_begin(int y) const
Return an x_iterator to the start of the y'th row.
_view_t::reverse_iterator reverse_iterator
An STL compliant reverse iterator.
_const_view_t::iterator const_iterator
An STL compliant const iterator.
_view_t _getRawView() const
double indexToPosition(double ind, lsst::afw::image::xOrY const xy) const
Convert image index to image position.
_view_t::y_iterator y_iterator
An iterator for traversing the pixels in a column.
ConstArray getArray() const
_view_t::xy_locator xy_locator
An xy_locator.
std::pair< int, double > positionToIndex(double const pos, lsst::afw::image::xOrY const xy) const
Convert image position to index (nearest integer and fractional parts)
ImageBase & operator=(const ImageBase &rhs)
Shallow assignment operator.
virtual ~ImageBase()=default
PixelConstReference operator[](lsst::geom::Point2I const &index) const
Return a reference to a single pixel in PARENT coordinates (with no bounds check).
int getHeight() const
Return the number of rows in the image.
ImageT::image_category image_category
PixelReference operator()(int x, int y)
Return a reference to the pixel (x, y) in LOCAL coordinates.
std::shared_ptr< RecordT > src
x_iterator x_at(int x, int y) const
Return an x_iterator to the point (x, y) in the image.
metafunction to extract const reference type from PixelT
metafunction to extract reference type from PixelT
PixelReference operator[](lsst::geom::Point2I const &index)
Return a reference to a single pixel in PARENT coordinates (with no bounds check).
A class to manipulate images, masks, and variance as a single object.
iterator begin() const
Return an STL compliant iterator to the start of the image.
Reference< PixelT >::type PixelReference
A Reference to a PixelT.
xy_locator xy_at(int x, int y) const
Return an xy_locator at the point (x, y) in the image.
x_iterator row_end(int y) const
Return an x_iterator to the end of the y'th row.
static _view_t _makeSubView(lsst::geom::Extent2I const &dimensions, lsst::geom::Extent2I const &offset, const _view_t &view)
_const_view_t::y_iterator const_y_iterator
A const iterator for traversing the pixels in a column.
afw::table::PointKey< int > dimensions
A class used to request that array accesses be checked.
_view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
A base class for image defects.
std::string const wcsNameForXY0
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
int getX0() const
Return the image's column-origin.
PixelT SinglePixel
A single Pixel of the same type as those in the ImageBase.
lsst::geom::Extent2I getDimensions() const
Return the image's size; useful for passing to constructors.
x_iterator fast_iterator
A fast STL compliant iterator for contiguous images N.b.
Reports invalid arguments.
_view_t::x_iterator xy_x_iterator
An iterator for traversing the pixels in a row, created from an xy_locator.
Extent< int, 2 > Extent2I
_view_t::iterator iterator
An STL compliant iterator.
An integer coordinate rectangle.
void setXY0(int const x0, int const y0)
Set the ImageBase's origin.
lsst::geom::Point2I getXY0() const
Return the image's origin.
void swap(Image< PixelT > &a, Image< PixelT > &b)
void setXY0(lsst::geom::Point2I const origin)
Set the ImageBase's origin.
int getY0() const
Return the image's row-origin.
boost::gil::channel_traits< PixelT >::reference type
reference type
CheckIndices(bool check=true)
PixelT Pixel
A pixel in this ImageBase.
lsst::geom::Box2I getBBox(ImageOrigin origin=PARENT) const
_const_view_t::x_iterator const_x_iterator
A const iterator for traversing the pixels in a row.
y_iterator col_end(int x) const
Return an y_iterator to the start of the y'th row.
traits class for image categories
void swap(ImageBase &rhs)
ConstReference< PixelT >::type PixelConstReference
A ConstReference to a PixelT.
The base class for all image classed (Image, Mask, MaskedImage, ...)
detail::basic_tag image_category
trait class to identify type of image
PixelReference get(lsst::geom::Point2I const &index, ImageOrigin origin)
Return a reference to a single pixel (with no bounds check).
int getWidth() const
Return the number of columns in the image.
static SinglePixel PixelCast(SinglePixelT rhs)
Convert a type to our SinglePixel type.
boost::gil::channel_traits< PixelT >::const_reference type
const reference type
_view_t::xy_locator::const_t const_xy_locator
A const_xy_locator.