libpgf  6.12.24
PGF - Progressive Graphics File
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CWaveletTransform Class Reference

#include <WaveletTransform.h>

Public Member Functions

*Destructor * ~CWaveletTransform ()
 
*Compute fast forward wavelet
transform of LL subband at
given level and *stores result
on all subbands of level
*param level A wavelet
transform pyramid 
level (>=0 &&< Levels())*@param quant A quantization value(linear scalar quantization)*@return error in case of a memory allocation problem */OSError ForwardTransform(int level
 
*Compute fast inverse wavelet
transform of all subbands of
given level and *stores result
in LL subband of level *param
level A wavelet transform
pyramid 
level (> 0 &&<=Levels())*@param width A pointer to the returned width of subband LL(in pixels)*@param height A pointer to the returned height of subband LL(in pixels)*@param data A pointer to the returned array of image data *@return error in case of a memory allocation problem */OSError InverseTransform(int level
 
*Get pointer to one of the
subband at a given level
*param level A wavelet
transform pyramid 
level (>=0 &&<=Levels())*@param orientation A quarter of the subband(LL
 
*Get pointer to one of the
subband at a given level
*param level A wavelet
transform pyramid HH *CSubband
GetSubband (int level, Orientation orientation)
 

Public Attributes

Constructor: Constructs a wavelet transform pyramid of given size and levels. * @param width The width of the original image (at level 0) in pixels * @param height The height of the original image (at level 0) in pixels * @param levels The number of levels (>= 0) * @param data Input data of subband LL at level 0 */ CWaveletTransform(UINT32 width
 
UINT32 height
 
UINT32 int levels
 
UINT32 int DataTdata = NULL)
 
*Compute fast forward wavelet
transform of LL subband at
given level and *stores result
on all subbands of level
*param level A wavelet
transform pyramid int 
quant
 
*Compute fast inverse wavelet
transform of all subbands of
given level and *stores result
in LL subband of level *param
level A wavelet transform
pyramid UINT32 * 
width
 
*Compute fast inverse wavelet
transform of all subbands of
given level and *stores result
in LL subband of level *param
level A wavelet transform
pyramid UINT32 UINT32 * 
height
 
*Compute fast inverse wavelet
transform of all subbands of
given level and *stores result
in LL subband of level *param
level A wavelet transform
pyramid UINT32 UINT32 DataT ** 
data
 
*Get pointer to one of the
subband at a given level
*param level A wavelet
transform pyramid 
LH
 
*Get pointer to one of the
subband at a given level
*param level A wavelet
transform pyramid 
HL
 

Private Member Functions

void Destroy ()
 
void InitSubbands (UINT32 width, UINT32 height, DataT *data)
 
void ForwardRow (DataT *buff, UINT32 width)
 
void InverseRow (DataT *buff, UINT32 width)
 
void LinearToMallat (int destLevel, DataT *loRow, DataT *hiRow, UINT32 width)
 
void MallatToLinear (int srcLevel, DataT *loRow, DataT *hiRow, UINT32 width)
 

Private Attributes

int m_nLevels
 number of transform levels: one more than the number of level in PGFimage
 
CSubband(* m_subband )[NSubbands]
 quadtree of subbands: LL HL LH HH
 

Friends

class CSubband
 

Detailed Description

Definition at line 84 of file WaveletTransform.h.

Constructor & Destructor Documentation

* Destructor* CWaveletTransform::~CWaveletTransform ( )
inline

Definition at line 98 of file WaveletTransform.h.

{ Destroy(); }

Member Function Documentation

void CWaveletTransform::Destroy ( )
inlineprivate

Definition at line 151 of file WaveletTransform.h.

{
delete[] m_subband; m_subband = 0;
#ifdef __PGFROISUPPORT__
m_ROIindices.Destroy();
#endif
}
void CWaveletTransform::ForwardRow ( DataT buff,
UINT32  width 
)
private

Definition at line 181 of file WaveletTransform.cpp.

{
if (width >= FilterWidth) {
UINT32 i = 3;
// left border handling
src[1] -= ((src[0] + src[2] + c1) >> 1);
src[0] += ((src[1] + c1) >> 1);
// middle part
for (; i < width-1; i += 2) {
src[i] -= ((src[i-1] + src[i+1] + c1) >> 1);
src[i-1] += ((src[i-2] + src[i] + c2) >> 2);
}
// right border handling
if (width & 1) {
src[i-1] += ((src[i-2] + c1) >> 1);
} else {
src[i] -= src[i-1];
src[i-1] += ((src[i-2] + src[i] + c2) >> 2);
}
}
}
* Get pointer to one of the subband at a given level* param level A wavelet transform pyramid HH* CSubband* CWaveletTransform::GetSubband ( int  level,
Orientation  orientation 
)
inline

Definition at line 122 of file WaveletTransform.h.

{
return &m_subband[level][orientation];
}
void CWaveletTransform::InitSubbands ( UINT32  width,
UINT32  height,
DataT data 
)
private

Definition at line 53 of file WaveletTransform.cpp.

{
// create subbands
// init subbands
UINT32 loWidth = width;
UINT32 hiWidth = width;
UINT32 loHeight = height;
UINT32 hiHeight = height;
for (int level = 0; level < m_nLevels; level++) {
m_subband[level][LL].Initialize(loWidth, loHeight, level, LL); // LL
m_subband[level][HL].Initialize(hiWidth, loHeight, level, HL); // HL
m_subband[level][LH].Initialize(loWidth, hiHeight, level, LH); // LH
m_subband[level][HH].Initialize(hiWidth, hiHeight, level, HH); // HH
hiWidth = loWidth >> 1; hiHeight = loHeight >> 1;
loWidth = (loWidth + 1) >> 1; loHeight = (loHeight + 1) >> 1;
}
if (data) {
}
}
void CWaveletTransform::InverseRow ( DataT buff,
UINT32  width 
)
private

Definition at line 367 of file WaveletTransform.cpp.

{
if (width >= FilterWidth) {
UINT32 i = 2;
// left border handling
dest[0] -= ((dest[1] + c1) >> 1);
// middle part
for (; i < width - 1; i += 2) {
dest[i] -= ((dest[i-1] + dest[i+1] + c2) >> 2);
dest[i-1] += ((dest[i-2] + dest[i] + c1) >> 1);
}
// right border handling
if (width & 1) {
dest[i] -= ((dest[i-1] + c1) >> 1);
dest[i-1] += ((dest[i-2] + dest[i] + c1) >> 1);
} else {
dest[i-1] += dest[i-2];
}
}
}
* Compute fast forward wavelet transform of LL subband at given level and* stores result on all subbands of level* param level A wavelet transform pyramid CWaveletTransform::level ( )
* Compute fast inverse wavelet transform of all subbands of given level and* stores result in LL subband of level* param level A wavelet transform pyramid CWaveletTransform::level ( 0 &&<=  Levels())
* Get pointer to one of the subband at a given level* param level A wavelet transform pyramid CWaveletTransform::level ( >=0 &&<=  Levels())
void CWaveletTransform::LinearToMallat ( int  destLevel,
DataT loRow,
DataT hiRow,
UINT32  width 
)
private

Definition at line 207 of file WaveletTransform.cpp.

{
const UINT32 wquot = width >> 1;
const bool wrem = width & 1;
CSubband &ll = m_subband[destLevel][LL], &hl = m_subband[destLevel][HL];
CSubband &lh = m_subband[destLevel][LH], &hh = m_subband[destLevel][HH];
if (hiRow) {
for (UINT32 i=0; i < wquot; i++) {
ll.WriteBuffer(*loRow++); // first access, than increment
hl.WriteBuffer(*loRow++);
lh.WriteBuffer(*hiRow++); // first access, than increment
hh.WriteBuffer(*hiRow++);
}
if (wrem) {
ll.WriteBuffer(*loRow);
lh.WriteBuffer(*hiRow);
}
} else {
for (UINT32 i=0; i < wquot; i++) {
ll.WriteBuffer(*loRow++); // first access, than increment
hl.WriteBuffer(*loRow++);
}
if (wrem) ll.WriteBuffer(*loRow);
}
}
void CWaveletTransform::MallatToLinear ( int  srcLevel,
DataT loRow,
DataT hiRow,
UINT32  width 
)
private

Definition at line 392 of file WaveletTransform.cpp.

{
const UINT32 wquot = width >> 1;
const bool wrem = width & 1;
CSubband &ll = m_subband[srcLevel][LL], &hl = m_subband[srcLevel][HL];
CSubband &lh = m_subband[srcLevel][LH], &hh = m_subband[srcLevel][HH];
if (hiRow) {
#ifdef __PGFROISUPPORT__
const bool storePos = wquot < ll.BufferWidth();
UINT32 llPos = 0, hlPos = 0, lhPos = 0, hhPos = 0;
if (storePos) {
// save current src buffer positions
llPos = ll.GetBuffPos();
hlPos = hl.GetBuffPos();
lhPos = lh.GetBuffPos();
hhPos = hh.GetBuffPos();
}
#endif
for (UINT32 i=0; i < wquot; i++) {
*loRow++ = ll.ReadBuffer();// first access, than increment
*loRow++ = hl.ReadBuffer();// first access, than increment
*hiRow++ = lh.ReadBuffer();// first access, than increment
*hiRow++ = hh.ReadBuffer();// first access, than increment
}
if (wrem) {
*loRow++ = ll.ReadBuffer();// first access, than increment
*hiRow++ = lh.ReadBuffer();// first access, than increment
}
#ifdef __PGFROISUPPORT__
if (storePos) {
// increment src buffer positions
ll.IncBuffRow(llPos);
hl.IncBuffRow(hlPos);
lh.IncBuffRow(lhPos);
hh.IncBuffRow(hhPos);
}
#endif
} else {
#ifdef __PGFROISUPPORT__
const bool storePos = wquot < ll.BufferWidth();
UINT32 llPos = 0, hlPos = 0;
if (storePos) {
// save current src buffer positions
llPos = ll.GetBuffPos();
hlPos = hl.GetBuffPos();
}
#endif
for (UINT32 i=0; i < wquot; i++) {
*loRow++ = ll.ReadBuffer();// first access, than increment
*loRow++ = hl.ReadBuffer();// first access, than increment
}
if (wrem) *loRow++ = ll.ReadBuffer();
#ifdef __PGFROISUPPORT__
if (storePos) {
// increment src buffer positions
ll.IncBuffRow(llPos);
hl.IncBuffRow(hlPos);
}
#endif
}
}

Friends And Related Function Documentation

friend class CSubband
friend

Definition at line 85 of file WaveletTransform.h.

Member Data Documentation

* CWaveletTransform::Constructor

Definition at line 94 of file WaveletTransform.h.

UINT32 int DataT* CWaveletTransform::data = NULL)

Definition at line 94 of file WaveletTransform.h.

* Compute fast inverse wavelet transform of all subbands of given level and* stores result in LL subband of level* param level A wavelet transform pyramid UINT32 UINT32 DataT** CWaveletTransform::data

Definition at line 116 of file WaveletTransform.h.

UINT32 CWaveletTransform::height

Definition at line 94 of file WaveletTransform.h.

* Compute fast inverse wavelet transform of all subbands of given level and* stores result in LL subband of level* param level A wavelet transform pyramid UINT32 UINT32* CWaveletTransform::height

Definition at line 116 of file WaveletTransform.h.

* Get pointer to one of the subband at a given level* param level A wavelet transform pyramid CWaveletTransform::HL

Definition at line 121 of file WaveletTransform.h.

UINT32 int CWaveletTransform::levels

Definition at line 94 of file WaveletTransform.h.

* Get pointer to one of the subband at a given level* param level A wavelet transform pyramid CWaveletTransform::LH

Definition at line 121 of file WaveletTransform.h.

int CWaveletTransform::m_nLevels
private

number of transform levels: one more than the number of level in PGFimage

Definition at line 167 of file WaveletTransform.h.

CSubband(* CWaveletTransform::m_subband)[NSubbands]
private

quadtree of subbands: LL HL LH HH

Definition at line 168 of file WaveletTransform.h.

* Compute fast forward wavelet transform of LL subband at given level and* stores result on all subbands of level* param level A wavelet transform pyramid int CWaveletTransform::quant

Definition at line 106 of file WaveletTransform.h.

* Compute fast inverse wavelet transform of all subbands of given level and* stores result in LL subband of level* param level A wavelet transform pyramid UINT32* CWaveletTransform::width

Definition at line 116 of file WaveletTransform.h.


The documentation for this class was generated from the following files: