lsst.afw  14.0-27-gbdf48f848+1
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
lsst::afw::image::DecoratedImage< PixelT > Class Template Reference

A container for an Image and its associated metadata. More...

#include <Image.h>

Inheritance diagram for lsst::afw::image::DecoratedImage< PixelT >:
lsst::daf::base::Persistable lsst::daf::base::Citizen

Public Types

typedef std::shared_ptr< Persistable > Ptr
 
typedef unsigned long memId
 
typedef memId(* memNewCallback) (const memId cid)
 
typedef memId(* memCallback) (const Citizen *ptr)
 

Public Member Functions

 DecoratedImage (const geom::Extent2I &dimensions=geom::Extent2I())
 Create an image of the specified size. More...
 
 DecoratedImage (const geom::Box2I &bbox)
 Create an image of the specified size. More...
 
 DecoratedImage (std::shared_ptr< Image< PixelT >> rhs)
 Create a DecoratedImage wrapping rhs More...
 
 DecoratedImage (DecoratedImage const &rhs, const bool deep=false)
 Copy constructor. More...
 
 DecoratedImage (std::string const &fileName, const int hdu=INT_MIN, geom::Box2I const &bbox=geom::Box2I(), ImageOrigin const origin=PARENT)
 Create a DecoratedImage from a FITS file. More...
 
DecoratedImage & operator= (const DecoratedImage &image)
 Assignment operator. More...
 
std::shared_ptr< lsst::daf::base::PropertySet > getMetadata () const
 
void setMetadata (std::shared_ptr< lsst::daf::base::PropertySet > metadata)
 
int getWidth () const
 Return the number of columns in the image. More...
 
int getHeight () const
 Return the number of rows in the image. More...
 
int getX0 () const
 Return the image's column-origin. More...
 
int getY0 () const
 Return the image's row-origin. More...
 
const geom::Extent2I getDimensions () const
 Return the image's size; useful for passing to constructors. More...
 
void swap (DecoratedImage &rhs)
 
void writeFits (std::string const &fileName, std::shared_ptr< lsst::daf::base::PropertySet const > metadata=std::shared_ptr< lsst::daf::base::PropertySet const >(), std::string const &mode="w") const
 Write a FITS file. More...
 
std::shared_ptr< Image< PixelT > > getImage ()
 Return a shared_ptr to the DecoratedImage's Image. More...
 
std::shared_ptr< Image< PixelT > const > getImage () const
 Return a shared_ptr to the DecoratedImage's Image as const. More...
 
double getGain () const
 Return the DecoratedImage's gain. More...
 
void setGain (double gain)
 Set the DecoratedImage's gain. More...
 
void serialize (Archive &, unsigned int const)
 
std::string repr () const
 
void markPersistent (void)
 
memId getId () const
 

Static Public Member Functions

static bool hasBeenCorrupted ()
 
static memId getNextMemId ()
 
static int census (int, memId startingMemId=0)
 
static void census (std::ostream &stream, memId startingMemId=0)
 
static const std::vector< const Citizen *> * census ()
 
static int census (int, memId startingMemId=0)
 
static void census (std::ostream &stream, memId startingMemId=0)
 
static const std::vector< const Citizen *> * census ()
 
static memId setNewCallbackId (memId id)
 
static memId setNewCallbackId (memId id)
 
static memId setDeleteCallbackId (memId id)
 
static memId setDeleteCallbackId (memId id)
 
static memNewCallback setNewCallback (memNewCallback func)
 
static memCallback setDeleteCallback (memCallback func)
 
static memCallback setCorruptionCallback (memCallback func)
 

Public Attributes

 magicSentinel
 

Detailed Description

template<typename PixelT>
class lsst::afw::image::DecoratedImage< PixelT >

A container for an Image and its associated metadata.

Definition at line 391 of file Image.h.

Constructor & Destructor Documentation

◆ DecoratedImage() [1/5]

template<typename PixelT >
lsst::afw::image::DecoratedImage< PixelT >::DecoratedImage ( const geom::Extent2I &  dimensions = geom::Extent2I())
explicit

Create an image of the specified size.

Parameters
dimensionsdesired number of columns. rows

Definition at line 51 of file DecoratedImage.cc.

◆ DecoratedImage() [2/5]

template<typename PixelT >
lsst::afw::image::DecoratedImage< PixelT >::DecoratedImage ( const geom::Box2I &  bbox)
explicit

Create an image of the specified size.

Parameters
bbox(width, height) and origin of the desired Image
Note
Many lsst::afw::image and lsst::afw::math objects define a dimensions member which may be conveniently used to make objects of an appropriate size

Definition at line 56 of file DecoratedImage.cc.

◆ DecoratedImage() [3/5]

template<typename PixelT >
lsst::afw::image::DecoratedImage< PixelT >::DecoratedImage ( std::shared_ptr< Image< PixelT >>  rhs)
explicit

Create a DecoratedImage wrapping rhs

Note that this ctor shares pixels with the rhs; it isn't a deep copy

Parameters
rhsImage to go into DecoratedImage

Definition at line 61 of file DecoratedImage.cc.

◆ DecoratedImage() [4/5]

template<typename PixelT >
lsst::afw::image::DecoratedImage< PixelT >::DecoratedImage ( DecoratedImage< PixelT > const &  rhs,
const bool  deep = false 
)

Copy constructor.

Note that the lhs will share memory with the rhs unless deep is true

Parameters
rhsright hand side
deepMake deep copy?

Definition at line 66 of file DecoratedImage.cc.

◆ DecoratedImage() [5/5]

template<typename PixelT >
lsst::afw::image::DecoratedImage< PixelT >::DecoratedImage ( std::string const &  fileName,
const int  hdu = INT_MIN,
geom::Box2I const &  bbox = geom::Box2I(),
ImageOrigin const  origin = PARENT 
)
explicit

Create a DecoratedImage from a FITS file.

Parameters
fileNameFile to read
hduThe HDU to read
bboxOnly read these pixels
originCoordinate system of the bbox

Definition at line 95 of file DecoratedImage.cc.

Member Function Documentation

◆ getDimensions()

template<typename PixelT>
const geom::Extent2I lsst::afw::image::DecoratedImage< PixelT >::getDimensions ( ) const
inline

Return the image's size; useful for passing to constructors.

Definition at line 457 of file Image.h.

◆ getGain()

template<typename PixelT>
double lsst::afw::image::DecoratedImage< PixelT >::getGain ( ) const
inline

Return the DecoratedImage's gain.

Note
This is mostly just a place holder for other properties that we might want to associate with a DecoratedImage

Definition at line 482 of file Image.h.

◆ getHeight()

template<typename PixelT>
int lsst::afw::image::DecoratedImage< PixelT >::getHeight ( ) const
inline

Return the number of rows in the image.

Definition at line 449 of file Image.h.

◆ getImage() [1/2]

template<typename PixelT>
std::shared_ptr<Image<PixelT> > lsst::afw::image::DecoratedImage< PixelT >::getImage ( )
inline

Return a shared_ptr to the DecoratedImage's Image.

Definition at line 473 of file Image.h.

◆ getImage() [2/2]

template<typename PixelT>
std::shared_ptr<Image<PixelT> const> lsst::afw::image::DecoratedImage< PixelT >::getImage ( ) const
inline

Return a shared_ptr to the DecoratedImage's Image as const.

Definition at line 475 of file Image.h.

◆ getMetadata()

template<typename PixelT>
std::shared_ptr<lsst::daf::base::PropertySet> lsst::afw::image::DecoratedImage< PixelT >::getMetadata ( ) const
inline

Definition at line 443 of file Image.h.

◆ getWidth()

template<typename PixelT>
int lsst::afw::image::DecoratedImage< PixelT >::getWidth ( ) const
inline

Return the number of columns in the image.

Definition at line 447 of file Image.h.

◆ getX0()

template<typename PixelT>
int lsst::afw::image::DecoratedImage< PixelT >::getX0 ( ) const
inline

Return the image's column-origin.

Definition at line 452 of file Image.h.

◆ getY0()

template<typename PixelT>
int lsst::afw::image::DecoratedImage< PixelT >::getY0 ( ) const
inline

Return the image's row-origin.

Definition at line 454 of file Image.h.

◆ operator=()

template<typename PixelT >
DecoratedImage< PixelT > & lsst::afw::image::DecoratedImage< PixelT >::operator= ( const DecoratedImage< PixelT > &  image)

Assignment operator.

N.b. this is a shallow assignment; use set(src) if you want to copy the pixels

Definition at line 71 of file DecoratedImage.cc.

◆ setGain()

template<typename PixelT>
void lsst::afw::image::DecoratedImage< PixelT >::setGain ( double  gain)
inline

Set the DecoratedImage's gain.

Definition at line 484 of file Image.h.

◆ setMetadata()

template<typename PixelT>
void lsst::afw::image::DecoratedImage< PixelT >::setMetadata ( std::shared_ptr< lsst::daf::base::PropertySet >  metadata)
inline

Definition at line 444 of file Image.h.

◆ swap()

template<typename PixelT >
void lsst::afw::image::DecoratedImage< PixelT >::swap ( DecoratedImage< PixelT > &  rhs)

Definition at line 79 of file DecoratedImage.cc.

◆ writeFits()

template<typename PixelT >
void lsst::afw::image::DecoratedImage< PixelT >::writeFits ( std::string const &  fileName,
std::shared_ptr< lsst::daf::base::PropertySet const >  metadata = std::shared_ptr<lsst::daf::base::PropertySet const>(),
std::string const &  mode = "w" 
) const

Write a FITS file.

Parameters
fileNamethe file to write
metadatametadata to write to header; or NULL
mode"w" to write a new file; "a" to append

Definition at line 103 of file DecoratedImage.cc.


The documentation for this class was generated from the following files: