CSubband(3)

πŸ“¦
version 7.21.7 Β· 4 versions
, in fedora 43

πŸ’– 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 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. πŸ“
  • 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 instance
  • tile β€” true if just a rectangular region is extracted, false if the entire subband is extracted.
  • tileX β€” Tile index in x-direction
  • tileY β€” 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 instance
  • quantParam β€” Dequantization value
  • tile β€” true if just a rectangular region is placed, false if the entire subband is placed.
  • tileX β€” Tile index in x-direction
  • tileY β€” 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; }

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 file Subband.h. πŸŽ€
  • friend class CWaveletTransform [friend] β€” Definition at line 43 of file Subband.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 file Subband.h. πŸ’Ύ
  • UINT32 CSubband::m_dataPos [private] β€” current position in m_data. Definition at line 171 of file Subband.h. πŸ“
  • UINT32 CSubband::m_height [private] β€” height in pixels. Definition at line 167 of file Subband.h. πŸ“
  • int CSubband::m_level [private] β€” recursion level. Definition at line 169 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 170 of file Subband.h. πŸ”„
  • UINT32 CSubband::m_size [private] β€” size of data buffer m_data. Definition at line 168 of file Subband.h. πŸ“¦
  • UINT32 CSubband::m_width [private] β€” width in pixels. Definition at line 166 of file Subband.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