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

#include <Subband.h>

Public Member Functions

*Standard constructor * CSubband ()
 
*Destructor * ~CSubband ()
 
*Allocate a memory buffer to
store all wavelet coefficients
of this subband *return True
if the allocation did work
without any problems *bool 
AllocMemory ()
 
*Delete the memory buffer of
this subband *void 
FreeMemory ()
 
*Extracts a rectangular
subregion of this subband
*Write wavelet coefficients
into buffer *It might throw an
IOException *param encoder An
encoder instance *param tile
True if just a rectangular
region is false if the entire
subband is extracted *param
tileX Tile index in x
direction *param tileY Tile
index in y direction *void 
ExtractTile (CEncoder &encoder, bool tile=false, UINT32 tileX=0, UINT32 tileY=0) THROW_
 
*Decoding and dequantization
of this subband *It might
throw an IOException *param
decoder A decoder instance
*param quantParam
Dequantization value *param
tile True if just a
rectangular region is false if
the entire subband is placed
*param tileX Tile index in x
direction *param tileY Tile
index in y direction *void 
PlaceTile (CDecoder &decoder, int quantParam, bool tile=false, UINT32 tileX=0, UINT32 tileY=0) THROW_
 
*Perform subband quantization
with given quantization
parameter *A scalar 
quantization (with dead-zone) is used.A large quantization value *results in strong quantization and therefore in big quality loss.*@param quantParam A quantization parameter(larger or equal to 0)*/void Quantize(int quantParam)
 
*Perform subband
dequantization with given
quantization parameter *A
scalar 
quantization (with dead-zone) is used.A large quantization value *results in strong quantization and therefore in big quality loss.*@param quantParam A quantization parameter(larger or equal to 0)*/void Dequantize(int quantParam)
 
*Store wavelet coefficient in
subband at given position
*param pos A subband 
position (>=0)*@param v A wavelet coefficient */void SetData(UINT32 pos
 
*Get a pointer to an array of
all wavelet coefficients of
this subband *return Pointer
to array of wavelet
coefficients *DataT
GetBuffer ()
 
*Return wavelet coefficient at
given position *param pos A
subband 
position (>=0)*@return Wavelet coefficient */DataT GetData(UINT32 pos) const
 
*Return level of this subband
*return Level of this subband
*int 
GetLevel () const
 
*Return height of this subband
*return Height of this 
subband (in pixels)*/int GetHeight() const
 
*Return width of this subband
*return Width of this 
subband (in pixels)*/int GetWidth() const
 
*Return orientation of this
subband *LL LH *HL HH *return
Orientation of this 
subband (LL, HL, LH, HH)*/Orientation GetOrientation() const
 

Public Attributes

*Extracts a rectangular
subregion of this subband
*Write wavelet coefficients
into buffer *It might throw an
IOException *param encoder An
encoder instance *param tile
True if just a rectangular
region is 
extracted
 
*Decoding and dequantization
of this subband *It might
throw an IOException *param
decoder A decoder instance
*param quantParam
Dequantization value *param
tile True if just a
rectangular region is 
placed
 
*Store wavelet coefficient in
subband at given position
*param pos A subband DataT 
v { ASSERT(pos < m_size)
 
 m_data [pos] = v
 

Private Member Functions

void Initialize (UINT32 width, UINT32 height, int level, Orientation orient)
 
void WriteBuffer (DataT val)
 
void SetBuffer (DataT *b)
 
DataT ReadBuffer ()
 
UINT32 GetBuffPos () const
 
void InitBuffPos ()
 

Private Attributes

UINT32 m_width
 width in pixels
 
UINT32 m_height
 height in pixels
 
UINT32 m_size
 size of data buffer m_data
 
int m_level
 recursion level
 
Orientation m_orientation
 0=LL, 1=HL, 2=LH, 3=HH L=lowpass filtered, H=highpass filterd
 
UINT32 m_dataPos
 current position in m_data
 
DataTm_data
 buffer
 

Friends

class CWaveletTransform
 

Detailed Description

Definition at line 41 of file Subband.h.

Constructor & Destructor Documentation

*file Subband cpp *brief PGF wavelet subband class implementation *author C Stamm * CSubband::CSubband ( )

Definition at line 35 of file Subband.cpp.

: m_size(0)
, m_data(0)
#ifdef __PGFROISUPPORT__
, m_nTiles(0)
#endif
{
}
CSubband::~CSubband ( )

Definition at line 46 of file Subband.cpp.

{
}

Member Function Documentation

bool CSubband::AllocMemory ( )

Definition at line 72 of file Subband.cpp.

{
UINT32 oldSize = m_size;
#ifdef __PGFROISUPPORT__
m_size = BufferWidth()*m_ROI.Height();
#endif
ASSERT(m_size > 0);
if (m_data) {
if (oldSize >= m_size) {
return true;
} else {
delete[] m_data;
m_data = new(std::nothrow) DataT[m_size];
return (m_data != 0);
}
} else {
m_data = new(std::nothrow) DataT[m_size];
return (m_data != 0);
}
}
*Extracts a rectangular subregion of this subband *Write wavelet coefficients into buffer *It might throw an IOException *param encoder An encoder instance *param tile True if just a rectangular region is false if the entire subband is extracted *param tileX Tile index in x direction *param tileY Tile index in y direction *void CSubband::ExtractTile ( CEncoder encoder,
bool  tile = false,
UINT32  tileX = 0,
UINT32  tileY = 0 
)

Definition at line 172 of file Subband.cpp.

{
#ifdef __PGFROISUPPORT__
if (tile) {
// compute tile position and size
UINT32 xPos, yPos, w, h;
TilePosition(tileX, tileY, xPos, yPos, w, h);
// write values into buffer using partitiong scheme
encoder.Partition(this, w, h, xPos + yPos*m_width, m_width);
} else
#endif
{
// write values into buffer using partitiong scheme
encoder.Partition(this, m_width, m_height, 0, m_width);
}
}
void CSubband::FreeMemory ( )

Definition at line 96 of file Subband.cpp.

{
if (m_data) {
delete[] m_data; m_data = 0;
}
}
* Get a pointer to an array of all wavelet coefficients of this subband* return Pointer to array of wavelet coefficients* DataT* CSubband::GetBuffer ( )
inline

Definition at line 106 of file Subband.h.

{ return m_data; }
UINT32 CSubband::GetBuffPos ( ) const
inlineprivate

Definition at line 150 of file Subband.h.

{ return m_dataPos; }
* Return level of this subband* return Level of this subband* int CSubband::GetLevel ( ) const
inline

Definition at line 117 of file Subband.h.

{ return m_level; }
void CSubband::InitBuffPos ( )
inlineprivate

Definition at line 160 of file Subband.h.

{ m_dataPos = 0; }
void CSubband::Initialize ( UINT32  width,
UINT32  height,
int  level,
Orientation  orient 
)
private

Definition at line 52 of file Subband.cpp.

{
m_level = level;
m_orientation = orient;
m_data = 0;
m_dataPos = 0;
#ifdef __PGFROISUPPORT__
m_ROI.left = 0;
m_ROI.top = 0;
m_ROI.right = m_width;
m_ROI.bottom = m_height;
m_nTiles = 0;
#endif
}
*Decoding and dequantization of this subband *It might throw an IOException *param decoder A decoder instance *param quantParam Dequantization value *param tile True if just a rectangular region is false if the entire subband is placed *param tileX Tile index in x direction *param tileY Tile index in y direction *void CSubband::PlaceTile ( CDecoder decoder,
int  quantParam,
bool  tile = false,
UINT32  tileX = 0,
UINT32  tileY = 0 
)

Definition at line 197 of file Subband.cpp.

{
// allocate memory
if (!AllocMemory()) ReturnWithError(InsufficientMemory);
// correct quantParam with normalization factor
if (m_orientation == LL) {
} else if (m_orientation == HH) {
} else {
}
if (quantParam < 0) quantParam = 0;
#ifdef __PGFROISUPPORT__
if (tile) {
UINT32 xPos, yPos, w, h;
// compute tile position and size
TilePosition(tileX, tileY, xPos, yPos, w, h);
ASSERT(xPos >= m_ROI.left && yPos >= m_ROI.top);
decoder.Partition(this, quantParam, w, h, (xPos - m_ROI.left) + (yPos - m_ROI.top)*BufferWidth(), BufferWidth());
} else
#endif
{
// read values into buffer using partitiong scheme
decoder.Partition(this, quantParam, m_width, m_height, 0, m_width);
}
}
* Store wavelet coefficient in subband at given position* param pos A subband CSubband::position ( >=  0)
* Return wavelet coefficient at given position* param pos A subband CSubband::position ( >=  0) const
inline

Definition at line 110 of file Subband.h.

{ ASSERT(pos < m_size); return m_data[pos]; }
* Perform subband quantization with given quantization parameter* A scalar CSubband::quantization ( with dead-  zone)
* Perform subband dequantization with given quantization parameter* A scalar CSubband::quantization ( with dead-  zone)
DataT CSubband::ReadBuffer ( )
inlineprivate

Definition at line 148 of file Subband.h.

void CSubband::SetBuffer ( DataT b)
inlineprivate

Definition at line 147 of file Subband.h.

{ ASSERT(b); m_data = b; }
* Return height of this subband* return Height of this CSubband::subband ( in  pixels) const
inline

Definition at line 121 of file Subband.h.

{ return m_height; }
* Return width of this subband* return Width of this CSubband::subband ( in  pixels) const
inline

Definition at line 126 of file Subband.h.

{ return m_width; }
* Return orientation of this subband* LL LH* HL HH* return Orientation of this CSubband::subband ( LL  ,
HL  ,
LH  ,
HH   
) const
inline

Definition at line 133 of file Subband.h.

{ return m_orientation; }
void CSubband::WriteBuffer ( DataT  val)
inlineprivate

Definition at line 146 of file Subband.h.

Friends And Related Function Documentation

friend class CWaveletTransform
friend

Definition at line 43 of file Subband.h.

Member Data Documentation

* Extracts a rectangular subregion of this subband* Write wavelet coefficients into buffer* It might throw an IOException* param encoder An encoder instance* param tile True if just a rectangular region is CSubband::extracted

Definition at line 68 of file Subband.h.

CSubband::m_data[pos] = v

Definition at line 101 of file Subband.h.

DataT* CSubband::m_data
private

buffer

Definition at line 170 of file Subband.h.

UINT32 CSubband::m_dataPos
private

current position in m_data

Definition at line 169 of file Subband.h.

UINT32 CSubband::m_height
private

height in pixels

Definition at line 165 of file Subband.h.

int CSubband::m_level
private

recursion level

Definition at line 167 of file Subband.h.

Orientation CSubband::m_orientation
private

0=LL, 1=HL, 2=LH, 3=HH L=lowpass filtered, H=highpass filterd

Definition at line 168 of file Subband.h.

UINT32 CSubband::m_size
private

size of data buffer m_data

Definition at line 166 of file Subband.h.

UINT32 CSubband::m_width
private

width in pixels

Definition at line 164 of file Subband.h.

* Decoding and dequantization of this subband* It might throw an IOException* param decoder A decoder instance* param quantParam Dequantization value* param tile True if just a rectangular region is CSubband::placed

Definition at line 78 of file Subband.h.

* Store wavelet coefficient in subband at given position* param pos A subband DataT CSubband::v { ASSERT(pos < m_size)

Definition at line 101 of file Subband.h.


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