CVD 0.8
|
A generic image class to manage a block of arbitrarily padded data as an image. More...
#include <image.h>
Public Types | |
typedef SubImageIterator< T > | iterator |
typedef ConstSubImageIterator< T > | const_iterator |
typedef T | value_type |
Public Member Functions | |
SubImage (T *data, const ImageRef &size, int stride) | |
bool | in_image (const ImageRef &ir) const |
bool | in_image_with_border (const ImageRef &ir, int border) const |
~SubImage () | |
T & | operator[] (const ImageRef &pos) |
const T & | operator[] (const ImageRef &pos) const |
T * | operator[] (int row) |
const T * | operator[] (int row) const |
ImageRef | pos (const T *ptr) const |
const T * | data () const |
T * | data () |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
void | copy_from (const SubImage< T > &other) |
ImageRef | size () const |
int | row_stride () const |
int | totalsize () const |
void | zero () |
void | fill (const T d) |
SubImage (const SubImage ©of) | |
SubImage | sub_image (const ImageRef &start, const ImageRef &size) |
const SubImage | sub_image (const ImageRef &start, const ImageRef &size) const |
SubImage & | ref () |
Protected Member Functions | |
T * | end_ptr () |
const T * | end_ptr () const |
Protected Attributes | |
T * | my_data |
ImageRef | my_size |
int | my_stride |
A generic image class to manage a block of arbitrarily padded data as an image.
Provides basic image access such as accessing a particular pixel co-ordinate.
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. |
A BasicImage does not manage its own data, but provides access to an arbitrary externally-managed block of data as though it were an image. Use the derived Image class if you want an image which also has its own data.
CVD::SubImage< T >::SubImage | ( | T * | data, |
const ImageRef & | size, | ||
int | stride | ||
) | [inline] |
CVD::SubImage< T >::SubImage | ( | const SubImage< T > & | copyof | ) | [inline] |
bool CVD::SubImage< T >::in_image | ( | const ImageRef & | ir | ) | const [inline] |
Is this pixel co-ordinate inside the image?
ir | The co-ordinate to test |
Definition at line 269 of file image.h.
Referenced by CVD::combineImages(), CVD::copy(), CVD::SubImage< GRADIENT >::operator[](), and CVD::SubImage< GRADIENT >::sub_image().
bool CVD::SubImage< T >::in_image_with_border | ( | const ImageRef & | ir, |
int | border | ||
) | const [inline] |
T& CVD::SubImage< T >::operator[] | ( | const ImageRef & | pos | ) | [inline] |
Access a pixel from the image.
Bounds checking is only performed if the library is compiled with -D CVD_IMAGE_DEBUG
, in which case an ImageError::AccessOutsideImage exception is thrown.
const T& CVD::SubImage< T >::operator[] | ( | const ImageRef & | pos | ) | const [inline] |
Access a pixel from the image.
Bounds checking is only performed if the library is compiled with -D CVD_IMAGE_DEBUG
, in which case an ImageError::AccessOutsideImage exception is thrown.
T* CVD::SubImage< T >::operator[] | ( | int | row | ) | [inline] |
Access pointer to pixel row.
Returns the pointer to the first element of the passed row. Allows to use [y][x] on images to access a pixel. Bounds checking is only performed if the library is compiled with -D CVD_IMAGE_DEBUG
, in which case an ImageError::AccessOutsideImage exception is thrown.
const T* CVD::SubImage< T >::operator[] | ( | int | row | ) | const [inline] |
Access pointer to pixel row.
Returns the pointer to the first element of the passed row. Allows to use [y][x] on images to access a pixel. Bounds checking is only performed if the library is compiled with -D CVD_IMAGE_DEBUG
, in which case an ImageError::AccessOutsideImage exception is thrown.
void CVD::SubImage< T >::fill | ( | const T | d | ) | [inline] |
Set all the pixels in the image to a value.
This is a relatively fast operation, using memfill
.
d | The value to write into the image |
Definition at line 404 of file image.h.
Referenced by CVD::Image< GRADIENT >::resize().
SubImage CVD::SubImage< T >::sub_image | ( | const ImageRef & | start, |
const ImageRef & | size | ||
) | [inline] |
const SubImage CVD::SubImage< T >::sub_image | ( | const ImageRef & | start, |
const ImageRef & | size | ||
) | const [inline] |