65#ifdef __PGFROISUPPORT__
80#ifdef __PGFROISUPPORT__
81 m_size = BufferWidth()*m_ROI.Height();
116 if (quantParam > 0) {
118 for (UINT32 i=0; i <
m_size; i++) {
133 if (quantParam > 0) {
134 int threshold = ((1 << quantParam) * 7)/5;
136 for (UINT32 i=0; i <
m_size; i++) {
137 if (
m_data[i] < -threshold) {
139 }
else if (
m_data[i] > threshold) {
162 if (quantParam > 0) {
163 for (UINT32 i=0; i <
m_size; i++) {
178#ifdef __PGFROISUPPORT__
181 UINT32 xPos, yPos, w, h;
182 TilePosition(tileX, tileY, xPos, yPos, w, h);
205 if (!
AllocMemory()) ReturnWithError(InsufficientMemory);
215 if (quantParam < 0) quantParam = 0;
217#ifdef __PGFROISUPPORT__
219 UINT32 xPos, yPos, w, h;
222 TilePosition(tileX, tileY, xPos, yPos, w, h);
224 ASSERT(xPos >= m_ROI.left && yPos >= m_ROI.top);
225 decoder.
Partition(
this, quantParam, w, h, (xPos - m_ROI.left) + (yPos - m_ROI.top)*BufferWidth(), BufferWidth());
237#ifdef __PGFROISUPPORT__
240void CSubband::SetAlignedROI(
const PGFRect& roi) {
257void CSubband::TilePosition(UINT32 tileX, UINT32 tileY, UINT32& xPos, UINT32& yPos, UINT32& w, UINT32& h)
const {
258 ASSERT(tileX < m_nTiles); ASSERT(tileY < m_nTiles);
270 UINT32 nTiles = m_nTiles;
272 UINT32 left = 0, right = nTiles;
273 UINT32 top = 0, bottom = nTiles;
282 m = left + ((right - left) >> 1);
284 xPos += (w + 1) >> 1;
292 m = top + ((bottom - top) >> 1);
294 yPos += (h + 1) >> 1;
309void CSubband::TileIndex(
bool topLeft, UINT32 xPos, UINT32 yPos, UINT32& tileX, UINT32& tileY, UINT32& x, UINT32& y)
const {
311 UINT32 left = 0, right =
m_width;
313 UINT32 nTiles = m_nTiles;
323 m = left + ((right - left + 1) >> 1);
333 ASSERT(tileX >= 0 && tileX < m_nTiles);
340 m = top + ((bottom - top + 1) >> 1);
350 ASSERT(tileY >= 0 && tileY < m_nTiles);
357 m = left + ((right - left + 1) >> 1);
367 ASSERT(tileX > 0 && tileX <= m_nTiles);
374 m = top + ((bottom - top + 1) >> 1);
384 ASSERT(tileY > 0 && tileY <= m_nTiles);
PGF wavelet subband class.
void Partition(CSubband *band, int quantParam, int width, int height, int startPos, int pitch)
void Partition(CSubband *band, int width, int height, int startPos, int pitch)
UINT32 m_size
size of data buffer m_data
UINT32 m_dataPos
current position in m_data
void Dequantize(int quantParam)
void Initialize(UINT32 width, UINT32 height, int level, Orientation orient)
void Quantize(int quantParam)
void FreeMemory()
Delete the memory buffer of this subband.
UINT32 m_height
height in pixels
Orientation m_orientation
0=LL, 1=HL, 2=LH, 3=HH L=lowpass filtered, H=highpass filterd
void ExtractTile(CEncoder &encoder, bool tile=false, UINT32 tileX=0, UINT32 tileY=0)
int m_level
recursion level
void PlaceTile(CDecoder &decoder, int quantParam, bool tile=false, UINT32 tileX=0, UINT32 tileY=0)
UINT32 m_width
width in pixels
CSubband()
Standard constructor.