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_base.h"
43 
44 namespace ojph {
45 
47  //prototyping from local
48  namespace local {
49  struct param_siz;
50  struct param_cod;
51  struct param_qcd;
52  struct param_qcc;
53  struct param_cap;
54  }
55 
57  class param_siz
58  {
59  public:
62 
63  //setters
65  void set_image_extent(point extent);
67  void set_tile_size(size s);
69  void set_image_offset(point offset);
71  void set_tile_offset(point offset);
73  void set_num_components(ui32 num_comps);
75  void set_component(ui32 comp_num, const point& downsampling,
76  ui32 bit_depth, bool is_signed);
77 
78  //getters
80  point get_image_extent() const;
82  point get_image_offset() const;
84  size get_tile_size() const;
86  point get_tile_offset() const;
88  ui32 get_num_components() const;
90  ui32 get_bit_depth(ui32 comp_num) const;
92  bool is_signed(ui32 comp_num) const;
94  point get_downsampling(ui32 comp_num) const;
95 
96  //deeper getters
98  ui32 get_recon_width(ui32 comp_num) const;
100  ui32 get_recon_height(ui32 comp_num) const;
101 
102  private:
104  };
105 
107  class param_cod
108  {
109  public:
112 
114  void set_num_decomposition(ui32 num_decompositions);
116  void set_block_dims(ui32 width, ui32 height);
118  void set_precinct_size(int num_levels, size* precinct_size);
120  void set_progression_order(const char *name);
122  void set_color_transform(bool color_transform);
124  void set_reversible(bool reversible);
125 
129  size get_block_dims() const;
131  size get_log_block_dims() const;
133  bool is_reversible() const;
135  size get_precinct_size(ui32 level_num) const;
137  size get_log_precinct_size(ui32 level_num) const;
139  int get_progression_order() const;
141  const char* get_progression_order_as_string() const;
143  int get_num_layers() const;
145  bool is_using_color_transform() const;
147  bool packets_may_use_sop() const;
149  bool packets_use_eph() const;
151  bool get_block_vertical_causality() const;
152 
153  private:
155  };
156 
158  class param_qcd
159  {
160  public:
163 
165  void set_irrev_quant(float delta);
166 
167  private:
169  };
170 
172  //class param_qcc
173  //{
174  //public:
175  // OJPH_EXPORT
176  // param_qcc(local::param_qcc* p) : state(p) {}
177 
178  //private:
179  // local::param_qcc* state;
180  //};
181 
182 }
183 
184 #endif // !OJPH_PARAMS_H
OJPH_EXPORT size get_block_dims() const
OJPH_EXPORT int get_progression_order() const
OJPH_EXPORT bool is_using_color_transform() const
OJPH_EXPORT void set_num_decomposition(ui32 num_decompositions)
OJPH_EXPORT ui32 get_num_decompositions() const
OJPH_EXPORT size get_log_block_dims() const
OJPH_EXPORT bool packets_may_use_sop() const
OJPH_EXPORT size get_precinct_size(ui32 level_num) const
OJPH_EXPORT const char * get_progression_order_as_string() const
OJPH_EXPORT void set_precinct_size(int num_levels, size *precinct_size)
OJPH_EXPORT bool packets_use_eph() const
OJPH_EXPORT param_cod(local::param_cod *p)
Definition: ojph_params.h:111
local::param_cod * state
Definition: ojph_params.h:154
OJPH_EXPORT bool is_reversible() const
OJPH_EXPORT void set_progression_order(const char *name)
OJPH_EXPORT bool get_block_vertical_causality() const
OJPH_EXPORT void set_block_dims(ui32 width, ui32 height)
OJPH_EXPORT size get_log_precinct_size(ui32 level_num) const
OJPH_EXPORT int get_num_layers() const
OJPH_EXPORT void set_color_transform(bool color_transform)
OJPH_EXPORT void set_reversible(bool reversible)
OJPH_EXPORT param_qcd(local::param_qcd *p)
Definition: ojph_params.h:162
OJPH_EXPORT void set_irrev_quant(float delta)
local::param_qcd * state
Definition: ojph_params.h:168
OJPH_EXPORT void set_tile_size(size s)
Definition: ojph_params.cpp:66
OJPH_EXPORT point get_image_extent() const
OJPH_EXPORT void set_component(ui32 comp_num, const point &downsampling, ui32 bit_depth, bool is_signed)
Definition: ojph_params.cpp:93
OJPH_EXPORT void set_num_components(ui32 num_comps)
Definition: ojph_params.cpp:87
OJPH_EXPORT ui32 get_bit_depth(ui32 comp_num) const
OJPH_EXPORT void set_tile_offset(point offset)
Definition: ojph_params.cpp:80
OJPH_EXPORT point get_image_offset() const
local::param_siz * state
Definition: ojph_params.h:103
OJPH_EXPORT void set_image_offset(point offset)
Definition: ojph_params.cpp:73
OJPH_EXPORT param_siz(local::param_siz *p)
Definition: ojph_params.h:61
OJPH_EXPORT size get_tile_size() const
OJPH_EXPORT ui32 get_recon_height(ui32 comp_num) const
OJPH_EXPORT point get_downsampling(ui32 comp_num) const
OJPH_EXPORT void set_image_extent(point extent)
Definition: ojph_params.cpp:59
OJPH_EXPORT point get_tile_offset() const
OJPH_EXPORT ui32 get_recon_width(ui32 comp_num) const
OJPH_EXPORT bool is_signed(ui32 comp_num) const
OJPH_EXPORT ui32 get_num_components() const
uint32_t ui32
Definition: ojph_defs.h:54
#define OJPH_EXPORT
Definition: ojph_arch.h:202