Wavelet and Image class library  1.3.2
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
WaveletTransform Class Reference

#include <WaveletTransform.hh>

Inheritance diagram for WaveletTransform:
Inheritance graph
[legend]
Collaboration diagram for WaveletTransform:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 WaveletTransform (Image &img, FilterSet &fil)
virtual ~WaveletTransform (void)
virtual void analysis (int steps)
virtual void synthesis (int steps, int prevSteps=0)
void expandImage (void)
void restoreImage (void)
virtual void where (area what, int subband, int &yoffs, int &xoffs, int &ysize, int &xsize) const
virtual void where (int ypos, int xpos, int &subband, area &channel, int steps=-1) const
virtual void mapPosition (int yOld, int xOld, int toSubband, area toChannel, int &yNew, int &xNew, int &sizeFactor, int steps=-1) const
virtual coeff saverage (int subband, area channel) const
virtual coeff aaverage (int subband, area channel) const
virtual coeff sqvariance (int subband, area channel) const
virtual coeff variance (int subband, area channel, bool abs=false) const
virtual coeff sdeviation (int subband, area channel, bool abs=false) const
virtual coeff ratio (int subband1, int subband2)
Imagell (int steps=-1)
Imagehl (int steps=-1)
Imagelh (int steps=-1)
Imagehh (int steps=-1)
ImagehighMax (int steps=-1)
Imageimage (void) const
virtual Imagesubband (area what, int steps=-1)
virtual int getSubband (int ypos, int xpos, int steps=-1)
int getSubband (CoeffInformation &c, int steps=-1)
virtual area getArea (int ypos, int xpos, int steps=-1)
area getArea (CoeffInformation &c, int steps=-1)
virtual void import (Image &img, area what, int steps=-1)
virtual void fill (coeff value, area what, int steps=-1)
int steps (void) const

Protected Member Functions

virtual void doanalysis (int steps)=0
virtual void dosynthesis (int steps, int prevSteps=0)=0

Protected Attributes

Waveletm_wavelet
Imagem_image
Imagem_buffer
FilterSetm_filter
int m_rows
int m_cols

Private Member Functions

void sanity (void)

Detailed Description

An abstract Wavelet Transform. The Transform transform is two-dimensional, it thus works on images.

Definition at line 26 of file WaveletTransform.hh.


Constructor & Destructor Documentation

Constructor. Initializes references to Image and Wavelet.

Parameters:
imgthe image
filthe filter set for the wavelet
virtual WaveletTransform::~WaveletTransform ( void  ) [virtual]

Destructor. Releases allocated objects.


Member Function Documentation

virtual coeff WaveletTransform::aaverage ( int  subband,
area  channel 
) const [virtual]

Return the average color for a particular area in a subband inside the image. The coefficients' signedness will be discarded. This is a shortcut to the corresponding method in the Image class.

Parameters:
subbandthe subband
channelthe area in that subband
Returns:
the average color
virtual void WaveletTransform::analysis ( int  steps) [virtual]

Perform a Wavelet transform on the image.

Exceptions:
invalid_argumentimage is not square
Parameters:
stepsthe number of transform steps
virtual void WaveletTransform::doanalysis ( int  steps) [protected, pure virtual]

Perform a Wavelet transform on the image.

Parameters:
stepsthe number of transform steps

Implemented in StandardTransform, and PyramidTransform.

virtual void WaveletTransform::dosynthesis ( int  steps,
int  prevSteps = 0 
) [protected, pure virtual]

Perform an inverse Wavelet transform on the image.

Parameters:
stepsthe number of inverse transform steps
prevStepsif greater than 0, the number of previous decomposition steps to assume. This is necessary to reconstruct images that are not square and have side lengths which are not powers of two.

Implemented in StandardTransform, and PyramidTransform.

Temporarily expand the image (square, side length a power of two) to make a transform possible.

virtual void WaveletTransform::fill ( coeff  value,
area  what,
int  steps = -1 
) [virtual]

Fill one of the subbands with one particular value.

Exceptions:
invalid_argumentthe imported image does not match the calculated subband size
Parameters:
valuethe value to be inserted
whatthe subband, out of LL, HL, LH, HH
stepsassume number of transform steps instead of those computed from the previous transforms
virtual area WaveletTransform::getArea ( int  ypos,
int  xpos,
int  steps = -1 
) [virtual]

Get the area of a given position in the image. This default method of calculation refers to the Pyramid transform and due to the lack of alternatives also to the Standard transform. Decomposition schemes using a different geometries, like e.g. the Packet transform may have to implement their own version of that method.

Parameters:
yposthe position's row
xposthe position's col
stepsthe number of steps we assume the image to have been transformed
Returns:
the position's subband
area WaveletTransform::getArea ( CoeffInformation c,
int  steps = -1 
) [inline]

Get the area of a given position in the image denoted by a {CoeffInformation} object. This default method of calculation refers to the Pyramid transform and due * to the lack of alternatives also to the Standard transform. Decomposition schemes using a different geometries, like e.g. the Packet transform may have to implement their own version of that method.

Parameters:
ca reference the {CoeffInformation} object.
stepsthe number of steps we assume the image to have been transformed
Returns:
the position's subband

Definition at line 276 of file WaveletTransform.hh.

References CoeffInformation::xpos(), and CoeffInformation::ypos().

virtual int WaveletTransform::getSubband ( int  ypos,
int  xpos,
int  steps = -1 
) [virtual]

Get the subband of a given position in the image. This default method of calculation refers to the Pyramid transform and due to the lack of alternatives also to the Standard transform. Decomposition schemes using a different geometries, like e.g. the Packet transform may have to implement their own version of that method.

Parameters:
yposthe position's row
xposthe position's col
stepsthe number of steps we assume the image to have been transformed
Returns:
the position's subband
int WaveletTransform::getSubband ( CoeffInformation c,
int  steps = -1 
) [inline]

Get the subband of a given position in the image denoted by a {CoeffInformation} object. This default method of calculation refers to the Pyramid transform and due * to the lack of alternatives also to the Standard transform. Decomposition schemes using a different geometries, like e.g. the Packet transform may have to implement their own version of that method.

Parameters:
ca reference the {CoeffInformation} object.
stepsthe number of steps we assume the image to have been transformed
Returns:
the position's subband

Definition at line 246 of file WaveletTransform.hh.

References CoeffInformation::xpos(), and CoeffInformation::ypos().

Image* WaveletTransform::hh ( int  steps = -1) [inline]

Get a subpicture containing the HH subband.

Parameters:
stepsassume number of transform steps instead of those computed from the previous transforms

Definition at line 199 of file WaveletTransform.hh.

References HH.

Image* WaveletTransform::highMax ( int  steps = -1)

Get an image consisting of the given subband's highpass components maxima.

Parameters:
stepsassume number of transform steps instead of those computed from
Returns:
a new image object containing the maxima as coefficients
Image* WaveletTransform::hl ( int  steps = -1) [inline]

Get a subpicture containing the HL subband.

Parameters:
stepsassume number of transform steps instead of those computed from the previous transforms

Definition at line 189 of file WaveletTransform.hh.

References HL.

Image& WaveletTransform::image ( void  ) const [inline]

Get a reference to the image

Returns:
the reference to the image

Definition at line 210 of file WaveletTransform.hh.

virtual void WaveletTransform::import ( Image img,
area  what,
int  steps = -1 
) [virtual]

Import a subpicture containing one of the subbands.

Exceptions:
invalid_argumentthe imported image does not match the calculated subband size
Parameters:
imgthe image containing the subband
whatthe subband, out of LL, HL, LH, HH
stepsassume number of transform steps instead of those computed from the previous transforms
Image* WaveletTransform::lh ( int  steps = -1) [inline]

Get a subpicture containing the LH subband.

Parameters:
stepsassume number of transform steps instead of those computed from the previous transforms

Definition at line 194 of file WaveletTransform.hh.

References LH.

Image* WaveletTransform::ll ( int  steps = -1) [inline]

Get a subpicture containing the LL subband.

Parameters:
stepsassume number of transform steps instead of those computed from the previous transforms

Definition at line 184 of file WaveletTransform.hh.

References LL.

virtual void WaveletTransform::mapPosition ( int  yOld,
int  xOld,
int  toSubband,
area  toChannel,
int &  yNew,
int &  xNew,
int &  sizeFactor,
int  steps = -1 
) const [virtual]

Identify channel and subband of a given position in the transformed image and map it to another subband/channel. This default method of calculation refers to the Pyramid transform and due to the lack of alternatives also to the Standard transform. Decomposition schemes using a different geometries, like e.g. the Packet transform may have to implement their own version of that method.

Parameters:
yOldthe source location's row.
xOldthe source location's column.
toSubbandthe target subband
toChannelthe target channel
yNewwhere the target location's row gets written to.
xNewwhere the target location's column gets written to.
sizeFactorwhere the target sizeFactor gets written to.
stepsthe current number of transform steps to be assumed (-1 for automatic determination)
virtual coeff WaveletTransform::ratio ( int  subband1,
int  subband2 
) [virtual]

Return the ratio resulting from the zerotree relationship between two subbands (e.g. 1:4 from subband 1 to 2). This method depends on the geometry associated with the `Pyramid' decomposition. Decomposition schemes using a different geometries, like e.g. the Packet transform may have to implement their own version of that method.

Parameters:
subband1the first subband
subband2the second subband
Returns:
the ratio, e.g. 4 for 1:4

Restore the temporarily expanded image back to original size.

void WaveletTransform::sanity ( void  ) [private]

Resize m_buffer for transforms if image dimensions have changed

virtual coeff WaveletTransform::saverage ( int  subband,
area  channel 
) const [virtual]

Return the average color for a particular area in a subband inside the image. The coefficients' signedness will be considered. This is a shortcut to the corresponding method in the Image class.

Parameters:
subbandthe subband
channelthe area in that subband
Returns:
the average color
virtual coeff WaveletTransform::sdeviation ( int  subband,
area  channel,
bool  abs = false 
) const [virtual]

Returns the standard deviation for a particular area in a subband inside the image. This is a shortcut to the corresponding method in the Image class.

Parameters:
subbandthe subband
channelthe area in that subband
abstrue if signs are discarded
Returns:
the standard deviation.
virtual coeff WaveletTransform::sqvariance ( int  subband,
area  channel 
) const [virtual]

Return the square variance for a particular area in a subband inside the image. This is a shortcut to the corresponding method in the Image class.

Parameters:
subbandthe subband
channelthe area in that subband
Returns:
the square variance
int WaveletTransform::steps ( void  ) const [inline]

Return the current number of decomposition steps

Returns:
the number of decomposition steps

Definition at line 306 of file WaveletTransform.hh.

virtual Image* WaveletTransform::subband ( area  what,
int  steps = -1 
) [virtual]

Get a subpicture containing one of the subbands.

Parameters:
whatthe subband, out of LL, HL, LH, HH
stepsassume number of transform steps instead of those computed from the previous transforms
virtual void WaveletTransform::synthesis ( int  steps,
int  prevSteps = 0 
) [virtual]

Perform an inverse Wavelet transform on the image.

Exceptions:
invalid_argumentimage is not square
Parameters:
stepsthe number of inverse transform steps
prevStepsif greater than 0, the number of previous decomposition steps to assume. This is necessary to reconstruct images that are not square and have side lengths which are not powers of two.
virtual coeff WaveletTransform::variance ( int  subband,
area  channel,
bool  abs = false 
) const [virtual]

Return the variance for a particular area in a subband inside the image. This is a shortcut to the corresponding method in the Image class.

Parameters:
subbandthe subband
channelthe area in that subband
abstrue if signs are discarded
Returns:
the square variance
virtual void WaveletTransform::where ( area  what,
int  subband,
int &  yoffs,
int &  xoffs,
int &  ysize,
int &  xsize 
) const [virtual]

Identify position and size of a given channel in a given subband. This default method of calculation refers to the Pyramid transform and due to the lack of alternatives also to the Standard transform. Decomposition schemes using a different geometries, like e.g. the Packet transform may have to implement their own version of that method.

Parameters:
whatthe channel we want
subbandthe subband we are looking at
yoffsthe returned row
xoffsthe returned col
ysizethe returned number of rows
xsizethe returned number of cols
virtual void WaveletTransform::where ( int  ypos,
int  xpos,
int &  subband,
area channel,
int  steps = -1 
) const [virtual]

Identify channel and subband of a given position in the transformed image. This method depends on the `where' method and thus uses the geometry associated with the `Pyramid' decomposition.

Parameters:
yposthe location's row.
xposthe location's column.
subbandwhere the calculated subband gets written to.
channelwhere the calculated channel gets written to.
stepsthe current number of transform steps to be assumed (-1 for automatic determination)

Member Data Documentation

A second image used as temporary m_buffer.

Definition at line 322 of file WaveletTransform.hh.

int WaveletTransform::m_cols [protected]

The image's number of cols before resizing

Definition at line 328 of file WaveletTransform.hh.

A reference to the filter set used.

Definition at line 324 of file WaveletTransform.hh.

A reference to the image to be used.

Definition at line 320 of file WaveletTransform.hh.

int WaveletTransform::m_rows [protected]

The image's number of rows before resizing

Definition at line 326 of file WaveletTransform.hh.

A reference to the wavelet to be used.

Definition at line 318 of file WaveletTransform.hh.


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