29 #ifndef LSST_AFW_IMAGE_MASK_H 30 #define LSST_AFW_IMAGE_MASK_H 49 namespace formatters {
82 template <
typename MaskPixelT = lsst::afw::image::MaskPixel>
90 template <
typename MaskPT = MaskPixelT>
104 explicit Mask(
unsigned int width,
unsigned int height, MaskPlaneDict
const& planeDefs =
MaskPlaneDict());
113 explicit Mask(
unsigned int width,
unsigned int height, MaskPixelT initialValue,
171 bool conformMasks =
false);
195 bool conformMasks =
false);
215 bool conformMasks =
false);
218 template <
typename OtherPixelT>
220 :
image::
ImageBase<MaskPixelT>(rhs, deep), _maskDict(rhs._maskDict) {}
228 Mask(
const Mask& src,
const bool deep =
false);
238 const bool deep =
false);
240 explicit Mask(ndarray::Array<MaskPixelT, 2, 1>
const& array,
bool deep =
false,
246 Mask& operator=(MaskPixelT
const rhs);
252 Mask& operator|=(MaskPixelT
const rhs);
257 Mask& operator&=(MaskPixelT
const rhs);
268 Mask& operator^=(MaskPixelT
const rhs);
291 bool operator()(
int x,
int y,
int plane)
const;
317 bool operator()(
int x,
int y,
int plane,
CheckIndices const& check)
const;
424 void clearAllMaskPlanes();
426 void clearMaskPlane(
int plane);
430 void setMaskPlaneValues(
const int plane,
const int x0,
const int x1,
const int y);
442 static void clearMaskPlaneDict();
444 static void removeMaskPlane(
const std::string& name);
454 void removeAndClearMaskPlane(
const std::string& name,
bool const removeFromDefault =
false);
467 static MaskPixelT getPlaneBitMask(
const std::string& name);
470 static int getNumPlanesUsed();
474 MaskPlaneDict
const& getMaskPlaneDict()
const;
476 void printMaskPlanes()
const;
498 void conformMaskPlanes(
const MaskPlaneDict& masterPlaneDict);
505 static int _setMaskPlaneDict(MaskPlaneDict
const& mpd);
516 static int addMaskPlane(
std::string name,
int plane);
519 static int getMaskPlaneNoThrow(
const std::string& name);
521 static MaskPixelT getBitMaskNoThrow(
int plane);
527 static MaskPixelT getBitMask(
int plane);
532 void _initializePlanes(MaskPlaneDict
const& planeDefs);
545 void checkMaskDictionaries(
Mask const& other);
548 template <
typename PixelT>
554 #endif // LSST_AFW_IMAGE_MASK_H
table::Key< std::string > name
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)
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.
afw::table::PointKey< int > dimensions
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.
static Mask readFits(fits::MemFileManager &manager, int hdu=INT_MIN)
Read a Mask from a FITS RAM file.
A class used to request that array accesses be checked.
static Mask readFits(std::string const &filename, int hdu=INT_MIN)
Read a Mask from a regular FITS file.
static int getNumPlanesMax()
A templated class to return this classes' type (present in Image/Mask/MaskedImage) ...