|
Wavelet and Image class library
1.3.2
|
#include <ImageArray.hh>


Public Member Functions | |
| ImageArray (void) | |
| ImageArray (int rows, int cols) | |
| virtual | ~ImageArray (void) |
| int | rows (void) const |
| int | cols (void) const |
| int | size (void) const |
| T | at (int y, int x) const |
| virtual T | at (int abs) const |
| void | to (int y, int x, T val) |
| virtual void | to (int abs, T val) |
| virtual int | abs (int y, int x) const |
| T | smax (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const |
| T | smin (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const |
| T | amax (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const |
| T | amin (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const |
| T | saverage (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const |
| T | aaverage (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const |
| virtual void | resize (int rows, int cols) |
| virtual void | import (int rows, int cols, T *array) |
| virtual ImageArray< T > * | clone (void) const |
| virtual void | copy (ImageArray< T > &ia) |
| void | copy (ImageArray< T > *ia) |
| virtual bool | epsilons (ImageArray< T > &ia, T epsilon) const |
| bool | epsilons (ImageArray< T > *ia, T epsilon) const |
| bool | equals (ImageArray< T > &ia) const |
| bool | equals (ImageArray< T > *ia) const |
| T *& | array (void) |
Protected Member Functions | |
| virtual void | updateRowsArray (void) |
Protected Attributes | |
| int | m_xsize |
| int | m_ysize |
| int | m_xysize |
| T * | m_ar |
| int * | m_rows |
A two-dimensional array wrapper. This allows us to access the image's pixels or coefficients and provides some utility methods. It is the main working horse for the Image framework.
Definition at line 23 of file ImageArray.hh.
| ImageArray< T >::ImageArray | ( | void | ) |
Constructor. Sets the dimension to zero.
| ImageArray< T >::ImageArray | ( | int | rows, |
| int | cols | ||
| ) |
Constructor. Sets the dimension and allocates space. A size of zero is allowed, negative values not.
| rows | the vertical size |
| cols | the horizontal size |
| virtual ImageArray< T >::~ImageArray | ( | void | ) | [virtual] |
Destructor. Releases allocated memory.
| T ImageArray< T >::aaverage | ( | int | fromY = 0, |
| int | fromX = 0, |
||
| int | toY = -1, |
||
| int | toX = -1 |
||
| ) | const |
Return the average color for a rectangular region inside the image drawn from one point within and the second point just outside the region. The coefficients' signedness will be discarded.
| fromY | the first point's row |
| fromX | the first point's col |
| toY | the second point's row (-1 if lower image border) |
| toX | the second point's col (-1 if right image border) |
Referenced by StillImage::aaverage().
| virtual int ImageArray< T >::abs | ( | int | y, |
| int | x | ||
| ) | const [inline, virtual] |
Return the absolute offset of a position.
| y | the position's row |
| x | the position's col |
Reimplemented in VideoArray< T >, and VideoArray< coeff >.
Definition at line 89 of file ImageArray.hh.
Referenced by StillImage::abs(), ImageArray< coeff >::at(), and ImageArray< coeff >::to().
| T ImageArray< T >::amax | ( | int | fromY = 0, |
| int | fromX = 0, |
||
| int | toY = -1, |
||
| int | toX = -1 |
||
| ) | const |
Returns the maximum absolute value in a region. Signs will be discarded.
| fromY | the first point's row |
| fromX | the first point's col |
| toY | the second point's row (-1 if lower image border) |
| toX | the second point's col (-1 if right image border) |
Referenced by StillImage::amax().
| T ImageArray< T >::amin | ( | int | fromY = 0, |
| int | fromX = 0, |
||
| int | toY = -1, |
||
| int | toX = -1 |
||
| ) | const |
Returns the minimum absolute value in a region. Signs will be discarded.
| fromY | the first point's row |
| fromX | the first point's col |
| toY | the second point's row (-1 if lower image border) |
| toX | the second point's col (-1 if right image border) |
Referenced by StillImage::amin().
| T*& ImageArray< T >::array | ( | void | ) | [inline] |
Physical access to the array. This is dangerous but necessary for performance reasons because we sometimes need to fill the array with more than one value at a time.
Definition at line 212 of file ImageArray.hh.
| T ImageArray< T >::at | ( | int | y, |
| int | x | ||
| ) | const [inline] |
Returns the value at (x,y).
| y | the row |
| x | the col |
Reimplemented in VideoArray< T >, and VideoArray< coeff >.
Definition at line 59 of file ImageArray.hh.
Referenced by StillImage::at().
| virtual T ImageArray< T >::at | ( | int | abs | ) | const [inline, virtual] |
Returns the array's {n}th value.
| abs | the offset from the array start |
Reimplemented in VideoArray< T >, and VideoArray< coeff >.
Definition at line 66 of file ImageArray.hh.
| virtual ImageArray<T>* ImageArray< T >::clone | ( | void | ) | const [virtual] |
Create a copy. All values will be duplicated rather than the references.
Reimplemented in VideoArray< T >, and VideoArray< coeff >.
| int ImageArray< T >::cols | ( | void | ) | const [inline] |
Returns the horizontal size.
Definition at line 47 of file ImageArray.hh.
| virtual void ImageArray< T >::copy | ( | ImageArray< T > & | ia | ) | [virtual] |
Copy from a different array.
| ia | the other array |
Reimplemented in VideoArray< T >, and VideoArray< coeff >.
| void ImageArray< T >::copy | ( | ImageArray< T > * | ia | ) | [inline] |
Copy from a different array.
| ia | the other array |
Definition at line 173 of file ImageArray.hh.
Referenced by ImageArray< coeff >::copy().
| virtual bool ImageArray< T >::epsilons | ( | ImageArray< T > & | ia, |
| T | epsilon | ||
| ) | const [virtual] |
Rough comparison. See if two arrays are similar according to a given {epsilon} (important for floating-point comparisons).
| ia | the other {ImageArray} object |
| epsilon | the epsilon |
Reimplemented in VideoArray< T >, and VideoArray< coeff >.
Referenced by ImageArray< coeff >::equals().
| bool ImageArray< T >::epsilons | ( | ImageArray< T > * | ia, |
| T | epsilon | ||
| ) | const [inline] |
Rough comparison. See if two arrays are similar according to a given {epsilon} (important for floating-point comparisons).
| ia | the other {ImageArray} object |
| epsilon | the epsilon |
Definition at line 191 of file ImageArray.hh.
Referenced by ImageArray< coeff >::epsilons().
| bool ImageArray< T >::equals | ( | ImageArray< T > & | ia | ) | const [inline] |
Exact comparison. See if two arrays are similar.
| ia | the other {ImageArray} object |
Definition at line 198 of file ImageArray.hh.
| bool ImageArray< T >::equals | ( | ImageArray< T > * | ia | ) | const [inline] |
Exact comparison. See if two arrays are similar.
| ia | the other {ImageArray} object |
Definition at line 205 of file ImageArray.hh.
Referenced by ImageArray< coeff >::equals().
| virtual void ImageArray< T >::import | ( | int | rows, |
| int | cols, | ||
| T * | array | ||
| ) | [virtual] |
Import a raw array. The new dimensions and the new array will be stored discarding the old ones.
| rows | the new number of rows |
| cols | the new number of cols |
| array | the new array |
Reimplemented in VideoArray< T >, and VideoArray< coeff >.
| virtual void ImageArray< T >::resize | ( | int | rows, |
| int | cols | ||
| ) | [virtual] |
Resize the array. The old values will be copied to the new dimension as far as they fit in. The new dimensions must all be greater than zero.
| invalid_argument | one or both dimensions are either negative or zero |
| rows | the new number of rows |
| cols | the new number of cols |
Reimplemented in VideoArray< T >, and VideoArray< coeff >.
| int ImageArray< T >::rows | ( | void | ) | const [inline] |
| T ImageArray< T >::saverage | ( | int | fromY = 0, |
| int | fromX = 0, |
||
| int | toY = -1, |
||
| int | toX = -1 |
||
| ) | const |
Return the average color for a rectangular region inside the image drawn from one point within and the second point just outside the region. The coefficients' signedness will be considered.
| fromY | the first point's row |
| fromX | the first point's col |
| toY | the second point's row (-1 if lower image border) |
| toX | the second point's col (-1 if right image border) |
Referenced by StillImage::saverage().
| int ImageArray< T >::size | ( | void | ) | const [inline] |
Returns the overall size (x*y).
Definition at line 51 of file ImageArray.hh.
| T ImageArray< T >::smax | ( | int | fromY = 0, |
| int | fromX = 0, |
||
| int | toY = -1, |
||
| int | toX = -1 |
||
| ) | const |
Returns the maximum value in a region. Signs will be considered.
| fromY | the first point's row |
| fromX | the first point's col |
| toY | the second point's row (-1 if lower image border) |
| toX | the second point's col (-1 if right image border) |
Referenced by StillImage::smax().
| T ImageArray< T >::smin | ( | int | fromY = 0, |
| int | fromX = 0, |
||
| int | toY = -1, |
||
| int | toX = -1 |
||
| ) | const |
Returns the minimum value in a region. Signs will be considered.
| fromY | the first point's row |
| fromX | the first point's col |
| toY | the second point's row (-1 if lower image border) |
| toX | the second point's col (-1 if right image border) |
Referenced by StillImage::smin().
| void ImageArray< T >::to | ( | int | y, |
| int | x, | ||
| T | val | ||
| ) | [inline] |
Sets the value at (x,y).
| y | the row |
| x | the col |
| val | the value |
Reimplemented in VideoArray< T >, and VideoArray< coeff >.
Definition at line 74 of file ImageArray.hh.
Referenced by StillImage::to().
| virtual void ImageArray< T >::to | ( | int | abs, |
| T | val | ||
| ) | [inline, virtual] |
Sets the array's {n}th value.
| abs | the offset from the array start |
| val | the value |
Reimplemented in VideoArray< T >, and VideoArray< coeff >.
Definition at line 80 of file ImageArray.hh.
| virtual void ImageArray< T >::updateRowsArray | ( | void | ) | [protected, virtual] |
Allocates and sets the `m_rows' member (e.g. after a resize or in the constructor). If `m_rows' is not NULL it will be deleted first
T* ImageArray< T >::m_ar [protected] |
The actual array.
Definition at line 222 of file ImageArray.hh.
Referenced by ImageArray< coeff >::array(), ImageArray< coeff >::at(), VideoArray< coeff >::at(), ImageArray< coeff >::to(), and VideoArray< coeff >::to().
int* ImageArray< T >::m_rows [protected] |
An array holding all rows' offsets (optimizes addressing)
Definition at line 224 of file ImageArray.hh.
Referenced by ImageArray< coeff >::abs(), and VideoArray< coeff >::abs().
int ImageArray< T >::m_xsize [protected] |
The array's horizontal size.
Definition at line 216 of file ImageArray.hh.
Referenced by ImageArray< coeff >::cols().
int ImageArray< T >::m_xysize [protected] |
The array's overall size (x*y).
Definition at line 220 of file ImageArray.hh.
Referenced by ImageArray< coeff >::size().
int ImageArray< T >::m_ysize [protected] |
The array's vertical size.
Definition at line 218 of file ImageArray.hh.
Referenced by ImageArray< coeff >::rows().
1.7.6.1