OpenJPH
Open-source implementation of JPEG2000 Part-15
ojph_resolution.h
Go to the documentation of this file.
1
//***************************************************************************/
2
// This software is released under the 2-Clause BSD license, included
3
// below.
4
//
5
// Copyright (c) 2019, Aous Naman
6
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
7
// Copyright (c) 2019, The University of New South Wales, Australia
8
//
9
// Redistribution and use in source and binary forms, with or without
10
// modification, are permitted provided that the following conditions are
11
// met:
12
//
13
// 1. Redistributions of source code must retain the above copyright
14
// notice, this list of conditions and the following disclaimer.
15
//
16
// 2. Redistributions in binary form must reproduce the above copyright
17
// notice, this list of conditions and the following disclaimer in the
18
// documentation and/or other materials provided with the distribution.
19
//
20
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
26
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
//***************************************************************************/
32
// This file is part of the OpenJPH software implementation.
33
// File: ojph_resolution.h
34
// Author: Aous Naman
35
// Date: 28 August 2019
36
//***************************************************************************/
37
38
39
#ifndef OJPH_RESOLUTION_H
40
#define OJPH_RESOLUTION_H
41
42
#include "
ojph_defs.h
"
43
44
namespace
ojph
{
45
47
//defined elsewhere
48
struct
line_buf;
49
class
mem_elastic_allocator;
50
class
codestream;
51
52
namespace
local {
53
55
//defined here
56
class
tile_comp;
57
struct
precinct;
58
class
subband;
59
61
class
resolution
62
{
63
public
:
64
65
public
:
66
static
void
pre_alloc
(
codestream
*
codestream
,
const
rect
&
res_rect
,
67
const
rect
& recon_res_rect,
ui32
res_num
);
68
void
finalize_alloc
(
codestream
*
codestream
,
const
rect
&
res_rect
,
69
const
rect
& recon_res_rect,
ui32
comp_num
,
70
ui32
res_num
,
point
comp_downsamp
,
71
tile_comp
*parent_tile_comp,
72
resolution
*
parent_res
);
73
74
line_buf
*
get_line
() {
return
lines
+ 0; }
75
void
push_line
();
76
line_buf
*
pull_line
();
77
rect
get_rect
() {
return
res_rect
; }
78
ui32
get_comp_num
() {
return
comp_num
; }
79
80
ui32
prepare_precinct
();
81
void
write_precincts
(
outfile_base
*file);
82
bool
get_top_left_precinct
(
point
&top_left);
83
void
write_one_precinct
(
outfile_base
*file);
84
resolution
*
next_resolution
() {
return
child_res
; }
85
void
parse_all_precincts
(
ui32
& data_left,
infile_base
*file);
86
void
parse_one_precinct
(
ui32
& data_left,
infile_base
*file);
87
88
ui32
get_num_bytes
()
const
{
return
num_bytes
; }
89
ui32
get_num_bytes
(
ui32
resolution_num)
const
;
90
91
private
:
92
bool
reversible
,
skipped_res_for_read
,
skipped_res_for_recon
;
93
ui32
num_lines
;
94
ui32
num_bands
,
res_num
;
95
ui32
comp_num
;
96
ui32
num_bytes
;
// number of bytes in this resolution
97
// used for tilepart length
98
point
comp_downsamp
;
99
rect
res_rect
;
100
line_buf
*
lines
;
101
subband
*
bands
;
102
tile_comp
*
parent_comp
;
103
resolution
*
parent_res
, *
child_res
;
104
//precincts stuff
105
precinct
*
precincts
;
106
size
num_precincts
;
107
size
log_PP
;
108
ui32
max_num_levels
;
109
int
tag_tree_size
;
110
ui32
level_index
[20];
//more than enough
111
point
cur_precinct_loc
;
//used for progressing spatial modes (2, 3, 4)
112
//wavelet machinery
113
ui32
cur_line
;
114
bool
vert_even
,
horz_even
;
115
mem_elastic_allocator
*
elastic
;
116
};
117
118
}
119
}
120
121
#endif
// !OJPH_RESOLUTION_H
ojph::infile_base
Definition:
ojph_file.h:184
ojph::local::codestream
Definition:
ojph_codestream_local.h:69
ojph::local::resolution
Definition:
ojph_resolution.h:62
ojph::local::resolution::get_top_left_precinct
bool get_top_left_precinct(point &top_left)
Definition:
ojph_resolution.cpp:787
ojph::local::resolution::bands
subband * bands
Definition:
ojph_resolution.h:101
ojph::local::resolution::parse_one_precinct
void parse_one_precinct(ui32 &data_left, infile_base *file)
Definition:
ojph_resolution.cpp:832
ojph::local::resolution::skipped_res_for_recon
bool skipped_res_for_recon
Definition:
ojph_resolution.h:92
ojph::local::resolution::tag_tree_size
int tag_tree_size
Definition:
ojph_resolution.h:109
ojph::local::resolution::push_line
void push_line()
Definition:
ojph_resolution.cpp:338
ojph::local::resolution::get_num_bytes
ui32 get_num_bytes() const
Definition:
ojph_resolution.h:88
ojph::local::resolution::elastic
mem_elastic_allocator * elastic
Definition:
ojph_resolution.h:115
ojph::local::resolution::comp_downsamp
point comp_downsamp
Definition:
ojph_resolution.h:98
ojph::local::resolution::parent_res
resolution * parent_res
Definition:
ojph_resolution.h:103
ojph::local::resolution::cur_precinct_loc
point cur_precinct_loc
Definition:
ojph_resolution.h:111
ojph::local::resolution::prepare_precinct
ui32 prepare_precinct()
Definition:
ojph_resolution.cpp:764
ojph::local::resolution::reversible
bool reversible
Definition:
ojph_resolution.h:92
ojph::local::resolution::write_precincts
void write_precincts(outfile_base *file)
Definition:
ojph_resolution.cpp:779
ojph::local::resolution::comp_num
ui32 comp_num
Definition:
ojph_resolution.h:95
ojph::local::resolution::get_rect
rect get_rect()
Definition:
ojph_resolution.h:77
ojph::local::resolution::res_rect
rect res_rect
Definition:
ojph_resolution.h:99
ojph::local::resolution::precincts
precinct * precincts
Definition:
ojph_resolution.h:105
ojph::local::resolution::parent_comp
tile_comp * parent_comp
Definition:
ojph_resolution.h:102
ojph::local::resolution::pull_line
line_buf * pull_line()
Definition:
ojph_resolution.cpp:606
ojph::local::resolution::get_line
line_buf * get_line()
Definition:
ojph_resolution.h:74
ojph::local::resolution::num_precincts
size num_precincts
Definition:
ojph_resolution.h:106
ojph::local::resolution::get_comp_num
ui32 get_comp_num()
Definition:
ojph_resolution.h:78
ojph::local::resolution::skipped_res_for_read
bool skipped_res_for_read
Definition:
ojph_resolution.h:92
ojph::local::resolution::level_index
ui32 level_index[20]
Definition:
ojph_resolution.h:110
ojph::local::resolution::next_resolution
resolution * next_resolution()
Definition:
ojph_resolution.h:84
ojph::local::resolution::lines
line_buf * lines
Definition:
ojph_resolution.h:100
ojph::local::resolution::finalize_alloc
void finalize_alloc(codestream *codestream, const rect &res_rect, const rect &recon_res_rect, ui32 comp_num, ui32 res_num, point comp_downsamp, tile_comp *parent_tile_comp, resolution *parent_res)
Definition:
ojph_resolution.cpp:180
ojph::local::resolution::log_PP
size log_PP
Definition:
ojph_resolution.h:107
ojph::local::resolution::num_bands
ui32 num_bands
Definition:
ojph_resolution.h:94
ojph::local::resolution::num_lines
ui32 num_lines
Definition:
ojph_resolution.h:93
ojph::local::resolution::horz_even
bool horz_even
Definition:
ojph_resolution.h:114
ojph::local::resolution::parse_all_precincts
void parse_all_precincts(ui32 &data_left, infile_base *file)
Definition:
ojph_resolution.cpp:813
ojph::local::resolution::res_num
ui32 res_num
Definition:
ojph_resolution.h:94
ojph::local::resolution::pre_alloc
static void pre_alloc(codestream *codestream, const rect &res_rect, const rect &recon_res_rect, ui32 res_num)
Definition:
ojph_resolution.cpp:100
ojph::local::resolution::write_one_precinct
void write_one_precinct(outfile_base *file)
Definition:
ojph_resolution.cpp:799
ojph::local::resolution::max_num_levels
ui32 max_num_levels
Definition:
ojph_resolution.h:108
ojph::local::resolution::vert_even
bool vert_even
Definition:
ojph_resolution.h:114
ojph::local::resolution::cur_line
ui32 cur_line
Definition:
ojph_resolution.h:113
ojph::local::resolution::num_bytes
ui32 num_bytes
Definition:
ojph_resolution.h:96
ojph::local::resolution::child_res
resolution * child_res
Definition:
ojph_resolution.h:103
ojph::local::subband
Definition:
ojph_subband.h:63
ojph::local::tile_comp
Definition:
ojph_tile_comp.h:63
ojph::mem_elastic_allocator
Definition:
ojph_mem.h:178
ojph::outfile_base
Definition:
ojph_file.h:75
ojph
Definition:
ojph_img_io.h:52
ojph::ui32
uint32_t ui32
Definition:
ojph_defs.h:54
ojph_defs.h
ojph::line_buf
Definition:
ojph_mem.h:136
ojph::local::precinct
Definition:
ojph_precinct.h:59
ojph::point
Definition:
ojph_base.h:58
ojph::rect
Definition:
ojph_base.h:65
ojph::size
Definition:
ojph_base.h:48
src
core
codestream
ojph_resolution.h
Generated by
1.9.4