#include <image.h>
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. |
Definition at line 263 of file image.h.
Public Types | |
typedef SubImageIterator< T > | iterator |
typedef ConstSubImageIterator < T > | const_iterator |
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 |
SubImageIteratorEnd< T > | fastend () |
ConstSubImageIteratorEnd < T > | fastend () const |
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 |
SubImage () | |
Protected Attributes | |
T * | my_data |
ImageRef | my_size |
int | my_stride |
CVD::SubImage< T >::SubImage | ( | T * | data, | |
const ImageRef & | size, | |||
int | stride | |||
) | [inline] |
CVD::SubImage< T >::~SubImage | ( | ) | [inline] |
The image data is not destroyed when a BasicImage is destroyed.
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 278 of file image.h.
Referenced by CVD::combineImages(), CVD::copy(), CVD::SubImage< CVD::Rgb< unsigned char > >::operator[](), and CVD::SubImage< CVD::Rgb< unsigned char > >::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.
ImageRef CVD::SubImage< T >::pos | ( | const T * | ptr | ) | const [inline] |
const T* CVD::SubImage< T >::data | ( | ) | const [inline] |
Returns the raw image data.
Definition at line 341 of file image.h.
Referenced by CVD::SubImage< CVD::Rgb< unsigned char > >::begin(), CVD::ConvertImage< T, T, Pixel::GenericConversion< T, T >, 1 >::convert(), CVD::convolve_gaussian_3(), CVD::convolveGaussian(), CVD::convolveGaussian5_1(), CVD::convolveSeparableSymmetric(), CVD::convolveSymmetric(), CVD::convolveWithBox(), CVD::copy(), CVD::flipVertical(), CVD::DeinterlaceBuffer< T >::get_frame(), CVD::glDrawPixels(), CVD::glReadPixels(), CVD::glTexImage2D(), CVD::glTexSubImage2D(), CVD::haar2D(), CVD::halfSample(), CVD::SubImage< CVD::Rgb< unsigned char > >::pos(), CVD::V4L1Buffer< T >::put_frame(), CVD::DeinterlaceBuffer< T >::put_frame(), and CVD::stats().
T* CVD::SubImage< T >::data | ( | ) | [inline] |
iterator CVD::SubImage< T >::begin | ( | ) | [inline] |
Returns an iterator referencing the first (top-left) pixel in the image.
Reimplemented in CVD::BasicImage< T >, CVD::BasicImage< unsigned char >, CVD::BasicImage< CVD::Rgb8 >, and CVD::BasicImage< CVD::Rgb< unsigned char > >.
Definition at line 356 of file image.h.
Referenced by CVD::Image< CVD::Rgb< unsigned char > >::copy_from().
const_iterator CVD::SubImage< T >::begin | ( | ) | const [inline] |
Returns a const iterator referencing the first (top-left) pixel in the image.
Reimplemented in CVD::BasicImage< T >, CVD::BasicImage< unsigned char >, CVD::BasicImage< CVD::Rgb8 >, and CVD::BasicImage< CVD::Rgb< unsigned char > >.
iterator CVD::SubImage< T >::end | ( | ) | [inline] |
Returns an iterator pointing to one past the end of the image.
Reimplemented in CVD::BasicImage< T >, CVD::BasicImage< unsigned char >, CVD::BasicImage< CVD::Rgb8 >, and CVD::BasicImage< CVD::Rgb< unsigned char > >.
Definition at line 367 of file image.h.
Referenced by CVD::Image< CVD::Rgb< unsigned char > >::copy_from().
const_iterator CVD::SubImage< T >::end | ( | ) | const [inline] |
Returns a const iterator pointing to one past the end of the image.
Reimplemented in CVD::BasicImage< T >, CVD::BasicImage< unsigned char >, CVD::BasicImage< CVD::Rgb8 >, and CVD::BasicImage< CVD::Rgb< unsigned char > >.
SubImageIteratorEnd<T> CVD::SubImage< T >::fastend | ( | ) | [inline] |
ConstSubImageIteratorEnd<T> CVD::SubImage< T >::fastend | ( | ) | const [inline] |
Returns an object corresponding to end() const, which should eliminate a test.
ImageRef CVD::SubImage< T >::size | ( | ) | const [inline] |
What is the size of this image?
Definition at line 396 of file image.h.
Referenced by CVD::SubImage< CVD::Rgb< unsigned char > >::begin(), CVD::combineImages(), CVD::ConvertImage< From, To, Conv, both_pod >::convert(), CVD::convert_image(), CVD::convert_image_pair(), CVD::convolve_gaussian_3(), CVD::convolveGaussian(), CVD::convolveGaussian5_1(), CVD::convolveSeparableSymmetric(), CVD::convolveSymmetric(), CVD::convolveWithBox(), CVD::copy(), CVD::Image< CVD::Rgb< unsigned char > >::copy_from(), CVD::dense_tensor_vote_gradients(), CVD::DiskBuffer2< T >::DiskBuffer2(), CVD::drawLine(), CVD::flipVertical(), CVD::ServerPushJpegBuffer< C >::get_frame(), CVD::glDrawPixels(), CVD::glReadPixels(), CVD::glTexImage2D(), CVD::glTexSubImage2D(), CVD::gradient(), CVD::Gradient< S, T, 1, 2 >::gradient(), CVD::haar2D(), CVD::halfSample(), CVD::harris_corner_detect(), CVD::harrislike_corner_detect(), CVD::integral_image(), CVD::interpolate_extremum(), CVD::interpolate_extremum_value(), CVD::joinImages(), CVD::median_filter_3x3(), CVD::output_eps_header(), CVD::sample(), CVD::shitomasi_corner_detect(), CVD::transform(), and CVD::zeroBorders().
int CVD::SubImage< T >::row_stride | ( | ) | const [inline] |
What is the row stride of the image?
Definition at line 402 of file image.h.
Referenced by CVD::dense_tensor_vote_gradients(), CVD::glDrawPixels(), CVD::glTexImage2D(), CVD::glTexSubImage2D(), CVD::haar2D(), and CVD::median_filter_3x3().
int CVD::SubImage< T >::totalsize | ( | ) | const [inline] |
What is the total number of elements in the image (i.e. size().x * size().y
), including padding.
Definition at line 408 of file image.h.
Referenced by CVD::ConvertImage< T, T, Pixel::GenericConversion< T, T >, 1 >::convert(), CVD::convolve_gaussian_3(), CVD::copy(), CVD::halfSample(), CVD::Image< CVD::Rgb< unsigned char > >::Image(), CVD::stats(), and CVD::SubImage< CVD::Rgb< unsigned char > >::zero().
void CVD::SubImage< T >::zero | ( | ) | [inline] |
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 421 of file image.h.
Referenced by CVD::Image< CVD::Rgb< unsigned char > >::Image(), and CVD::Image< CVD::Rgb< unsigned char > >::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] |
SubImage& CVD::SubImage< T >::ref | ( | ) | [inline] |
T* CVD::SubImage< T >::end_ptr | ( | ) | [inline, protected] |
Return an off-the-end pointer without ever throwing AccessOutsideImage.
Definition at line 471 of file image.h.
Referenced by CVD::SubImage< CVD::Rgb< unsigned char > >::begin(), and CVD::SubImage< CVD::Rgb< unsigned char > >::end().
const T* CVD::SubImage< T >::end_ptr | ( | ) | const [inline, protected] |
T* CVD::SubImage< T >::my_data [protected] |
The raw image data.
Definition at line 466 of file image.h.
Referenced by CVD::SubImage< CVD::Rgb< unsigned char > >::data(), CVD::SubImage< CVD::Rgb< unsigned char > >::end_ptr(), CVD::Image< CVD::Rgb< unsigned char > >::Image(), CVD::BasicImage< CVD::Rgb< unsigned char > >::operator=(), CVD::SubImage< CVD::Rgb< unsigned char > >::operator[](), CVD::SubImage< CVD::Rgb< unsigned char > >::sub_image(), CVD::SubImage< CVD::Rgb< unsigned char > >::SubImage(), CVD::SubImage< CVD::Rgb< unsigned char > >::zero(), and CVD::DVFrame::~DVFrame().
ImageRef CVD::SubImage< T >::my_size [protected] |
The size of the image.
Definition at line 467 of file image.h.
Referenced by CVD::SubImage< CVD::Rgb< unsigned char > >::end_ptr(), CVD::SubImage< CVD::Rgb< unsigned char > >::fill(), CVD::Image< CVD::Rgb< unsigned char > >::Image(), CVD::SubImage< CVD::Rgb< unsigned char > >::in_image(), CVD::SubImage< CVD::Rgb< unsigned char > >::in_image_with_border(), CVD::BasicImage< CVD::Rgb< unsigned char > >::operator=(), CVD::SubImage< CVD::Rgb< unsigned char > >::pos(), CVD::SubImage< CVD::Rgb< unsigned char > >::size(), CVD::SubImage< CVD::Rgb< unsigned char > >::SubImage(), and CVD::SubImage< CVD::Rgb< unsigned char > >::totalsize().
int CVD::SubImage< T >::my_stride [protected] |
The row stride.
Definition at line 468 of file image.h.
Referenced by CVD::SubImage< CVD::Rgb< unsigned char > >::begin(), CVD::SubImage< CVD::Rgb< unsigned char > >::end_ptr(), CVD::Image< CVD::Rgb< unsigned char > >::Image(), CVD::BasicImage< CVD::Rgb< unsigned char > >::operator=(), CVD::SubImage< CVD::Rgb< unsigned char > >::operator[](), CVD::SubImage< CVD::Rgb< unsigned char > >::pos(), CVD::SubImage< CVD::Rgb< unsigned char > >::row_stride(), CVD::SubImage< CVD::Rgb< unsigned char > >::sub_image(), CVD::SubImage< CVD::Rgb< unsigned char > >::SubImage(), and CVD::SubImage< CVD::Rgb< unsigned char > >::totalsize().