66#ifdef __PGFROISUPPORT__
81#ifdef __PGFROISUPPORT__
82 m_size = BufferWidth()*m_ROI.Height();
117 if (quantParam > 0) {
119 for (uint32_t i = 0; i <
m_size; i++) {
134 if (quantParam > 0) {
135 int threshold = ((1 << quantParam) * 7)/5;
137 for (uint32_t i = 0; i <
m_size; i++) {
138 if (
m_data[i] < -threshold) {
140 }
else if (
m_data[i] > threshold) {
163 if (quantParam > 0) {
164 for (uint32_t i = 0; i <
m_size; i++) {
179#ifdef __PGFROISUPPORT__
182 uint32_t xPos, yPos, w, h;
183 TilePosition(tileX, tileY, xPos, yPos, w, h);
206 if (!
AllocMemory()) ReturnWithError(InsufficientMemory);
216 if (quantParam < 0) quantParam = 0;
218#ifdef __PGFROISUPPORT__
220 uint32_t xPos, yPos, w, h;
223 TilePosition(tileX, tileY, xPos, yPos, w, h);
225 ASSERT(xPos >= m_ROI.left && yPos >= m_ROI.top);
226 decoder.
Partition(
this, quantParam, w, h, (xPos - m_ROI.left) + (yPos - m_ROI.top)*BufferWidth(), BufferWidth());
238#ifdef __PGFROISUPPORT__
241 void CSubband::SetAlignedROI(
const PGFRect& roi) {
258 void CSubband::TilePosition(uint32_t tileX, uint32_t tileY, uint32_t& xPos, uint32_t& yPos, uint32_t& w, uint32_t& h)
const {
259 ASSERT(tileX < m_nTiles); ASSERT(tileY < m_nTiles);
271 uint32_t nTiles = m_nTiles;
273 uint32_t left = 0, right = nTiles;
274 uint32_t top = 0, bottom = nTiles;
283 m = left + ((right - left) >> 1);
285 xPos += (w + 1) >> 1;
293 m = top + ((bottom - top) >> 1);
295 yPos += (h + 1) >> 1;
310 void CSubband::TileIndex(
bool topLeft, uint32_t xPos, uint32_t yPos, uint32_t& tileX, uint32_t& tileY, uint32_t& x, uint32_t& y)
const {
312 uint32_t left = 0, right =
m_width;
313 uint32_t top = 0, bottom =
m_height;
314 uint32_t nTiles = m_nTiles;
324 m = left + ((right - left + 1) >> 1);
334 ASSERT(tileX >= 0 && tileX < m_nTiles);
341 m = top + ((bottom - top + 1) >> 1);
351 ASSERT(tileY >= 0 && tileY < m_nTiles);
358 m = left + ((right - left + 1) >> 1);
368 ASSERT(tileX > 0 && tileX <= m_nTiles);
375 m = top + ((bottom - top + 1) >> 1);
385 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)
void ExtractTile(CEncoder &encoder, bool tile=false, uint32_t tileX=0, uint32_t tileY=0)
int m_level
recursion level
uint32_t m_height
height in pixels
uint32_t m_dataPos
current position in m_data
void Dequantize(int quantParam)
void FreeMemory()
Delete the memory buffer of this subband.
uint32_t m_size
size of data buffer m_data
void Initialize(uint32_t width, uint32_t height, int level, Orient::Orientation orient)
CSubband()
Standard constructor.
Orient::Orientation m_orientation
0=LL, 1=HL, 2=LH, 3=HH L=lowpass filtered, H=highpass filterd
uint32_t m_width
width in pixels
void PlaceTile(CDecoder &decoder, int quantParam, bool tile=false, uint32_t tileX=0, uint32_t tileY=0)
void Quantize(int quantParam)