OpenJPH
Open-source implementation of JPEG2000 Part-15
ojph_params.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_params.h
34// Author: Aous Naman
35// Date: 28 August 2019
36//***************************************************************************/
37
38
39#ifndef OJPH_PARAMS_H
40#define OJPH_PARAMS_H
41
42#include "ojph_arch.h"
43#include "ojph_base.h"
44
45namespace ojph {
46
48 //prototyping from local
49 namespace local {
50 struct param_siz;
51 struct param_cod;
52 struct param_qcd;
53 struct param_qcc;
54 struct param_cap;
55 struct param_nlt;
56 class codestream;
57 }
58
61 {
62 public:
63 param_siz(local::param_siz *p) : state(p) {}
64
65 //setters
66 void set_image_extent(point extent);
67 void set_tile_size(size s);
68 void set_image_offset(point offset);
69 void set_tile_offset(point offset);
70 void set_num_components(ui32 num_comps);
71 void set_component(ui32 comp_num, const point& downsampling,
72 ui32 bit_depth, bool is_signed);
73
74 //getters
75 point get_image_extent() const;
76 point get_image_offset() const;
77 size get_tile_size() const;
78 point get_tile_offset() const;
79 ui32 get_num_components() const;
80 ui32 get_bit_depth(ui32 comp_num) const;
81 bool is_signed(ui32 comp_num) const;
82 point get_downsampling(ui32 comp_num) const;
83
84 //deeper getters
85 ui32 get_recon_width(ui32 comp_num) const;
86 ui32 get_recon_height(ui32 comp_num) const;
87
88 private:
90 };
91
94 {
95 public:
96 param_cod(local::param_cod* p) : state(p) {}
97
98 void set_num_decomposition(ui32 num_decompositions);
99 void set_block_dims(ui32 width, ui32 height);
100 void set_precinct_size(int num_levels, size* precinct_size);
101 void set_progression_order(const char *name);
102 void set_color_transform(bool color_transform);
103 void set_reversible(bool reversible);
104
105 ui32 get_num_decompositions() const;
106 size get_block_dims() const;
107 size get_log_block_dims() const;
108 bool is_reversible() const;
109 size get_precinct_size(ui32 level_num) const;
110 size get_log_precinct_size(ui32 level_num) const;
111 int get_progression_order() const;
112 const char* get_progression_order_as_string() const;
113 int get_num_layers() const;
114 bool is_using_color_transform() const;
115 bool packets_may_use_sop() const;
116 bool packets_use_eph() const;
117 bool get_block_vertical_causality() const;
118
119 private:
121 };
122
125 {
126 public:
127 param_qcd(local::param_qcd* p) : state(p) {}
128
129 void set_irrev_quant(float delta);
130
131 private:
133 };
134
141 {
142 public:
143 enum special_comp_num : ui16 { ALL_COMPS = 65535 };
144 public:
145 param_nlt(local::param_nlt* p) : state(p) {}
146
158 void set_type3_transformation(ui32 comp_num, bool enable);
159
169 bool get_type3_transformation(ui32 comp_num, ui8& bit_depth,
170 bool& is_signed);
171
172 private:
174 };
175
178 {
179 friend class local::codestream;
180 public:
181 comment_exchange() : data(NULL), len(0), Rcom(0) {}
182 void set_string(const char* str);
183 void set_data(const char* data, ui16 len);
184
185 private:
186 const char* data;
189 };
190
191}
192
193#endif // !OJPH_PARAMS_H
local::param_cod * state
Definition: ojph_params.h:120
param_cod(local::param_cod *p)
Definition: ojph_params.h:96
non-linearity point transformation object (implements NLT marker segment)
Definition: ojph_params.h:141
param_nlt(local::param_nlt *p)
Definition: ojph_params.h:145
local::param_nlt * state
Definition: ojph_params.h:173
local::param_qcd * state
Definition: ojph_params.h:132
param_qcd(local::param_qcd *p)
Definition: ojph_params.h:127
local::param_siz * state
Definition: ojph_params.h:89
param_siz(local::param_siz *p)
Definition: ojph_params.h:63
uint16_t ui16
Definition: ojph_defs.h:52
uint32_t ui32
Definition: ojph_defs.h:54
uint8_t ui8
Definition: ojph_defs.h:50
#define OJPH_EXPORT
Definition: ojph_arch.h:119