CSubband(3)
π CSubband(3) β libpgf π
β¨ NAME β¨
CSubband β it's a Wavelet channel class, bestie. π
π¦ SYNOPSIS π¦
#include <Subband.h>
π Public Member Functions π
CSubband ()β Standard constructor. πΌ slay.~CSubband ()β Destructor. π cleanup era.bool AllocMemory ()β The original gives no extra description here, bestie. Just the signature. π«Άvoid FreeMemory ()β Delete the memory buffer of this subband. π§Ή bye bye buffer.void ExtractTile (CEncoder &encoder, bool tile=false, UINT32 tileX=0, UINT32 tileY=0)β No description in the source, just the signature. β¨void PlaceTile (CDecoder &decoder, int quantParam, bool tile=false, UINT32 tileX=0, UINT32 tileY=0)β No description in the source, just the signature. π¦void Quantize (int quantParam)β No description in the source, just the signature. π₯void Dequantize (int quantParam)β No description in the source, just the signature. πvoid SetData (UINT32 pos, DataT v)β No description in the source, just the signature. βDataT * GetBuffer ()β No description in the source, just the signature. πDataT GetData (UINT32 pos) constβ No description in the source, just the signature. πint GetLevel () constβ No description in the source, just the signature. πint GetHeight () constβ No description in the source, just the signature. πint GetWidth () constβ No description in the source, just the signature. πOrientation GetOrientation () constβ No description in the source, just the signature. π§
π Private Member Functions π
void Initialize (UINT32 width, UINT32 height, int level, Orientation orient)β No description in the source, just the signature. πvoid WriteBuffer (DataT val)β No description in the source, just the signature. βοΈvoid SetBuffer (DataT *b)β No description in the source, just the signature. π―DataT ReadBuffer ()β No description in the source, just the signature. πUINT32 GetBuffPos () constβ No description in the source, just the signature. πvoid InitBuffPos ()β No description in the source, just the signature. π
π¦ Private Attributes π¦
UINT32 m_widthβ width in pixels. πUINT32 m_heightβ height in pixels. πUINT32 m_sizeβ size of data bufferm_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 inm_data. πDataT * m_dataβ buffer. ποΈ
π€ Friends π€
class CWaveletTransformπclass CRoiIndicesπ
πΈ Detailed Description πΈ
Wavelet channel class. π
PGF wavelet channel subband class. π
βοΈ Author βοΈ
C. Stamm, R. Spuler
Definition at line 42 of file Subband.h. π
π Constructor & Destructor Documentation π
π CSubband::CSubband () π
Standard constructor. πΌ
Definition at line 35 of file Subband.cpp. π
36 : m_width(0)
37 , m_height(0)
38 , m_size(0)
39 , m_level(0)
40 , m_orientation(LL)
41 , m_data(0)
42 , m_dataPos(0)
43 #ifdef __PGFROISUPPORT__
44 , m_nTiles(0)
45 #endif
46 {
47 }
π CSubband::~CSubband () π
Destructor. πͺ¦
Definition at line 51 of file Subband.cpp. π
51 {
52 FreeMemory();
53 }
β¨ Member Function Documentation β¨
okay bestie, this is the member function era of CSubband(3) and there is so much here. no skips, no summaries, we're doing every single one. π
π bool CSubband::AllocMemory ()
Allocate a memory buffer to store all wavelet coefficients of this subband. it's giving "make space, we're keeping every coefficient". π
Returns: true if the allocation did work without any problems β¨
Definition at line 77 of file Subband.cpp.
77 {
78 UINT32 oldSize = m_size;
79
80 #ifdef __PGFROISUPPORT__
81 m_size = BufferWidth()*m_ROI.Height();
82 #endif
83 ASSERT(m_size > 0);
84
85 if (m_data) {
86 if (oldSize >= m_size) {
87 return true;
88 } else {
89 delete[] m_data;
90 m_data = new(std::nothrow) DataT[m_size];
91 return (m_data != 0);
92 }
93 } else {
94 m_data = new(std::nothrow) DataT[m_size];
95 return (m_data != 0);
96 }
97 }
π¦ void CSubband::Dequantize (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. π
Parameters:
quantParamβ A quantization parameter (larger or equal to 0)
Definition at line 154 of file Subband.cpp.
154 {
155 if (m_orientation == LL) {
156 quantParam -= m_level + 1;
157 } else if (m_orientation == HH) {
158 quantParam -= m_level - 1;
159 } else {
160 quantParam -= m_level;
161 }
162 if (quantParam > 0) {
163 for (UINT32 i=0; i < m_size; i++) {
164 m_data[i] <<= quantParam;
165 }
166 }
167 }
π void CSubband::ExtractTile (CEncoder & encoder, bool tile = false, UINT32 tileX = 0, UINT32 tileY = 0)
Extracts a rectangular subregion of this subband. Write wavelet coefficients into buffer. It might throw an IOException. π«Ά
Parameters:
encoderβ An encoder instancetileβtrueif just a rectangular region is extracted,falseif the entire subband is extracted.tileXβ Tile index in x-directiontileYβ Tile index in y-direction
Definition at line 177 of file Subband.cpp.
177 {
178 #ifdef __PGFROISUPPORT__
179 if (tile) {
180 // compute tile position and size
181 UINT32 xPos, yPos, w, h;
182 TilePosition(tileX, tileY, xPos, yPos, w, h);
183
184 // write values into buffer using partitiong scheme
185 encoder.Partition(this, w, h, xPos + yPos*m_width, m_width);
186 } else
187 #endif
188 {
189 tileX; tileY; tile; // prevents from unreferenced formal parameter warning
190 // write values into buffer using partitiong scheme
191 encoder.Partition(this, m_width, m_height, 0, m_width);
192 }
193 }
π void CSubband::FreeMemory ()
Delete the memory buffer of this subband. bye-bye data, no cap. π
Definition at line 101 of file Subband.cpp.
101 {
102 if (m_data) {
103 delete[] m_data; m_data = 0;
104 }
105 }
β¨ DataT * CSubband::GetBuffer () [inline]
Get a pointer to an array of all wavelet coefficients of this subband. pointer reveal, iconic. π
Returns: Pointer to array of wavelet coefficients
Definition at line 107 of file Subband.h.
107 { return m_data; }
π UINT32 CSubband::GetBuffPos () const [inline], [private]
okay so the original docs are quiet on this one β just the definition, bestie. no description, but we still show up. π
Definition at line 151 of file Subband.h.
151 { return m_dataPos; }
πΈ DataT CSubband::GetData (UINT32 pos) const [inline]
Return wavelet coefficient at given position. it's the data retrieval moment. β¨
Parameters:
posβ A subband position (>= 0)
Returns: Wavelet coefficient
Definition at line 113 of file Subband.h.
113 { ASSERT(pos < m_size); return m_data[pos]; }
π¦ int CSubband::GetHeight () const [inline]
Return height of this subband. height check, but make it cute. π
Returns: Height of this subband (in pixels)
Definition at line 123 of file Subband.h.
123 { return m_height; }
π int CSubband::GetLevel () const [inline]
Return level of this subband. level up, literally. π
Returns: Level of this subband
Definition at line 118 of file Subband.h.
118 { return m_level; }
π Orientation CSubband::GetOrientation () const [inline]
Return orientation of this subband. LL LH HL HH. orientation reveal, bestie. π§
Returns: Orientation of this subband (LL, HL, LH, HH)
Definition at line 135 of file Subband.h.
135 { return m_orientation; }
π int CSubband::GetWidth () const [inline]
Return width of this subband. width check, slay. π
Returns: Width of this subband (in pixels)
Definition at line 128 of file Subband.h.
128 { return m_width; }
β¨ void CSubband::InitBuffPos () [inline], [private]
again, no description in the docs β just the definition. but we're keeping every crumb. π
Definition at line 162 of file Subband.h.
162 { m_dataPos = 0; }
πΈ void CSubband::Initialize (UINT32 width, UINT32 height, int level, Orientation orient) [private]
No description in the original for this private one, but here's the definition in all its setup glory. π«Ά
Definition at line 57 of file Subband.cpp.
57 {
58 m_width = width;
59 m_height = height;
60 m_size = m_width*m_height;
61 m_level = level;
62 m_orientation = orient;
63 m_data = 0;
64 m_dataPos = 0;
65 #ifdef __PGFROISUPPORT__
66 m_ROI.left = 0;
67 m_ROI.top = 0;
68 m_ROI.right = m_width;
69 m_ROI.bottom = m_height;
70 m_nTiles = 0;
71 #endif
72 }
π₯ void CSubband::PlaceTile (CDecoder & decoder, int quantParam, bool tile = false, UINT32 tileX = 0, UINT32 tileY = 0)
Decoding and dequantization of this subband. It might throw an IOException. the drama! π
Parameters:
decoderβ A decoder instancequantParamβ Dequantization valuetileβtrueif just a rectangular region is placed,falseif the entire subband is placed.tileXβ Tile index in x-directiontileYβ Tile index in y-direction
Definition at line 203 of file Subband.cpp.
203 {
204 // allocate memory
205 if (!AllocMemory()) ReturnWithError(InsufficientMemory);
206
207 // correct quantParam with normalization factor
208 if (m_orientation == LL) {
209 quantParam -= m_level + 1;
210 } else if (m_orientation == HH) {
211 quantParam -= m_level - 1;
212 } else {
213 quantParam -= m_level;
214 }
215 if (quantParam < 0) quantParam = 0;
216
217 #ifdef __PGFROISUPPORT__
218 if (tile) {
219 UINT32 xPos, yPos, w, h;
220
221 // compute tile position and size
222 TilePosition(tileX, tileY, xPos, yPos, w, h);
223
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());
226 } else
227 #endif
228 {
229 tileX; tileY; tile; // prevents from unreferenced formal parameter warning
230 // read values into buffer using partitiong scheme
231 decoder.Partition(this, quantParam, m_width, m_height, 0, m_width);
232 }
233 }
π void CSubband::Quantize (int quantParam)
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. yes bestie, big quant = big loss. π
Parameters:
quantParamβ A quantization parameter (larger or equal to 0)
Definition at line 112 of file Subband.cpp.
112 {
113 if (m_orientation == LL) {
114 quantParam -= (m_level + 1);
115 // uniform rounding quantization
116 if (quantParam > 0) {
117 quantParam--;
118 for (UINT32 i=0; i < m_size; i++) {
119 if (m_data[i] < 0) {
120 m_data[i] = -(((-m_data[i] >> quantParam) + 1) >> 1);
121 } else {
122 m_data[i] = ((m_data[i] >> quantParam) + 1) >> 1;
123 }
124 }
125 }
126 } else {
127 if (m_orientation == HH) {
128 quantParam -= (m_level - 1);
129 } else {
130 quantParam -= m_level;
131 }
132 // uniform deadzone quantization
133 if (quantParam > 0) {
134 int threshold = ((1 << quantParam) * 7)/5; // good value
135 quantParam--;
136 for (UINT32 i=0; i < m_size; i++) {
137 if (m_data[i] < -threshold) {
138 m_data[i] = -(((-m_data[i] >> quantParam) + 1) >> 1);
139 } else if (m_data[i] > threshold) {
140 m_data[i] = ((m_data[i] >> quantParam) + 1) >> 1;
141 } else {
142 m_data[i] = 0;
143 }
144 }
145 }
146 }
147 }
π¦ DataT CSubband::ReadBuffer () [inline], [private]
No description in the original β just the definition. keep it moving. π
Definition at line 149 of file Subband.h.
149 { ASSERT(m_dataPos < m_size); return m_data[m_dataPos++]; }
π void CSubband::SetBuffer (DataT * b) [inline], [private]
No description in the original β just the definition. set the buffer, bestie. β¨
Definition at line 148 of file Subband.h.
148 { ASSERT(b); m_data = b; }
π void CSubband::SetData (UINT32 pos, DataT v) [inline]
Store wavelet coefficient in subband at given position. storing the vibe, literally. π
Parameters:
posβ A subband position (>= 0)vβ A wavelet coefficient
Definition at line 102 of file Subband.h.
102 { ASSERT(pos < m_size); m_data[pos] = v; }
β¨ void CSubband::WriteBuffer (DataT val) [inline], [private]
No description in the original β just the definition. write that buffer, periodt. π
Definition at line 147 of file Subband.h.
147 { ASSERT(m_dataPos < m_size); m_data[m_dataPos++] = val; }
π«Ά Friends And Related Symbol Documentation π«Ά
Okay bestie, CSubband is not alone in the group chat β these two are its literal besties, and the source code confirms it. π
friend class CRoiIndices[friend]β Definition at line 44 of fileSubband.h. πfriend class CWaveletTransform[friend]β Definition at line 43 of fileSubband.h. π¦
πΈ Member Data Documentation πΈ
Now for the private member data β the secret diary of CSubband. Every single one of these is [private], so don't go touching unless you're invited. π
DataT* CSubband::m_data[private]β buffer. Definition at line 172 of fileSubband.h. πΎUINT32 CSubband::m_dataPos[private]β current position inm_data. Definition at line 171 of fileSubband.h. πUINT32 CSubband::m_height[private]β height in pixels. Definition at line 167 of fileSubband.h. πint CSubband::m_level[private]β recursion level. Definition at line 169 of fileSubband.h. πOrientation CSubband::m_orientation[private]β0=LL, 1=HL, 2=LH, 3=HH L=lowpass filtered, H=highpass filterd. Definition at line 170 of fileSubband.h. πUINT32 CSubband::m_size[private]β size of data bufferm_data. Definition at line 168 of fileSubband.h. π¦UINT32 CSubband::m_width[private]β width in pixels. Definition at line 166 of fileSubband.h. π
β¨ Author β¨
Generated automatically by Doxygen for libpgf from the source code. No cap β the robot wrote it, and it ate. π€β¨
And that's the whole vibe, bestie: libpgf version 7.21.2, dated Thu Jul 24 2025 00:00:00, and this iconic lil' page is CSubband(3). Byeeee, go slay some wavelets. π
ππ«Ά
π¦ where this page comes from
- fedora 43: libpgf-devel 7.21.7-8.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: libpgf-devel 7.21.7-8.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms