libpgf
7.26.45
PGF - Progressive Graphics File
Toggle main menu visibility
Loading...
Searching...
No Matches
Subband.h
Go to the documentation of this file.
1
/*
2
* The Progressive Graphics File; http://www.libpgf.org
3
*
4
* $Date: 2006-06-04 22:05:59 +0200 (So, 04 Jun 2006) $
5
* $Revision: 229 $
6
*
7
* This file Copyright (C) 2006 xeraina GmbH, Switzerland
8
*
9
* This program is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE
11
* as published by the Free Software Foundation; either version 2.1
12
* of the License, or (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
*/
23
28
29
#pragma once
30
31
#include "
PGFtypes.h
"
32
33
namespace
pgf
{
34
class
CEncoder
;
35
class
CDecoder
;
36
class
CRoiIndices;
37
42
class
CSubband
{
43
friend
class
CWaveletTransform
;
44
friend
class
CRoiIndices
;
45
46
public
:
49
CSubband
();
50
53
~CSubband
();
54
58
bool
AllocMemory
();
59
62
void
FreeMemory
();
63
72
void
ExtractTile
(
CEncoder
& encoder,
bool
tile =
false
, uint32_t tileX = 0, uint32_t tileY = 0);
73
82
void
PlaceTile
(
CDecoder
& decoder,
int
quantParam,
bool
tile =
false
, uint32_t tileX = 0, uint32_t tileY = 0);
83
89
void
Quantize
(
int
quantParam);
90
96
void
Dequantize
(
int
quantParam);
97
102
void
SetData
(uint32_t pos,
DataT
v) { ASSERT(pos <
m_size
);
m_data
[pos] = v; }
103
107
DataT
*
GetBuffer
() {
return
m_data
; }
108
113
DataT
GetData
(uint32_t pos)
const
{ ASSERT(pos <
m_size
);
return
m_data
[pos]; }
114
118
int
GetLevel
()
const
{
return
m_level
; }
119
123
int
GetHeight
()
const
{
return
m_height
; }
124
128
int
GetWidth
()
const
{
return
m_width
; }
129
135
Orient::Orientation
GetOrientation
()
const
{
return
m_orientation
; }
136
137
#ifdef __PGFROISUPPORT__
141
void
IncBuffRow(uint32_t pos) {
m_dataPos
= pos + BufferWidth(); }
142
143
#endif
144
145
private
:
146
void
Initialize
(uint32_t width, uint32_t height,
int
level,
Orient::Orientation
orient);
147
void
WriteBuffer
(
DataT
val) { ASSERT(
m_dataPos
<
m_size
);
m_data
[
m_dataPos
++] = val; }
148
void
SetBuffer
(
DataT
* b) { ASSERT(b);
m_data
= b; }
149
DataT
ReadBuffer
() { ASSERT(
m_dataPos
<
m_size
);
return
m_data
[
m_dataPos
++]; }
150
151
uint32_t
GetBuffPos
()
const
{
return
m_dataPos
; }
152
153
#ifdef __PGFROISUPPORT__
154
uint32_t BufferWidth()
const
{
return
m_ROI.Width(); }
155
void
TilePosition(uint32_t tileX, uint32_t tileY, uint32_t& left, uint32_t& top, uint32_t& w, uint32_t& h)
const
;
156
void
TileIndex(
bool
topLeft, uint32_t xPos, uint32_t yPos, uint32_t& tileX, uint32_t& tileY, uint32_t& x, uint32_t& y)
const
;
157
const
PGFRect& GetAlignedROI()
const
{
return
m_ROI; }
158
void
SetNTiles(uint32_t nTiles) { m_nTiles = nTiles; }
159
void
SetAlignedROI(
const
PGFRect& roi);
160
void
InitBuffPos
(uint32_t left = 0, uint32_t top = 0) {
m_dataPos
= top*BufferWidth() + left; ASSERT(
m_dataPos
<
m_size
); }
161
#else
162
void
InitBuffPos
() {
m_dataPos
= 0; }
163
#endif
164
165
private
:
166
uint32_t
m_width
;
167
uint32_t
m_height
;
168
uint32_t
m_size
;
169
int
m_level
;
170
Orient::Orientation
m_orientation
;
171
uint32_t
m_dataPos
;
172
DataT
*
m_data
;
173
174
#ifdef __PGFROISUPPORT__
175
PGFRect
m_ROI;
176
uint32_t m_nTiles;
177
#endif
178
};
179
}
PGFtypes.h
PGF definitions.
pgf::CDecoder
PGF decoder.
Definition
Decoder.h:41
pgf::CEncoder
PGF encoder.
Definition
Encoder.h:41
pgf::CSubband::ExtractTile
void ExtractTile(CEncoder &encoder, bool tile=false, uint32_t tileX=0, uint32_t tileY=0)
Definition
Subband.cpp:178
pgf::CSubband::CRoiIndices
friend class CRoiIndices
Definition
Subband.h:44
pgf::CSubband::AllocMemory
bool AllocMemory()
Definition
Subband.cpp:78
pgf::CSubband::m_level
int m_level
recursion level
Definition
Subband.h:169
pgf::CSubband::m_height
uint32_t m_height
height in pixels
Definition
Subband.h:167
pgf::CSubband::m_dataPos
uint32_t m_dataPos
current position in m_data
Definition
Subband.h:171
pgf::CSubband::GetBuffer
DataT * GetBuffer()
Definition
Subband.h:107
pgf::CSubband::CWaveletTransform
friend class CWaveletTransform
Definition
Subband.h:43
pgf::CSubband::Dequantize
void Dequantize(int quantParam)
Definition
Subband.cpp:155
pgf::CSubband::SetData
void SetData(uint32_t pos, DataT v)
Definition
Subband.h:102
pgf::CSubband::FreeMemory
void FreeMemory()
Delete the memory buffer of this subband.
Definition
Subband.cpp:102
pgf::CSubband::GetLevel
int GetLevel() const
Definition
Subband.h:118
pgf::CSubband::ReadBuffer
DataT ReadBuffer()
Definition
Subband.h:149
pgf::CSubband::GetOrientation
Orient::Orientation GetOrientation() const
Definition
Subband.h:135
pgf::CSubband::GetBuffPos
uint32_t GetBuffPos() const
Definition
Subband.h:151
pgf::CSubband::InitBuffPos
void InitBuffPos()
Definition
Subband.h:162
pgf::CSubband::GetHeight
int GetHeight() const
Definition
Subband.h:123
pgf::CSubband::m_size
uint32_t m_size
size of data buffer m_data
Definition
Subband.h:168
pgf::CSubband::Initialize
void Initialize(uint32_t width, uint32_t height, int level, Orient::Orientation orient)
Definition
Subband.cpp:58
pgf::CSubband::WriteBuffer
void WriteBuffer(DataT val)
Definition
Subband.h:147
pgf::CSubband::CSubband
CSubband()
Standard constructor.
Definition
Subband.cpp:36
pgf::CSubband::m_orientation
Orient::Orientation m_orientation
0=LL, 1=HL, 2=LH, 3=HH L=lowpass filtered, H=highpass filterd
Definition
Subband.h:170
pgf::CSubband::GetWidth
int GetWidth() const
Definition
Subband.h:128
pgf::CSubband::GetData
DataT GetData(uint32_t pos) const
Definition
Subband.h:113
pgf::CSubband::SetBuffer
void SetBuffer(DataT *b)
Definition
Subband.h:148
pgf::CSubband::m_data
DataT * m_data
buffer
Definition
Subband.h:172
pgf::CSubband::m_width
uint32_t m_width
width in pixels
Definition
Subband.h:166
pgf::CSubband::PlaceTile
void PlaceTile(CDecoder &decoder, int quantParam, bool tile=false, uint32_t tileX=0, uint32_t tileY=0)
Definition
Subband.cpp:204
pgf::CSubband::Quantize
void Quantize(int quantParam)
Definition
Subband.cpp:113
pgf::Orient::Orientation
uint8_t Orientation
Definition
PGFtypes.h:102
pgf
Definition
PGFimage.h:33
pgf::DataT
int32_t DataT
Definition
PGFtypes.h:367
pgf::PGFRect
Rectangle.
Definition
PGFtypes.h:258
src
Subband.h
Generated on
for libpgf by
1.18.0