30 #ifndef LSST_AFW_IMAGE_IMAGE_H 31 #define LSST_AFW_IMAGE_IMAGE_H 37 #include "boost/mpl/bool.hpp" 58 namespace formatters {
59 template <
typename PixelT>
61 template <
typename PixelT>
62 class DecoratedImageFormatter;
68 template <
typename PixelT>
71 template <
typename,
typename,
typename>
77 template <
typename ImagePT = PixelT>
82 template <
typename OtherPixelT>
95 explicit Image(
unsigned int width,
unsigned int height, PixelT initialValue = 0);
128 const bool deep =
false);
138 Image(
const Image& rhs,
const bool deep =
false);
189 template <
typename OtherPixelT>
192 explicit Image(ndarray::Array<PixelT, 2, 1>
const& array,
bool deep =
false,
196 virtual ~
Image() =
default;
201 Image& operator=(
const PixelT rhs);
352 void scaledMultiplies(
double const c,
Image<PixelT> const& rhs);
362 void scaledDivides(
double const c,
Image<PixelT> const& rhs);
375 template <
typename LhsPixelT,
typename RhsPixelT>
378 template <
typename LhsPixelT,
typename RhsPixelT>
381 template <
typename LhsPixelT,
typename RhsPixelT>
384 template <
typename LhsPixelT,
typename RhsPixelT>
387 template <
typename PixelT>
393 template <
typename PixelT>
450 int getWidth()
const {
return _image->getWidth(); }
455 int getX0()
const {
return _image->getX0(); }
457 int getY0()
const {
return _image->getY0(); }
499 template <
typename PixelT>
511 template<
typename T1,
typename T2>
std::shared_ptr< Image< PixelT > > getImage()
Return a shared_ptr to the DecoratedImage's Image.
std::shared_ptr< Image< PixelT > const > getImage() const
Return a shared_ptr to the DecoratedImage's Image as const.
A templated class to return this classes' type (present in Image/Mask/MaskedImage) ...
void scaledPlus(OutImageT &outImage, double c1, InImageT const &inImage1, double c2, InImageT const &inImage2)
Compute the scaled sum of two images.
std::shared_ptr< lsst::daf::base::PropertySet > getMetadata() const
int getWidth() const
Return the number of columns in the image.
int getHeight() const
Return the number of rows in the image.
Image< LhsPixelT > & operator+=(Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
Add lhs to Image rhs (i.e. pixel-by-pixel addition) where types are different.
const geom::Extent2I getDimensions() const
Return the image's size; useful for passing to constructors.
Options for writing an image to FITS.
void setMetadata(std::shared_ptr< lsst::daf::base::PropertySet > metadata)
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, ...)
A Function taking two arguments.
An integer coordinate rectangle.
afw::table::PointKey< int > dimensions
A base class for image defects.
Represent a 2-dimensional array of bitmask pixels.
Lifetime-management for memory that goes into FITS memory files.
A class to manipulate images, masks, and variance as a single object.
bool imagesOverlap(ImageBase< T1 > const &image1, ImageBase< T2 > const &image2)
Return true if the pixels for two images or masks overlap in memory.
geom::Box2I bboxFromMetadata(daf::base::PropertySet &metadata)
Determine the image bounding box from its metadata (FITS header)
void setGain(double gain)
Set the DecoratedImage's gain.
Image(ndarray::Array< PixelT, 2, 1 > const &array, bool deep=false, geom::Point2I const &xy0=geom::Point2I())
void swap(DecoratedImage< PixelT > &a, DecoratedImage< PixelT > &b)
Image< LhsPixelT > & operator*=(Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
Multiply lhs by Image rhs (i.e. pixel-by-pixel multiplication) where types are different.
Image< LhsPixelT > & operator-=(Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
Subtract lhs from Image rhs (i.e. pixel-by-pixel subtraction) where types are different.
#define LSST_PERSIST_FORMATTER(formatter...)
int getX0() const
Return the image's column-origin.
Image< LhsPixelT > & operator/=(Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
Divide lhs by Image rhs (i.e. pixel-by-pixel division) where types are different. ...
Image(Image< OtherPixelT > const &rhs, const bool deep)
static Image readFits(std::string const &filename, int hdu=fits::DEFAULT_HDU)
Read an Image from a regular FITS file.
static Image readFits(fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
Read an Image from a FITS RAM file.
int getY0() const
Return the image's row-origin.
A class to represent a 2-dimensional array of pixels.
detail::Image_tag image_category
double getGain() const
Return the DecoratedImage's gain.
Image< ImagePT > type
Return the desired type.
A container for an Image and its associated metadata.
const int DEFAULT_HDU
Specify that the default HDU should be read.