CVD 0.8
|
A full image which manages its own data. More...
#include <image.h>
Classes | |
struct | CopyPlaceHolder |
Public Types | |
typedef T | value_type |
Public Member Functions | |
Image (const Image ©) | |
Image (const CopyPlaceHolder &c) | |
CopyPlaceHolder | copy_from_me () const |
void | copy_from (const BasicImage< T > ©) |
void | copy_from (const SubImage< T > ©) |
void | make_unique () |
const Image & | operator= (const Image ©of) |
Image () | |
Image (const ImageRef &size) | |
Image (const ImageRef &size, const T &val) | |
Image (const std::pair< ImageRef, T > &p) | |
void | resize (const ImageRef &size) |
void | resize (const ImageRef &size, const T &val) |
~Image () |
A full image which manages its own data.
T | The pixel type for this image. Typically either CVD::byte or CVD::Rgb<CVD::byte> > are used, but images could be constructed of any available type. |
Images do reference counting on the data, so multiple images can point to one block of data. This means that copying an image is like copying a pointer (so use the same care); to further the analogy, operator[]() dereferences images. Copy constructing is quite fast (a 16-byte copy and an increment), so images can be efficiently passed back in functions or used in containers like std::vector
Image<> inherits all debugging macros from BasicImage and SubImage. In addition, the macro CVD_IMAGE_DEBUG_INITIALIZE_RANDOM will cause allocated memory to be initialized with random numbers before any constructors are called.
Loading and saving, format conversion and some copying functionality is provided by external functions rather than as part of this class. See the Image loading and saving, and format conversion module for documentation of these functions.
CVD::Image< T >::Image | ( | const Image< T > & | copy | ) | [inline] |
CVD::Image< T >::Image | ( | const CopyPlaceHolder & | c | ) | [inline] |
CopyFrom" constructor.
If constructed from this, it creates a new copy of the data. This provides symmetry with copy_from_me
c | The (placeholder) image to copy from. |
CVD::Image< T >::Image | ( | const ImageRef & | size | ) | [inline] |
CVD::Image< T >::Image | ( | const ImageRef & | size, |
const T & | val | ||
) | [inline] |
CVD::Image< T >::Image | ( | const std::pair< ImageRef, T > & | p | ) | [inline] |
Create a filled image of a given size.
p | std::pair<ImageRef, T> containing the size and fill value. Useful for creating containers of images with ImageCreationIterator |
CopyPlaceHolder CVD::Image< T >::copy_from_me | ( | ) | const [inline] |
void CVD::Image< T >::copy_from | ( | const BasicImage< T > & | copy | ) | [inline] |
Make a (new) copy of the image, also making a copy of the data.
copy | The image to copy |
Definition at line 678 of file image.h.
Referenced by CVD::Image< GRADIENT >::Image(), and CVD::Image< GRADIENT >::make_unique().
void CVD::Image< T >::copy_from | ( | const SubImage< T > & | copy | ) | [inline] |
Make a (new) copy of the image, also making a copy of the data.
copy | The image to copy |
Reimplemented from CVD::SubImage< T >.
const Image& CVD::Image< T >::operator= | ( | const Image< T > & | copyof | ) | [inline] |
void CVD::Image< T >::resize | ( | const ImageRef & | size | ) | [inline] |
Resize the image (destroying the data).
This does not affect any other images pointing to this data.
size | The new size of the image |
Definition at line 783 of file image.h.
Referenced by CVD::Image< GRADIENT >::copy_from(), and CVD::joinImages().
void CVD::Image< T >::resize | ( | const ImageRef & | size, |
const T & | val | ||
) | [inline] |