Wavelet and Image class library  1.3.2
Public Member Functions | Protected Member Functions | Protected Attributes
VideoArray< T > Class Template Reference

#include <VideoArray.hh>

Inheritance diagram for VideoArray< T >:
Inheritance graph
[legend]
Collaboration diagram for VideoArray< T >:
Collaboration graph
[legend]

List of all members.

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
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

Detailed Description

template<class T>
class VideoArray< T >

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.


Constructor & Destructor Documentation

template<class T>
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.

Parameters:
rowsthe vertical size
colsthe horizontal size
framesthe number of frames
template<class T>
VideoArray< T >::VideoArray ( int  rows,
int  cols,
int  frames,
const VideoArray< T > *  v 
)
template<class T>
virtual VideoArray< T >::~VideoArray ( void  ) [virtual]

Destructor. Releases allocated memory.


Member Function Documentation

template<class T>
virtual int VideoArray< T >::abs ( int  y,
int  x 
) const [inline, virtual]

Return the absolute offset of a position.

Parameters:
ythe position's row
xthe position's col
Returns:
the absolute offset

Reimplemented from ImageArray< T >.

Definition at line 93 of file VideoArray.hh.

Referenced by VideoArray< coeff >::at(), and VideoArray< coeff >::to().

template<class T>
T VideoArray< T >::at ( int  y,
int  x 
) const [inline]

Returns the value at (x,y).

Parameters:
ythe row
xthe col
Returns:
the value

Reimplemented from ImageArray< T >.

Definition at line 63 of file VideoArray.hh.

template<class T>
virtual T VideoArray< T >::at ( int  abs) const [inline, virtual]

Returns the current frame's {n}th value.

Parameters:
absthe offset from the array start
Returns:
the value

Reimplemented from ImageArray< T >.

Definition at line 69 of file VideoArray.hh.

template<class T>
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.

Returns:
the new object

Reimplemented from ImageArray< T >.

template<class 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.

Returns:
the new object
template<class T>
virtual void VideoArray< T >::copy ( ImageArray< T > &  ia) [virtual]

Copy from a different array. This includes resizing and reframing if necessary.

Exceptions:
invalid_argumentif the other object is not a VideoArray.
Parameters:
iathe other array

Reimplemented from ImageArray< T >.

template<class T>
void VideoArray< T >::current ( int  frame)

Sets the current frame. Valid values are 0..n-1.

Parameters:
framethe current frame
Exceptions:
invalid_argumentthe new frame is out of bounds
template<class T>
int VideoArray< T >::current ( void  ) [inline]

Returns the number of the current frame. Counting starts from zero.

Returns:
the number of the current frame.

Definition at line 49 of file VideoArray.hh.

template<class T>
virtual bool VideoArray< T >::epsilons ( ImageArray< T > &  ia,
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.

Parameters:
iathe other {ImageArray} object
epsilonthe epsilon
Returns:
if both are identical: {true}, else {false}

Reimplemented from ImageArray< T >.

template<class T>
bool VideoArray< T >::epsilonsFrames ( int  f1,
int  f2,
epsilon 
) const

Rough comparison. See if this and another frame are similar according to a given {epsilon} (important for floating-point comparisons).

Exceptions:
invalid_argumentone of the frames is out of bounds
Parameters:
f1the first frame
f2the second frame
epsilonthe epsilon
Returns:
if both are identical: {true}, else {false}
template<class T>
bool VideoArray< T >::epsilonsVideo ( VideoArray< T > &  va,
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()'.

Parameters:
vathe other {ImageArray} object
epsilonthe epsilon
Returns:
if both are identical: {true}, else {false}
template<class T>
bool VideoArray< T >::equalsFrames ( int  f1,
int  f2 
) const

Exact comparison. See if two frames are similar.

Exceptions:
invalid_argumentone of the frames is out of bounds
Parameters:
f1the first frame
f2the second frame if both are identical: {true}, else {false}
template<class T>
int VideoArray< T >::frames ( void  ) const [inline]

Returns the number of frames

Returns:
the number of frames

Definition at line 54 of file VideoArray.hh.

template<class T>
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.

Parameters:
rowsthe new number of rows
colsthe new number of cols
framesthe new number of frames
arraythe new array
template<class T>
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.

Parameters:
rowsthe new number of rows
colsthe new number of cols
arraythe new array
Exceptions:
invalid_argumentalways

Reimplemented from ImageArray< T >.

template<class 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.

Exceptions:
invalid_argumentthe new number of frames is either negative or zero
Parameters:
framesthe new number of frames.
keepheadif shrinking the video, frames will be deleted at the end.
template<class T>
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.

Exceptions:
invalid_argumentone or both dimensions are either negative or zero
Parameters:
rowsthe new number of rows
colsthe new number of cols

Reimplemented from ImageArray< T >.

template<class T>
void VideoArray< T >::to ( int  y,
int  x,
val 
) [inline]

Sets the value at (x,y).

Parameters:
ythe row
xthe col
valthe value

Reimplemented from ImageArray< T >.

Definition at line 79 of file VideoArray.hh.

template<class T>
virtual void VideoArray< T >::to ( int  abs,
val 
) [inline, virtual]

Sets the array's {n}th value.

Parameters:
absthe offset from the array start
valthe value

Reimplemented from ImageArray< T >.

Definition at line 85 of file VideoArray.hh.


Member Data Documentation

template<class T>
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().

template<class T>
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().

template<class T>
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().

template<class T>
int VideoArray< T >::m_xyzsize [protected]

The video's total size.

Definition at line 194 of file VideoArray.hh.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines