Loading...
Searching...
No Matches
ojph_params.h
Go to the documentation of this file.
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_params.h
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#ifndef OJPH_PARAMS_H
#define OJPH_PARAMS_H
#include "ojph_arch.h"
#include "ojph_base.h"
namespace ojph {
/***************************************************************************/
// defined here
class param_siz;
class param_cod;
class param_coc;
class param_qcd;
class param_cap;
class param_nlt;
class codestream;
/***************************************************************************/
// prototyping from local
namespace local {
struct param_siz;
struct param_cod;
struct param_coc;
struct param_qcd;
struct param_cap;
struct param_nlt;
class codestream;
}
/***************************************************************************/
class OJPH_EXPORT param_siz
{
public:
param_siz(local::param_siz *p) : state(p) {}
//setters
void set_image_extent(point extent);
void set_tile_size(size s);
void set_image_offset(point offset);
void set_tile_offset(point offset);
void set_num_components(ui32 num_comps);
void set_component(ui32 comp_num, const point& downsampling,
ui32 bit_depth, bool is_signed);
//getters
point get_image_extent() const;
point get_image_offset() const;
size get_tile_size() const;
point get_tile_offset() const;
ui32 get_num_components() const;
ui32 get_bit_depth(ui32 comp_num) const;
bool is_signed(ui32 comp_num) const;
point get_downsampling(ui32 comp_num) const;
//deeper getters
ui32 get_recon_width(ui32 comp_num) const;
ui32 get_recon_height(ui32 comp_num) const;
private:
local::param_siz* state;
};
/***************************************************************************/
class OJPH_EXPORT param_cod
{
public:
param_cod(local::param_cod* p) : state(p) {}
void set_num_decomposition(ui32 num_decompositions);
void set_block_dims(ui32 width, ui32 height);
void set_precinct_size(int num_levels, size* precinct_size);
void set_progression_order(const char *name);
void set_color_transform(bool color_transform);
void set_reversible(bool reversible);
param_coc get_coc(ui32 component_idx);
ui32 get_num_decompositions() const;
size get_block_dims() const;
size get_log_block_dims() const;
bool is_reversible() const;
size get_precinct_size(ui32 level_num) const;
size get_log_precinct_size(ui32 level_num) const;
int get_progression_order() const;
const char* get_progression_order_as_string() const;
int get_num_layers() const;
bool is_using_color_transform() const;
bool packets_may_use_sop() const;
bool packets_use_eph() const;
bool get_block_vertical_causality() const;
private:
local::param_cod* state;
};
/***************************************************************************/
class OJPH_EXPORT param_coc
{
public:
param_coc(local::param_cod* p) : state(p) {}
void set_num_decomposition(ui32 num_decompositions);
void set_block_dims(ui32 width, ui32 height);
void set_precinct_size(int num_levels, size* precinct_size);
void set_reversible(bool reversible);
ui32 get_num_decompositions() const;
size get_block_dims() const;
size get_log_block_dims() const;
bool is_reversible() const;
size get_precinct_size(ui32 level_num) const;
size get_log_precinct_size(ui32 level_num) const;
bool get_block_vertical_causality() const;
private:
local::param_cod* state;
};
/***************************************************************************/
class OJPH_EXPORT param_qcd
{
public:
param_qcd(local::param_qcd* p) : state(p) {}
void set_irrev_quant(float delta);
void set_irrev_quant(ui32 comp_idx, float delta);
private:
local::param_qcd* state;
};
/*************************************************************************/
class OJPH_EXPORT param_nlt
{
public:
enum special_comp_num : ui16 { ALL_COMPS = 65535 };
enum nonlinearity : ui8 {
OJPH_NLT_NO_NLT = 0, // supported
OJPH_NLT_GAMMA_STYLE_NLT = 1, // not supported
OJPH_NLT_LUT_STYLE_NLT = 2, // not supported
OJPH_NLT_BINARY_COMPLEMENT_NLT = 3, // supported
OJPH_NLT_UNDEFINED = 255 // This is used internally and is
// not part of the standard
};
public:
param_nlt(local::param_nlt* p) : state(p) {}
void set_nonlinear_transform(ui32 comp_num, ui8 nl_type);
bool get_nonlinear_transform(ui32 comp_num, ui8& bit_depth,
bool& is_signed, ui8& nl_type) const;
private:
local::param_nlt* state;
};
/***************************************************************************/
class OJPH_EXPORT comment_exchange
{
friend class local::codestream;
public:
comment_exchange() : data(NULL), len(0), Rcom(0) {}
void set_string(const char* str);
void set_data(const char* data, ui16 len);
private:
const char* data;
ui16 len;
ui16 Rcom;
};
}
#endif // !OJPH_PARAMS_H
ojph::codestream
The object represent a codestream.
Definition ojph_codestream.h:89
ojph::comment_exchange::comment_exchange
comment_exchange()
Definition ojph_params.h:294
ojph::comment_exchange::len
ui16 len
Definition ojph_params.h:300
ojph::comment_exchange::Rcom
ui16 Rcom
Definition ojph_params.h:301
ojph::comment_exchange::data
const char * data
Definition ojph_params.h:299
ojph::local::codestream
Definition ojph_codestream_local.h:69
ojph::param_coc
Definition ojph_params.h:136
ojph::param_coc::param_coc
param_coc(local::param_cod *p)
Definition ojph_params.h:138
ojph::param_coc::state
local::param_cod * state
Definition ojph_params.h:154
ojph::param_cod
Definition ojph_params.h:104
ojph::param_cod::state
local::param_cod * state
Definition ojph_params.h:131
ojph::param_cod::param_cod
param_cod(local::param_cod *p)
Definition ojph_params.h:106
ojph::param_nlt
non-linearity point transformation object (implements NLT marker segment)
Definition ojph_params.h:245
ojph::param_nlt::nonlinearity
nonlinearity
Definition ojph_params.h:248
ojph::param_nlt::OJPH_NLT_NO_NLT
@ OJPH_NLT_NO_NLT
Definition ojph_params.h:249
ojph::param_nlt::OJPH_NLT_BINARY_COMPLEMENT_NLT
@ OJPH_NLT_BINARY_COMPLEMENT_NLT
Definition ojph_params.h:252
ojph::param_nlt::OJPH_NLT_UNDEFINED
@ OJPH_NLT_UNDEFINED
Definition ojph_params.h:253
ojph::param_nlt::OJPH_NLT_LUT_STYLE_NLT
@ OJPH_NLT_LUT_STYLE_NLT
Definition ojph_params.h:251
ojph::param_nlt::OJPH_NLT_GAMMA_STYLE_NLT
@ OJPH_NLT_GAMMA_STYLE_NLT
Definition ojph_params.h:250
ojph::param_nlt::special_comp_num
special_comp_num
Definition ojph_params.h:247
ojph::param_nlt::ALL_COMPS
@ ALL_COMPS
Definition ojph_params.h:247
ojph::param_nlt::param_nlt
param_nlt(local::param_nlt *p)
Definition ojph_params.h:257
ojph::param_nlt::state
local::param_nlt * state
Definition ojph_params.h:286
ojph::param_qcd
Quantization parameters object.
Definition ojph_params.h:163
ojph::param_qcd::state
local::param_qcd * state
Definition ojph_params.h:191
ojph::param_qcd::param_qcd
param_qcd(local::param_qcd *p)
Definition ojph_params.h:165
ojph::param_siz
Definition ojph_params.h:71
ojph::param_siz::state
local::param_siz * state
Definition ojph_params.h:99
ojph::param_siz::param_siz
param_siz(local::param_siz *p)
Definition ojph_params.h:73
ojph::local
Definition ojph_bitbuffer_read.h:52
ojph
Definition ojph_img_io.h:52
ojph::ui16
uint16_t ui16
Definition ojph_defs.h:52
ojph::ui32
uint32_t ui32
Definition ojph_defs.h:54
ojph::ui8
uint8_t ui8
Definition ojph_defs.h:50
ojph_arch.h
OJPH_EXPORT
#define OJPH_EXPORT
Definition ojph_arch.h:135
ojph_base.h
ojph::local::param_cap
Definition ojph_params_local.h:880
ojph::local::param_cod
Definition ojph_params_local.h:385
ojph::local::param_nlt
Definition ojph_params_local.h:802
ojph::local::param_qcd
Definition ojph_params_local.h:677
ojph::local::param_siz
Definition ojph_params_local.h:166
ojph::point
Definition ojph_base.h:58
ojph::size
Definition ojph_base.h:48