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


Public Member Functions | |
| VideoArray (int rows, int cols, int frames) | |
| VideoArray (int rows, int cols, int frames, const VideoArray< T > *v) | |
| virtual | ~VideoArray (void) |
| void | current (int frame) |
| int | current (void) |
| int | frames (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 |
| bool | epsilonsFrames (int f1, int f2, T epsilon) const |
| bool | equalsFrames (int f1, int f2) const |
| virtual bool | epsilons (ImageArray< T > &ia, T epsilon) const |
| virtual void | resize (int rows, int cols) |
| virtual void | reframe (int frames, bool keephead=true) |
| virtual void | import (int rows, int cols, int frames, T *array) |
| virtual void | import (int rows, int cols, T *array) |
| virtual VideoArray< T > * | cloneVideo (void) const |
| virtual ImageArray< T > * | clone (void) const |
| virtual void | copy (ImageArray< T > &ia) |
Protected Member Functions | |
| bool | epsilonsVideo (VideoArray< T > &va, T epsilon) const |
Protected Attributes | |
| int | m_frames |
| int | m_xyzsize |
| int | m_current |
| int | m_offset |
A two-dimensional array wrapper. This allows us to access the video's pixels or coefficients and provides some utility methods. It is the main working horse for the Video framework.
Definition at line 23 of file VideoArray.hh.
| VideoArray< T >::VideoArray | ( | int | rows, |
| int | cols, | ||
| int | frames | ||
| ) |
Constructor. Sets the dimension and allocates space. A size of zero is allowed, negative values not.
| rows | the vertical size |
| cols | the horizontal size |
| frames | the number of frames |
| VideoArray< T >::VideoArray | ( | int | rows, |
| int | cols, | ||
| int | frames, | ||
| const VideoArray< T > * | v | ||
| ) |
| virtual VideoArray< T >::~VideoArray | ( | void | ) | [virtual] |
Destructor. Releases allocated memory.
| virtual int VideoArray< 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 from ImageArray< T >.
Definition at line 93 of file VideoArray.hh.
Referenced by VideoArray< coeff >::at(), and VideoArray< coeff >::to().
| T VideoArray< T >::at | ( | int | y, |
| int | x | ||
| ) | const [inline] |
Returns the value at (x,y).
| y | the row |
| x | the col |
Reimplemented from ImageArray< T >.
Definition at line 63 of file VideoArray.hh.
| virtual T VideoArray< T >::at | ( | int | abs | ) | const [inline, virtual] |
Returns the current frame's {n}th value.
| abs | the offset from the array start |
Reimplemented from ImageArray< T >.
Definition at line 69 of file VideoArray.hh.
| virtual ImageArray<T>* VideoArray< T >::clone | ( | void | ) | const [virtual] |
Create a copy of the current frame. All frames will be duplicated rather than the references.
Reimplemented from ImageArray< T >.
| virtual VideoArray<T>* VideoArray< T >::cloneVideo | ( | void | ) | const [virtual] |
Create a copy of the whole video. All frames will be duplicated rather than the references.
| virtual void VideoArray< T >::copy | ( | ImageArray< T > & | ia | ) | [virtual] |
Copy from a different array. This includes resizing and reframing if necessary.
| invalid_argument | if the other object is not a VideoArray. |
| ia | the other array |
Reimplemented from ImageArray< T >.
| void VideoArray< T >::current | ( | int | frame | ) |
Sets the current frame. Valid values are 0..n-1.
| frame | the current frame |
| invalid_argument | the new frame is out of bounds |
| int VideoArray< T >::current | ( | void | ) | [inline] |
Returns the number of the current frame. Counting starts from zero.
Definition at line 49 of file VideoArray.hh.
| virtual bool VideoArray< T >::epsilons | ( | ImageArray< T > & | ia, |
| T | epsilon | ||
| ) | const [virtual] |
Rough comparison. See if this and another video or the current and another frame are similar according to a given {epsilon} (important for floating-point comparisons). Whether the argument will be treated as a video or a frame depends on its type.
| ia | the other {ImageArray} object |
| epsilon | the epsilon |
Reimplemented from ImageArray< T >.
| bool VideoArray< T >::epsilonsFrames | ( | int | f1, |
| int | f2, | ||
| T | epsilon | ||
| ) | const |
Rough comparison. See if this and another frame are similar according to a given {epsilon} (important for floating-point comparisons).
| invalid_argument | one of the frames is out of bounds |
| f1 | the first frame |
| f2 | the second frame |
| epsilon | the epsilon |
| bool VideoArray< T >::epsilonsVideo | ( | VideoArray< T > & | va, |
| T | epsilon | ||
| ) | const [protected] |
Rough comparison. See if this and another video are similar according to a given {epsilon} (important for floating-point comparisons). Called by `epsilons()'.
| va | the other {ImageArray} object |
| epsilon | the epsilon |
| bool VideoArray< T >::equalsFrames | ( | int | f1, |
| int | f2 | ||
| ) | const |
Exact comparison. See if two frames are similar.
| invalid_argument | one of the frames is out of bounds |
| f1 | the first frame |
| f2 | the second frame if both are identical: {true}, else {false} |
| int VideoArray< T >::frames | ( | void | ) | const [inline] |
Returns the number of frames
Definition at line 54 of file VideoArray.hh.
| virtual void VideoArray< T >::import | ( | int | rows, |
| int | cols, | ||
| int | frames, | ||
| 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 |
| frames | the new number of frames |
| array | the new array |
| virtual void VideoArray< T >::import | ( | int | rows, |
| int | cols, | ||
| T * | array | ||
| ) | [virtual] |
This method cannot be used on videos and will throw an invalid_argument.
| rows | the new number of rows |
| cols | the new number of cols |
| array | the new array |
| invalid_argument | always |
Reimplemented from ImageArray< T >.
| virtual void VideoArray< T >::reframe | ( | int | frames, |
| bool | keephead = true |
||
| ) | [virtual] |
Sets new number of frames. The old frames will be copied to the new ones as far as they fit in. The new number must be greater than zero.
| invalid_argument | the new number of frames is either negative or zero |
| frames | the new number of frames. |
| keephead | if shrinking the video, frames will be deleted at the end. |
| virtual void VideoArray< 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 from ImageArray< T >.
| void VideoArray< 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 from ImageArray< T >.
Definition at line 79 of file VideoArray.hh.
| virtual void VideoArray< 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 from ImageArray< T >.
Definition at line 85 of file VideoArray.hh.
int VideoArray< T >::m_current [protected] |
The video's current frame number.
Definition at line 196 of file VideoArray.hh.
Referenced by VideoArray< coeff >::current().
int VideoArray< T >::m_frames [protected] |
The video's number of frames.
Definition at line 192 of file VideoArray.hh.
Referenced by VideoArray< coeff >::frames().
int VideoArray< T >::m_offset [protected] |
The offset in the array to the current frame.
Definition at line 198 of file VideoArray.hh.
Referenced by VideoArray< coeff >::abs(), VideoArray< coeff >::at(), and VideoArray< coeff >::to().
int VideoArray< T >::m_xyzsize [protected] |
The video's total size.
Definition at line 194 of file VideoArray.hh.
1.7.6.1