29 #ifndef LSST_AFW_IMAGE_MASK_H 30 #define LSST_AFW_IMAGE_MASK_H 50 namespace formatters {
83 template <
typename MaskPixelT = lsst::afw::image::MaskPixel>
91 template <
typename MaskPT = MaskPixelT>
105 explicit Mask(
unsigned int width,
unsigned int height, MaskPlaneDict
const& planeDefs =
MaskPlaneDict());
114 explicit Mask(
unsigned int width,
unsigned int height, MaskPixelT initialValue,
172 bool conformMasks =
false);
196 bool conformMasks =
false);
216 bool conformMasks =
false);
219 template <
typename OtherPixelT>
221 : image::
ImageBase<MaskPixelT>(rhs, deep), _maskDict(rhs._maskDict) {}
229 Mask(
const Mask& src,
const bool deep =
false);
241 const bool deep =
false);
243 explicit Mask(ndarray::Array<MaskPixelT, 2, 1>
const& array,
bool deep =
false,
249 Mask& operator=(MaskPixelT
const rhs);
256 Mask& operator|=(MaskPixelT
const rhs);
261 Mask& operator&=(MaskPixelT
const rhs);
272 Mask& operator^=(MaskPixelT
const rhs);
295 bool operator()(
int x,
int y,
int plane)
const;
321 bool operator()(
int x,
int y,
int plane,
CheckIndices const& check)
const;
430 void clearAllMaskPlanes();
432 void clearMaskPlane(
int plane);
436 void setMaskPlaneValues(
const int plane,
const int x0,
const int x1,
const int y);
448 static void clearMaskPlaneDict();
450 static void removeMaskPlane(
const std::string& name);
460 void removeAndClearMaskPlane(
const std::string& name,
bool const removeFromDefault =
false);
473 static MaskPixelT getPlaneBitMask(
const std::string& name);
476 static int getNumPlanesUsed();
480 MaskPlaneDict
const& getMaskPlaneDict()
const;
482 void printMaskPlanes()
const;
504 void conformMaskPlanes(
const MaskPlaneDict& masterPlaneDict);
511 static int _setMaskPlaneDict(MaskPlaneDict
const& mpd);
522 static int addMaskPlane(
std::string name,
int plane);
525 static int getMaskPlaneNoThrow(
const std::string& name);
527 static MaskPixelT getBitMaskNoThrow(
int plane);
533 static MaskPixelT getBitMask(
int plane);
538 void _initializePlanes(MaskPlaneDict
const& planeDefs);
551 void checkMaskDictionaries(
Mask const& other);
554 template <
typename PixelT>
560 #endif // LSST_AFW_IMAGE_MASK_H
Mask(Mask< OtherPixelT > const &rhs, const bool deep)
std::map< std::string, int > MaskPlaneDict
Options for writing an image to FITS.
std::string getAsString(int x, int y)
static Mask readFits(std::string const &filename, int hdu=fits::DEFAULT_HDU)
Read a Mask from a regular FITS file.
detail::MaskPlaneDict MaskPlaneDict
void swap(Mask< PixelT > &a, Mask< PixelT > &b)
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
The base class for all image classed (Image, Mask, MaskedImage, ...)
Mask< MaskPT > type
Return the desired type.
An integer coordinate rectangle.
A base class for image defects.
Represent a 2-dimensional array of bitmask pixels.
detail::Mask_tag image_category
Lifetime-management for memory that goes into FITS memory files.
A class used to request that array accesses be checked.
static int getNumPlanesMax()
A templated class to return this classes' type (present in Image/Mask/MaskedImage) ...
static Mask readFits(fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
Read a Mask from a FITS RAM file.
const int DEFAULT_HDU
Specify that the default HDU should be read.