30 #ifndef LSST_IMAGE_MASKEDIMAGE_H
31 #define LSST_IMAGE_MASKEDIMAGE_H
38 #include "boost/shared_ptr.hpp"
39 #include "boost/mpl/at.hpp"
40 #include "boost/iterator/zip_iterator.hpp"
68 namespace formatters {
69 template<
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
class MaskedImageFormatter;
87 typedef boost::shared_ptr<MaskedImage>
Ptr;
88 typedef boost::shared_ptr<const MaskedImage>
ConstPtr;
99 template<
typename ImagePT=ImagePixelT,
typename MaskPT=MaskPixelT,
typename VarPT=VariancePixelT>
115 template<
typename,
typename,
typename>
class const_MaskedImageLocator;
127 template<
typename ImageIterator,
typename MaskIterator,
typename VarianceIterator,
135 typedef typename boost::zip_iterator<IMV_iterator_tuple>::reference
IMV_tuple;
144 _iter(boost::make_zip_iterator(boost::make_tuple(img, msk, var))) {
147 typename Ref<ImagePixelT>::type
image() {
148 return _iter->template get<0>()[0];
152 typename Ref<MaskPixelT>::type
mask() {
153 return _iter->template get<1>()[0];
158 return _iter->template get<2>()[0];
164 return _iter.get_iterator_tuple();
187 return &this->
_iter->template get<0>() - &rhs.
_iter->template get<0>();
191 return &this->
_iter->template get<0>() == &rhs.
_iter->template get<0>();
195 return &this->
_iter->template get<0>() != &rhs.
_iter->template get<0>();
199 return &this->
_iter->template get<0>() < &rhs.
_iter->template get<0>();
204 _iter->template get<1>()[0],
205 _iter->template get<2>()[0]);
218 typename boost::zip_iterator<IMV_iterator_tuple>
_iter;
222 template<
typename ImageIterator,
typename MaskIterator,
typename VarianceIterator>
240 template<
typename ImageIterator,
typename MaskIterator,
typename VarianceIterator>
241 class const_MaskedImageIterator :
242 public MaskedImageIteratorBase<typename detail::const_iterator_type<ImageIterator>::type,
243 typename detail::const_iterator_type<MaskIterator>::type,
244 typename detail::const_iterator_type<VarianceIterator>::type,
272 template<
typename ImageLocator,
typename MaskLocator,
typename VarianceLocator,
275 typedef typename boost::tuple<ImageLocator, MaskLocator, VarianceLocator>
IMVLocator;
281 template<
template<
typename>
class X_OR_Y >
288 X_OR_Y<ImageLocator>(
_mil->
_loc.template get<0>())() += di;
289 X_OR_Y<MaskLocator>(
_mil->
_loc.template get<1>())() += di;
290 X_OR_Y<VarianceLocator>(
_mil->
_loc.template get<2>())() += di;
295 ++X_OR_Y<ImageLocator>(
_mil->
_loc.template get<0>())();
296 ++X_OR_Y<MaskLocator>(
_mil->
_loc.template get<1>())();
297 ++X_OR_Y<VarianceLocator>(
_mil->
_loc.template get<2>())();
302 X_OR_Y<ImageLocator>(
_mil->
_loc.template get<0>())() ==
303 X_OR_Y<ImageLocator>(rhs.
_mil->
_loc.template get<0>())();
308 X_OR_Y<ImageLocator>(
_mil->
_loc.template get<0>())() !=
309 X_OR_Y<ImageLocator>(rhs.
_mil->
_loc.template get<0>())();
314 X_OR_Y<ImageLocator>(
_mil->
_loc.template get<0>())() <
315 X_OR_Y<ImageLocator>(rhs.
_mil->
_loc.template get<0>())();
320 return Pixel((*(X_OR_Y<ImageLocator>(
_mil->
_loc.template get<0>())()))[0],
321 (*(X_OR_Y<MaskLocator>(
_mil->
_loc.template get<1>())()))[0],
322 (*(X_OR_Y<VarianceLocator>(
_mil->
_loc.template get<2>())()))[0]);
325 typename Ref<ImagePixelT>::type
image() {
328 return (*(X_OR_Y<ImageLocator>(
_mil->
_loc.template get<0>())()))[0];
330 typename Ref<MaskPixelT>::type
mask() {
331 return (*(X_OR_Y<MaskLocator>(
_mil->
_loc.template get<1>())()))[0];
334 return (*(X_OR_Y<VarianceLocator>(
_mil->
_loc.template get<2>())()))[0];
341 template<
typename LocT>
343 typedef typename LocT::x_iterator
IterT;
351 template<
typename LocT>
353 typedef typename LocT::y_iterator
IterT;
364 typedef typename boost::tuple<
typename ImageLocator::cached_location_t,
365 typename MaskLocator::cached_location_t,
389 _loc(img, msk, var) {
395 return Pixel(
_loc.template get<0>().x()[0][0],
396 _loc.template get<1>().
x()[0][0],
397 _loc.template get<2>().
x()[0][0]);
402 return Pixel(
_loc.template get<0>()(x, y)[0],
403 _loc.template get<1>()(x, y)[0],
404 _loc.template get<2>()(x, y)[0]);
409 return Pixel(
_loc.template get<0>()[cached_loc._imv.template get<0>()][0],
410 _loc.template get<1>()[cached_loc._imv.template get<1>()][0],
411 _loc.template get<2>()[cached_loc._imv.template get<2>()][0]);
429 return cached_location_t(
_loc, x, y);
436 typedef typename boost::mpl::vector<ImagePixelT, MaskPixelT, VariancePixelT>
PixelTVec;
439 typename Ref<typename boost::mpl::at<PixelTVec, N>::type>::type
apply_IMV(cached_location_t
const& cached_loc) {
440 return _loc.template get<N::value>()[cached_loc._imv.template get<N::value>()][0];
444 typename Ref<typename boost::mpl::at<PixelTVec, N>::type>::type
apply_IMV() {
445 return _loc.template get<N::value>()[0][0];
449 typename Ref<typename boost::mpl::at<PixelTVec, N>::type>::type
apply_IMV(
int x,
int y) {
450 return _loc.template get<N::value>()(x, y)[0];
456 typename Ref<ImagePixelT>::type
image(cached_location_t
const& cached_loc) {
457 return apply_IMV<boost::mpl::int_<0> >(cached_loc);
460 typename Ref<ImagePixelT>::type
image() {
461 return apply_IMV<boost::mpl::int_<0> >();
464 typename Ref<ImagePixelT>::type
image(
int x,
int y) {
465 return apply_IMV<boost::mpl::int_<0> >(
x,
y);
469 typename Ref<MaskPixelT>::type
mask(cached_location_t
const& cached_loc) {
470 return apply_IMV<boost::mpl::int_<1> >(cached_loc);
473 typename Ref<MaskPixelT>::type
mask() {
474 return apply_IMV<boost::mpl::int_<1> >();
477 typename Ref<MaskPixelT>::type
mask(
int x,
int y) {
478 return apply_IMV<boost::mpl::int_<1> >(
x,
y);
482 typename Ref<VariancePixelT>::type
variance(cached_location_t
const& cached_loc) {
483 return apply_IMV<boost::mpl::int_<2> >(cached_loc);
487 return apply_IMV<boost::mpl::int_<2> >();
491 return apply_IMV<boost::mpl::int_<2> >(
x,
y);
496 return _loc.template get<0>() == rhs.
_loc.template get<0>();
500 return !(*
this == rhs);
504 return _loc.template get<0>() < rhs.
_loc.template get<0>();
509 return operator+=(detail::difference_type(p.first, p.second));
514 _loc.template get<0>() += p;
515 _loc.template get<1>() += p;
516 _loc.template get<2>() += p;
525 template<
typename ImageLocator,
typename MaskLocator,
typename VarianceLocator>
536 template<
typename ImageLocator,
typename MaskLocator,
typename VarianceLocator>
537 class const_MaskedImageLocator :
538 public MaskedImageLocatorBase<typename detail::const_locator_type<ImageLocator>::type,
539 typename detail::const_locator_type<MaskLocator>::type,
540 typename detail::const_locator_type<VarianceLocator>::type,
559 #endif // !defined(SWIG)
571 #if 0 // doesn't compile. I should fix this, but it's low priority. RHL
610 unsigned int width,
unsigned int height,
643 std::string
const & fileName,
646 bool conformMasks=
false,
bool needAllHdus=
false,
671 bool conformMasks=
false,
bool needAllHdus=
false,
696 bool conformMasks=
false,
bool needAllHdus=
false,
704 bool const deep=
false
710 bool const deep=
false
716 template<
typename OtherPixelT>
724 throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
725 "Only deep copies are permitted for MaskedImages with different pixel types");
800 std::string
const & fileName,
870 if (!
_image && !noThrow) {
872 lsst::pex::exceptions::RuntimeError,
873 "MaskedImage's Image is NULL"
880 if (!
_mask && !noThrow) {
882 lsst::pex::exceptions::RuntimeError,
883 "MaskedImage's Mask is NULL"
893 lsst::pex::exceptions::RuntimeError,
894 "MaskedImage's Variance is NULL"
957 _mask->setXY0(origin);
975 return getImage()->indexToPosition(ind, xy);
987 return getImage()->positionToIndex(pos, xy);
1011 #else // bypass checks for non-NULL pointers
1017 return x_iterator(imageEnd, maskEnd, varianceEnd);
1029 #else // bypass checks for non-NULL pointers
1034 return y_iterator(imageEnd, maskEnd, varianceEnd);
1044 #else // bypass checks for non-NULL pointers
1050 return xy_locator(imageEnd, maskEnd, varianceEnd);
1066 template<typename ImagePixelT, typename MaskPixelT, typename VariancePixelT>
1068 typename
Image<ImagePixelT>::
Ptr image,
1069 typename
Mask<MaskPixelT>::
Ptr mask = typename
Mask<MaskPixelT>::
Ptr(),
1070 typename
Image<VariancePixelT>::Ptr variance = typename
Image<VariancePixelT>::Ptr()
1092 template<
typename ImageT,
typename TagT>
1094 typedef ImageT type;
1095 static typename type::Ptr
getImage(
typename ImageT::Ptr image) {
1100 template<
typename ImageT>
1101 struct GetImage_<ImageT, typename image::detail::MaskedImage_tag> {
1102 typedef typename ImageT::Image type;
1103 static typename type::Ptr
getImage(
typename ImageT::Ptr image) {
1104 return image->getImage();
1109 template<
typename ImageT>
1110 struct GetImage :
public GetImage_<ImageT, typename ImageT::image_category> {
1115 #endif // LSST_IMAGE_MASKEDIMAGE_H
MaskedImageLocatorBase & operator+=(pair2I const &p)
Increment the locator's x and y positions by p.
bool operator==(MaskedImageLocatorBase const &rhs)
Return true iff two locators are equal.
MaskedImageLocatorBase< ImageLocator, MaskLocator, VarianceLocator > MaskedImageLocatorBase_t
Ref< VariancePixelT >::type variance()
Return (a reference to) the variance part of the Pixel pointed at by the iterator.
boost::uint16_t MaskPixel
boost::tuple< typename ImageLocator::cached_location_t, typename MaskLocator::cached_location_t, typename VarianceLocator::cached_location_t > IMVCachedLocation
int getWidth() const
Return the number of columns in the image.
Mask< MaskPixelT >::Ptr MaskPtr
shared pointer to the Mask
ImagePtr getImage(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage's image.
Image< VariancePixelT >::Ptr VariancePtr
shared pointer to the variance Image
cached_location_t(IMVLocator const &loc, int x, int y)
Create a cached_location_t that can be used to access pixels (x, y) away from loc.
detail::MaskedImage_tag image_category
void operator*=(lsst::afw::image::Image< ImagePixelT > const &rhs)
Ref< ImagePixelT >::type image()
Return a reference to the image at the current position of the locator.
static MaskedImage readFits(std::string const &filename)
Read a MaskedImage from a regular FITS file.
Ref< VariancePixelT >::type variance()
Return a reference to the variance at the current position of the locator.
detail::const_locator_type< MaskLocator >::type const_MaskLocator
MaskedImage(MaskedImage< OtherPixelT, MaskPixelT, VariancePixelT > const &rhs, const bool deep)
Pixel operator[](cached_location_t const &cached_loc)
Dereference a locator, returning a Pixel offset by the amount set when we created the cached_location...
The base class for MaskedImageLocators (const and non-const)
Ref< MaskPixelT >::type mask(cached_location_t const &cached_loc)
Return a reference to the mask at the offset set when we created the cached_location_t.
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > * makeMaskedImage(typename Image< ImagePixelT >::Ptr image, typename Mask< MaskPixelT >::Ptr mask=typename Mask< MaskPixelT >::Ptr(), typename Image< VariancePixelT >::Ptr variance=typename Image< VariancePixelT >::Ptr())
MaskedImageIterator< typename Image::x_iterator, typename Mask::x_iterator, typename Variance::x_iterator > x_iterator
An iterator to a row of a MaskedImage.
Mask< MaskPixelT >::MaskPlaneDict MaskPlaneDict
The Mask's MaskPlaneDict.
MaskedImageIteratorBase< ImageIterator, MaskIterator, VarianceIterator > MaskedImageIteratorBase_t
lsst::afw::image::pixel::Pixel< ImagePixelT, MaskPixelT, VariancePixelT > Pixel
A Pixel in the MaskedImage.
iterator end() const
Return an iterator to the end of the image.
A templated class to return this classes' type (present in Image/Mask/MaskedImage) ...
void scaledDivides(double const c, MaskedImage const &rhs)
iterator at(int const x, int const y) const
Return an iterator at the point (x, y)
void operator-=(ImagePixelT const rhs)
Subtract a scalar rhs from a MaskedImage.
const_MaskedImageLocator(MaskedImageLocator< ImageLocator, MaskLocator, VarianceLocator > const &iter)
detail::const_iterator_type< ImageIterator >::type const_ImageIterator
y_iterator col_begin(int x) const
Return an y_iterator to the start of the image.
double indexToPosition(double ind, lsst::afw::image::xOrY const xy) const
Convert image index to image position (see Image::indexToPosition)
_view_t::y_iterator y_iterator
An iterator for traversing the pixels in a column.
void setXY0(int const x0, int const y0)
Ref< ImagePixelT >::type image()
Ref< MaskPixelT >::type mask(int x, int y)
Return a reference to the mask offset by (x, y) from the current position of the locator.
Ref< ImagePixelT >::type image()
Return (a reference to) the image part of the Pixel pointed at by the iterator.
MaskedImageLocator< typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator >::y_iterator xy_y_iterator
an y_iterator associated with an xy_locator
Ref< typename boost::mpl::at< PixelTVec, N >::type >::type apply_IMV(int x, int y)
void operator++(int)
Increment the iterator (postfix)
Ref< MaskPixelT >::type mask()
MaskedImage(unsigned int width, unsigned int height, MaskPlaneDict const &planeDict=MaskPlaneDict())
Construct from a supplied dimensions. The Image, Mask, and Variance will be set to zero...
const_MaskedImageIterator< typename Image::x_iterator, typename Mask::x_iterator, typename Variance::x_iterator > const_x_iterator
A const_iterator to a row of a MaskedImage.
The base class for MaskedImageIterators (const and non-const)
MaskedImageIteratorBase< const_ImageIterator, const_MaskIterator, const_VarianceIterator, ConstReference > MaskedImageIteratorBase_t
Ref< ImagePixelT >::type image(cached_location_t const &cached_loc)
Return a reference to the image at the offset set when we created the cached_location_t.
const Pixel operator*() const
Dereference the iterator, returning a const Pixel.
_x_or_y_iterator< apply_x > x_iterator
An x_iterator that provides a view of the xy_locator (i.e. advancing one advances the other) ...
detail::const_iterator_type< MaskIterator >::type const_MaskIterator
const_MaskedImageIterator(MaskedImageIterator< ImageIterator, MaskIterator, VarianceIterator > const &iter)
Ref< MaskPixelT >::type mask()
Return a reference to the mask at the current position of the locator.
A single pixel of the same type as a MaskedImage.
MaskedImageLocatorBase & operator+=(detail::difference_type p)
Increment the locator's x and y positions by p.
x_iterator row_end(int y) const
Return an x_iterator to the end of the image.
Ref< VariancePixelT >::type variance(int x, int y)
Return a reference to the variance offset by (x, y) from the current position of the locator...
boost::shared_ptr< MaskedImage > Ptr
shared pointer to a MaskedImage
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
lsst::afw::image::Mask< MaskPixelT > Mask
boost::shared_ptr< Image< PixelT > > Ptr
detail::const_locator_type< ImageLocator >::type const_ImageLocator
MaskedImageLocatorBase * _mil
Ref< typename boost::mpl::at< PixelTVec, N >::type >::type apply_IMV()
bool operator!=(_x_or_y_iterator const &rhs)
Ref< VariancePixelT >::type variance(cached_location_t const &cached_loc)
Return a reference to the variance at the offset set when we created the cached_location_t.
MaskedImageLocator(ImageLocator &img, MaskLocator &msk, VarianceLocator &var)
bool operator==(MaskedImageIteratorBase const &rhs)
Return true if the lhs equals the rhs.
void swap(MaskedImage &rhs)
boost::shared_ptr< Mask > Ptr
An integer coordinate rectangle.
void operator/=(lsst::afw::image::Image< ImagePixelT > const &rhs)
table::Key< table::Array< Kernel::Pixel > > image
bool operator<(MaskedImageLocatorBase const &rhs)
Return true iff lhs is less than rhs.
Ref< MaskPixelT >::type mask()
Return (a reference to) the mask part of the Pixel pointed at by the iterator.
_view_t::iterator iterator
An STL compliant iterator.
detail::const_locator_type< VarianceLocator >::type const_VarianceLocator
An iterator to the MaskedImage.
MaskedImageIterator< typename Image::y_iterator, typename Mask::y_iterator, typename Variance::y_iterator > y_iterator
An iterator to a column of a MaskedImage.
x_iterator x_at(int x, int y) const
Return an x_iterator at the point (x, y)
void operator-=(lsst::afw::image::Image< ImagePixelT > const &rhs)
detail::const_iterator_type< VarianceIterator >::type const_VarianceIterator
VariancePtr getVariance(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage's variance.
A locator for the MaskedImage.
void operator+=(const int di)
afw::table::PointKey< int > dimensions
Pixel operator()(int x, int y)
Dereference a locator, returning a Pixel offset by (x, y) from the locator.
boost::zip_iterator< IMV_iterator_tuple >::reference IMV_tuple
MaskedImageIterator< typename Image::iterator, typename Mask::iterator, typename Variance::iterator > iterator
boost::zip_iterator< IMV_iterator_tuple > _iter
xy_locator xy_at(int x, int y) const
Return an xy_locator at the point (x, y)
bool operator!=(MaskedImageLocatorBase const &rhs)
Return true iff two locators are not equal.
Pixel operator*()
Dereference the iterator, returning a Pixel.
MaskedImageIterator operator+(std::ptrdiff_t delta)
Return a MaskedImageIterator that's delta beyond this.
MaskedImageLocator< typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator > xy_locator
A locator for a MaskedImage.
_view_t::xy_locator xy_locator
An xy_locator.
lsst::afw::image::Image< ImagePixelT > Image
MaskedImageLocatorBase(ImageLocator const &img, MaskLocator const &msk, VarianceLocator const &var)
Construct a MaskedImageLocator from image/mask/variance locators.
lsst::afw::image::pixel::SinglePixel< ImagePixelT, MaskPixelT, VariancePixelT > SinglePixel
A single Pixel of the same type as those in the MaskedImage.
Represent a 2-dimensional array of bitmask pixels.
void operator+=(lsst::afw::image::Image< ImagePixelT > const &rhs)
Lifetime-management for memory that goes into FITS memory files.
lsst::afw::image::Image< VariancePixelT > Variance
void operator++()
Increment the iterator (prefix)
geom::Box2I getBBox(ImageOrigin const origin=PARENT) const
A traits class for MaskedImage.
void writeFits(std::string const &fileName, boost::shared_ptr< daf::base::PropertySet const > metadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > imageMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > maskMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > varianceMetadata=boost::shared_ptr< daf::base::PropertySet const >()) const
Write a MaskedImage to a regular FITS file.
MaskedImageIterator(ImageIterator &img, MaskIterator &msk, VarianceIterator &var)
Ref< typename boost::mpl::at< PixelTVec, N >::type >::type apply_IMV(cached_location_t const &cached_loc)
void operator*=(ImagePixelT const rhs)
A class to manipulate images, masks, and variance as a single object.
detail::MaskPlaneDict MaskPlaneDict
_view_t::reverse_iterator reverse_iterator
An STL compliant reverse iterator.
const_MaskedImageIterator< typename Image::y_iterator, typename Mask::y_iterator, typename Variance::y_iterator > const_y_iterator
A const_iterator to a column of a MaskedImage.
bool operator==(_x_or_y_iterator const &rhs)
MaskedImageIteratorBase(ImageIterator const &img, MaskIterator const &msk, VarianceIterator const &var)
Construct a MaskedImageIteratorBase from the image/mask/variance iterators.
_x_or_y_iterator(MaskedImageLocatorBase *mil)
A saved relative position, providing efficient access to neighbouring pixels.
float VariancePixel
! default type for Masks and MaskedImage Masks
geom::Point2I getXY0() const
Image< ImagePixelT >::Ptr ImagePtr
shared pointer to the Image
const_MaskedImageIterator & operator+(std::ptrdiff_t delta)
Return a const_MaskedImageIterator that's delta beyond this.
bool operator!=(MaskedImageIteratorBase const &rhs)
Return true if the lhs doesn't equal the rhs.
void operator/=(ImagePixelT const rhs)
MaskedImage & operator=(MaskedImage const &rhs)
Make the lhs use the rhs's pixels.
cached_location_t cache_location(int x, int y) const
Create a cached_location_t offset by (x, y) from locator.
std::ptrdiff_t operator-(MaskedImageIteratorBase const &rhs)
Return the distance between two iterators.
Interface for Persistable base class.
boost::tuple< ImageIterator, MaskIterator, VarianceIterator > IMV_iterator_tuple
bool operator<(_x_or_y_iterator const &rhs)
MaskedImageIterator< typename Image::reverse_iterator, typename Mask::reverse_iterator, typename Variance::reverse_iterator > reverse_iterator
std::string const compressedFileNoMEF_RE
be written as MEFs
Classes to provide utility functions for a "Pixel" to get at image/mask/variance operators.
#define LSST_PERSIST_FORMATTER(formatter...)
void operator<<=(MaskedImage const &rhs)
#define LSST_EXCEPT(type,...)
A pixel of a MaskedImage.
An const iterator to the MaskedImage.
const IMV_iterator_tuple get_iterator_tuple() const
std::string const fitsFile_RE
void operator+=(lsst::afw::math::Function2< double > const &function)
MaskPtr getMask(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage's mask.
Citizen(const std::type_info &)
MaskedImageLocator< typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator >::x_iterator xy_x_iterator
an x_iterator associated with an xy_locator
void setXY0(geom::Point2I const origin)
boost::tuple< ImageLocator, MaskLocator, VarianceLocator > IMVLocator
void scaledMultiplies(double const c, MaskedImage const &rhs)
_view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
void operator-=(lsst::afw::math::Function2< double > const &function)
Class for storing generic metadata.
MaskedImage< ImagePT, MaskPT, VarPT > type
Return the desired type.
boost::mpl::vector< ImagePixelT, MaskPixelT, VariancePixelT > PixelTVec
reverse_iterator rbegin() const
Return a reverse_iterator to the start of the image.
boost::shared_ptr< const MaskedImage > ConstPtr
x_iterator row_begin(int y) const
Return an x_iterator to the start of the image.
y_iterator y_at(int x, int y) const
Return an y_iterator at the point (x, y)
Base class for all persistable classes.
bool operator<(MaskedImageIteratorBase const &rhs)
Return true if the lhs is less than the rhs.
Ref< ImagePixelT >::type image(int x, int y)
Return a reference to the image offset by (x, y) from the current position of the locator...
void operator+=(ImagePixelT const rhs)
Add a scalar rhs to a MaskedImage.
const_MaskedImageIterator< typename Image::iterator, typename Mask::iterator, typename Variance::iterator > const_iterator
MaskedImageLocatorBase< const_ImageLocator, const_MaskLocator, const_VarianceLocator, ConstReference > MaskedImageLocatorBase_t
void operator+=(std::ptrdiff_t delta)
Increment the iterator by delta.
_x_or_y_iterator< apply_y > y_iterator
A y_iterator that provides a view of the xy_locator (i.e. advancing one advances the other) ...
std::pair< int, double > positionToIndex(double const pos, lsst::afw::image::xOrY const xy) const
Convert image position to index (see Image::positionToIndex)
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
A class used to identify classes that represent MaskedImage pixels.
int getHeight() const
Return the number of rows in the image.
geom::Extent2I getDimensions() const
reverse_iterator rend() const
Return a reverse_iterator to the end of the image.
Definition of default types for Masks and Variance Images.
y_iterator col_end(int x) const
Return an y_iterator to the end of the image.
void scaledMinus(double const c, MaskedImage const &rhs)
void scaledPlus(double const c, MaskedImage const &rhs)
Ref< VariancePixelT >::type variance()
Pixel type
Type pointed to by the iterator.
static MaskedImage readFits(fits::MemFileManager &manager)
Read a MaskedImage from a FITS RAM file.
iterator begin() const
Return an iterator to the start of the image.
const_MaskedImageLocator< typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator > const_xy_locator
A const_locator for a MaskedImage.
void operator-=(std::ptrdiff_t delta)
Decrement the iterator by delta.
Pixel operator*()
Dereference a locator, returning a Pixel.
A const locator for the MaskedImage.
metafunction to extract reference type from PixelT
metafunction to extract const reference type from PixelT