LSSTApplications
10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
|
The base class for all image classed (Image, Mask, MaskedImage, ...) More...
#include <Image.h>
Public Types | |
typedef boost::shared_ptr < ImageBase< PixelT > > | Ptr |
A shared_ptr to an ImageBase. More... | |
typedef boost::shared_ptr < const ImageBase< PixelT > > | ConstPtr |
A shared_ptr to a const ImageBase. More... | |
typedef detail::basic_tag | image_category |
trait class to identify type of image More... | |
typedef PixelT | SinglePixel |
A single Pixel of the same type as those in the ImageBase. More... | |
typedef PixelT | Pixel |
A pixel in this ImageBase. More... | |
typedef Reference< PixelT >::type | PixelReference |
A Reference to a PixelT. More... | |
typedef ConstReference< PixelT > ::type | PixelConstReference |
A ConstReference to a PixelT. More... | |
typedef _view_t::xy_locator | xy_locator |
An xy_locator. More... | |
typedef _view_t::xy_locator::const_t | const_xy_locator |
A const_xy_locator. More... | |
typedef _view_t::iterator | iterator |
An STL compliant iterator. More... | |
typedef _const_view_t::iterator | const_iterator |
An STL compliant const iterator. More... | |
typedef _view_t::reverse_iterator | reverse_iterator |
An STL compliant reverse iterator. More... | |
typedef _const_view_t::reverse_iterator | const_reverse_iterator |
An STL compliant const reverse iterator. More... | |
typedef _view_t::x_iterator | x_iterator |
An iterator for traversing the pixels in a row. More... | |
typedef x_iterator | fast_iterator |
typedef _view_t::x_iterator | xy_x_iterator |
An iterator for traversing the pixels in a row, created from an xy_locator. More... | |
typedef _const_view_t::x_iterator | const_x_iterator |
A const iterator for traversing the pixels in a row. More... | |
typedef _view_t::y_iterator | y_iterator |
An iterator for traversing the pixels in a column. More... | |
typedef _view_t::y_iterator | xy_y_iterator |
An iterator for traversing the pixels in a row, created from an xy_locator. More... | |
typedef _const_view_t::y_iterator | const_y_iterator |
A const iterator for traversing the pixels in a column. More... | |
typedef ndarray::Array< PixelT, 2, 1 > | Array |
A mutable ndarray representation of the image. More... | |
typedef ndarray::Array< PixelT const, 2, 1 > | ConstArray |
An immutable ndarray representation of the image. More... | |
Public Types inherited from lsst::daf::base::Persistable | |
typedef boost::shared_ptr < Persistable > | Ptr |
Public Types inherited from lsst::daf::base::Citizen | |
enum | { magicSentinel = 0xdeadbeef } |
typedef unsigned long | memId |
Type of the block's ID. More... | |
typedef memId(* | memNewCallback )(const memId cid) |
A function used to register a callback. More... | |
typedef memId(* | memCallback )(const Citizen *ptr) |
Public Member Functions | |
ImageBase (const geom::Extent2I &dimensions=geom::Extent2I()) | |
ImageBase (const geom::Box2I &bbox) | |
ImageBase (const ImageBase &src, const bool deep=false) | |
ImageBase (const ImageBase &src, const geom::Box2I &bbox, const ImageOrigin origin=PARENT, const bool deep=false) | |
template<typename OtherPixelT > | |
ImageBase (const ImageBase< OtherPixelT > &rhs, const bool deep) | |
ImageBase (Array const &array, bool deep=false, geom::Point2I const &xy0=geom::Point2I()) | |
virtual | ~ImageBase () |
ImageBase & | operator= (const ImageBase &rhs) |
ImageBase & | operator= (const PixelT rhs) |
Set the image's pixels to rhs. More... | |
void | operator<<= (const ImageBase &rhs) |
Set the lhs's pixel values to equal the rhs's. More... | |
PixelReference | operator() (int x, int y) |
Return a reference to the pixel (x, y) More... | |
PixelReference | operator() (int x, int y, CheckIndices const &) |
Return a reference to the pixel (x, y) with bounds checking. More... | |
PixelConstReference | operator() (int x, int y) const |
Return a const reference to the pixel (x, y) More... | |
PixelConstReference | operator() (int x, int y, CheckIndices const &) const |
Return a const reference to the pixel (x, y) with bounds checking. More... | |
PixelConstReference | get0 (int x, int y) const |
PixelConstReference | get0 (int x, int y, CheckIndices const &check) const |
void | set0 (int x, int y, const PixelT v) |
void | set0 (int x, int y, const PixelT v, CheckIndices const &check) |
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 |
int | getY0 () const |
geom::Point2I | getXY0 () const |
std::pair< int, double > | positionToIndex (double const pos, lsst::afw::image::xOrY const xy) const |
Convert image position to index (nearest integer and fractional parts) More... | |
double | indexToPosition (double ind, lsst::afw::image::xOrY const xy) const |
Convert image index to image position. More... | |
geom::Extent2I | getDimensions () const |
Return the image's size; useful for passing to constructors. More... | |
void | swap (ImageBase &rhs) |
Array | getArray () |
ConstArray | getArray () const |
iterator | begin () const |
iterator | end () const |
Return an STL compliant iterator to the end of the image. More... | |
reverse_iterator | rbegin () const |
Return an STL compliant reverse iterator to the start of the image. More... | |
reverse_iterator | rend () const |
Return an STL compliant reverse iterator to the end of the image. More... | |
iterator | at (int x, int y) const |
Return an STL compliant iterator at the point (x, y) More... | |
fast_iterator | begin (bool) const |
fast_iterator | end (bool) const |
x_iterator | row_begin (int y) const |
x_iterator | row_end (int y) const |
Return an x_iterator to the end of the y'th row. More... | |
x_iterator | x_at (int x, int y) const |
Return an x_iterator to the point (x, y) in the image. More... | |
y_iterator | col_begin (int x) const |
y_iterator | col_end (int x) const |
Return an y_iterator to the end of the y'th row. More... | |
y_iterator | y_at (int x, int y) const |
Return an y_iterator to the point (x, y) in the image. More... | |
xy_locator | xy_at (int x, int y) const |
void | setXY0 (geom::Point2I const origin) |
void | setXY0 (int const x0, int const y0) |
geom::Box2I | getBBox (ImageOrigin origin=PARENT) const |
Public Member Functions inherited from lsst::daf::base::Persistable | |
Persistable (void) | |
virtual | ~Persistable (void) |
template<class Archive > | |
void | serialize (Archive &, unsigned int const) |
Public Member Functions inherited from lsst::daf::base::Citizen | |
Citizen (const std::type_info &) | |
Citizen (Citizen const &) | |
~Citizen () | |
Citizen & | operator= (Citizen const &) |
std::string | repr () const |
Return a string representation of a Citizen. More... | |
void | markPersistent (void) |
Mark a Citizen as persistent and not destroyed until process end. More... | |
memId | getId () const |
Return the Citizen's ID. More... | |
Static Public Member Functions | |
template<typename SinglePixelT > | |
static SinglePixel | PixelCast (SinglePixelT rhs) |
Convert a type to our SinglePixel type. More... | |
Static Public Member Functions inherited from lsst::daf::base::Citizen | |
static bool | hasBeenCorrupted () |
Check all allocated blocks for corruption. More... | |
static memId | getNextMemId () |
Return the memId of the next object to be allocated. More... | |
static int | init () |
Called once when the memory system is being initialised. More... | |
static int | census (int, memId startingMemId=0) |
How many active Citizens are there? More... | |
static void | census (std::ostream &stream, memId startingMemId=0) |
Print a list of all active Citizens to stream, sorted by ID. More... | |
static const std::vector < const Citizen * > * | census () |
Return a (newly allocated) std::vector of active Citizens sorted by ID. More... | |
static memId | setNewCallbackId (memId id) |
Call the NewCallback when block is allocated. More... | |
static memId | setDeleteCallbackId (memId id) |
Call the current DeleteCallback when block is deleted. More... | |
static memNewCallback | setNewCallback (memNewCallback func) |
Set the NewCallback function. More... | |
static memCallback | setDeleteCallback (memCallback func) |
Set the DeleteCallback function. More... | |
static memCallback | setCorruptionCallback (memCallback func) |
Set the CorruptionCallback function. More... | |
Protected Member Functions | |
_view_t | _getRawView () const |
bool | isContiguous () const |
Static Protected Member Functions | |
static _view_t | _allocateView (geom::Extent2I const &dimensions, Manager::Ptr &manager) |
static _view_t | _makeSubView (geom::Extent2I const &dimensions, geom::Extent2I const &offset, const _view_t &view) |
Private Types | |
typedef lsst::afw::image::detail::types_traits < PixelT >::view_t | _view_t |
typedef lsst::afw::image::detail::types_traits < PixelT >::const_view_t | _const_view_t |
typedef ndarray::Manager | Manager |
Private Attributes | |
geom::Point2I | _origin |
Manager::Ptr | _manager |
_view_t | _gilView |
Friends | |
template<typename OtherPixelT > | |
class | ImageBase |
template<typename > | |
class | DecoratedImage |
template<typename , typename , typename > | |
class | MaskedImage |
The base class for all image classed (Image, Mask, MaskedImage, ...)
|
private |
|
private |
typedef ndarray::Array<PixelT, 2, 1> lsst.afw.image::ImageBase< PixelT >::Array |
typedef _const_view_t::iterator lsst.afw.image::ImageBase< PixelT >::const_iterator |
typedef _const_view_t::reverse_iterator lsst.afw.image::ImageBase< PixelT >::const_reverse_iterator |
typedef _const_view_t::x_iterator lsst.afw.image::ImageBase< PixelT >::const_x_iterator |
typedef _view_t::xy_locator::const_t lsst.afw.image::ImageBase< PixelT >::const_xy_locator |
typedef _const_view_t::y_iterator lsst.afw.image::ImageBase< PixelT >::const_y_iterator |
typedef ndarray::Array<PixelT const, 2, 1> lsst.afw.image::ImageBase< PixelT >::ConstArray |
typedef boost::shared_ptr<const ImageBase<PixelT> > lsst.afw.image::ImageBase< PixelT >::ConstPtr |
typedef x_iterator lsst.afw.image::ImageBase< PixelT >::fast_iterator |
typedef detail::basic_tag lsst.afw.image::ImageBase< PixelT >::image_category |
typedef _view_t::iterator lsst.afw.image::ImageBase< PixelT >::iterator |
|
private |
typedef PixelT lsst.afw.image::ImageBase< PixelT >::Pixel |
typedef ConstReference<PixelT>::type lsst.afw.image::ImageBase< PixelT >::PixelConstReference |
typedef Reference<PixelT>::type lsst.afw.image::ImageBase< PixelT >::PixelReference |
typedef boost::shared_ptr<ImageBase<PixelT> > lsst.afw.image::ImageBase< PixelT >::Ptr |
typedef _view_t::reverse_iterator lsst.afw.image::ImageBase< PixelT >::reverse_iterator |
typedef PixelT lsst.afw.image::ImageBase< PixelT >::SinglePixel |
typedef _view_t::x_iterator lsst.afw.image::ImageBase< PixelT >::x_iterator |
typedef _view_t::xy_locator lsst.afw.image::ImageBase< PixelT >::xy_locator |
typedef _view_t::x_iterator lsst.afw.image::ImageBase< PixelT >::xy_x_iterator |
typedef _view_t::y_iterator lsst.afw.image::ImageBase< PixelT >::xy_y_iterator |
typedef _view_t::y_iterator lsst.afw.image::ImageBase< PixelT >::y_iterator |
|
explicit |
Allocator Constructor
allocate a new image with the specified dimensions. Sets origin at (0,0)
Definition at line 108 of file Image.cc.
|
explicit |
Allocator Constructor
allocate a new image with the specified dimensions and origin
Definition at line 121 of file Image.cc.
lsst.afw.image::ImageBase< PixelT >::ImageBase | ( | const ImageBase< PixelT > & | src, |
const bool | deep = false |
||
) |
Copy constructor.
deep
is true
, the new image will share the old image's pixels; this may not be what you want. See also operator<<=() to copy pixels between Images src | Right-hand-side image |
deep | If false, new ImageBase shares storage with rhs; if true make a new, standalone, ImageBase |
Definition at line 135 of file Image.cc.
|
explicit |
Copy constructor to make a copy of part of an image.
The bbox ignores X0/Y0 if origin == LOCAL, and uses it if origin == PARENT.
deep
is true
, the new image will share the old image's pixels; this is probably what you want src | Right-hand-side image |
bbox | Specify desired region |
origin | Specify the coordinate system of the bbox |
deep | If false, new ImageBase shares storage with rhs; if true make a new, standalone, ImageBase |
Definition at line 161 of file Image.cc.
|
inline |
generalised copy constructor
defined here in the header so that the compiler can instantiate N(N-1) conversions between N ImageBase types.
Definition at line 193 of file Image.h.
|
explicit |
Construction from ndarray::Array and NumPy.
Unless deep is true, the new image will share memory with the array if the the dimension is contiguous in memory. If the last dimension is not contiguous, the array will be deep-copied in Python, but the constructor will fail to compile in pure C++.
Definition at line 190 of file Image.cc.
|
inlinevirtual |
|
staticprotected |
Definition at line 53 of file Image.cc.
|
inlineprotected |
|
staticprotected |
Definition at line 78 of file Image.cc.
image::ImageBase< PixelT >::iterator lsst.afw.image::ImageBase< PixelT >::at | ( | int | x, |
int | y | ||
) | const |
image::ImageBase< PixelT >::iterator lsst.afw.image::ImageBase< PixelT >::begin | ( | void | ) | const |
Return an STL compliant iterator to the start of the image
Note that this isn't especially efficient; see imageIterators for a discussion
Definition at line 325 of file Image.cc.
image::ImageBase< PixelT >::fast_iterator lsst.afw.image::ImageBase< PixelT >::begin | ( | bool | contiguous | ) | const |
|
inline |
|
inline |
image::ImageBase< PixelT >::iterator lsst.afw.image::ImageBase< PixelT >::end | ( | void | ) | const |
image::ImageBase< PixelT >::fast_iterator lsst.afw.image::ImageBase< PixelT >::end | ( | bool | contiguous | ) | const |
Return a fast STL compliant iterator to the end of the image which must be contiguous
lsst::pex::exceptions::Runtime | Argument contiguous is false, or the pixels are not in fact contiguous |
contiguous | Pixels are contiguous (must be true) |
Definition at line 378 of file Image.cc.
|
inline |
Definition at line 223 of file Image.h.
|
inline |
Definition at line 226 of file Image.h.
image::ImageBase< PixelT >::Array lsst.afw.image::ImageBase< PixelT >::getArray | ( | ) |
Definition at line 296 of file Image.cc.
image::ImageBase< PixelT >::ConstArray lsst.afw.image::ImageBase< PixelT >::getArray | ( | ) | const |
Definition at line 308 of file Image.cc.
|
inline |
Definition at line 377 of file Image.h.
|
inline |
Return the image's size; useful for passing to constructors.
Definition at line 298 of file Image.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Convert image index to image position.
The LSST indexing convention is:
ind | image index |
xy | Is this a column or row coordinate? |
Definition at line 290 of file Image.h.
|
inlineprotected |
Definition at line 404 of file Image.h.
image::ImageBase< PixelT >::PixelReference lsst.afw.image::ImageBase< PixelT >::operator() | ( | int | x, |
int | y | ||
) |
Return a reference to the pixel (x, y)
Definition at line 236 of file Image.cc.
image::ImageBase< PixelT >::PixelReference lsst.afw.image::ImageBase< PixelT >::operator() | ( | int | x, |
int | y, | ||
image::CheckIndices const & | check | ||
) |
Return a reference to the pixel (x, y)
with bounds checking.
Definition at line 244 of file Image.cc.
image::ImageBase< PixelT >::PixelConstReference lsst.afw.image::ImageBase< PixelT >::operator() | ( | int | x, |
int | y | ||
) | const |
image::ImageBase< PixelT >::PixelConstReference lsst.afw.image::ImageBase< PixelT >::operator() | ( | int | x, |
int | y, | ||
image::CheckIndices const & | check | ||
) | const |
Return a const reference to the pixel (x, y)
with bounds checking.
Definition at line 271 of file Image.cc.
void lsst.afw.image::ImageBase< PixelT >::operator<<= | ( | const ImageBase< PixelT > & | rhs | ) |
Set the lhs's pixel values to equal the rhs's.
Definition at line 225 of file Image.cc.
image::ImageBase< PixelT > & lsst.afw.image::ImageBase< PixelT >::operator= | ( | const ImageBase< PixelT > & | rhs | ) |
Shallow assignment operator.
Definition at line 216 of file Image.cc.
image::ImageBase< PixelT > & lsst.afw.image::ImageBase< PixelT >::operator= | ( | const PixelT | rhs | ) |
|
inlinestatic |
Convert a type to our SinglePixel type.
Definition at line 175 of file Image.h.
|
inline |
Convert image position to index (nearest integer and fractional parts)
pos | image position |
xy | Is this a column or row coordinate? |
Definition at line 271 of file Image.h.
image::ImageBase< PixelT >::reverse_iterator lsst.afw.image::ImageBase< PixelT >::rbegin | ( | ) | const |
image::ImageBase< PixelT >::reverse_iterator lsst.afw.image::ImageBase< PixelT >::rend | ( | ) | const |
|
inline |
|
inline |
|
inline |
Definition at line 229 of file Image.h.
|
inline |
Definition at line 232 of file Image.h.
|
inline |
|
inline |
void lsst.afw.image::ImageBase< PixelT >::swap | ( | ImageBase< PixelT > & | rhs | ) |
Definition at line 282 of file Image.cc.
|
inline |
|
inline |
Return an xy_locator
at the point (x, y)
in the image
Locators may be used to access a patch in an image
Definition at line 351 of file Image.h.
|
inline |
|
private |
|
private |
|
private |