Skip to content

Commit

Permalink
Started work on add windows of interest decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
aous72 committed Jan 8, 2024
1 parent 98a005e commit 8746516
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 74 deletions.
5 changes: 5 additions & 0 deletions src/core/codestream/ojph_codestream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ namespace ojph {
state->restrict_input_resolution(skipped_res_for_read,
skipped_res_for_recon);
}
////////////////////////////////////////////////////////////////////////////
void codestream::restrict_recon_region(rect region)
{
state->restrict_recon_region(region);
}

////////////////////////////////////////////////////////////////////////////
void codestream::create()
Expand Down
6 changes: 6 additions & 0 deletions src/core/codestream/ojph_codestream_local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,12 @@ namespace ojph {
siz.set_skipped_resolutions(skipped_res_for_recon);
}

//////////////////////////////////////////////////////////////////////////
void codestream::restrict_recon_region(rect region)
{

}

//////////////////////////////////////////////////////////////////////////
void codestream::enable_resilience()
{
Expand Down
1 change: 1 addition & 0 deletions src/core/codestream/ojph_codestream_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ namespace ojph {
void read_headers(infile_base *file);
void restrict_input_resolution(ui32 skipped_res_for_data,
ui32 skipped_res_for_recon);
void restrict_recon_region(rect region);
void read();
void set_planar(int planar);
void set_profile(const char *s);
Expand Down
25 changes: 4 additions & 21 deletions src/core/common/ojph_codestream.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,59 +59,42 @@ namespace ojph {
class comment_exchange;
class mem_fixed_allocator;
struct point;
struct rect;
struct line_buf;
class outfile_base;
class infile_base;

////////////////////////////////////////////////////////////////////////////
class codestream
class OJPH_EXPORT codestream
{
public:
OJPH_EXPORT
codestream();
OJPH_EXPORT
~codestream();

OJPH_EXPORT
void set_planar(bool planar);
OJPH_EXPORT
void set_profile(const char* s);
OJPH_EXPORT
void set_tilepart_divisions(bool at_resolutions, bool at_components);
OJPH_EXPORT
void request_tlm_marker(bool needed);

OJPH_EXPORT
void write_headers(outfile_base *file,
const comment_exchange* comments = NULL,
ui32 num_comments = 0);
OJPH_EXPORT
line_buf* exchange(line_buf* line, ui32& next_component);
OJPH_EXPORT
void flush();

OJPH_EXPORT
void enable_resilience(); // before read_headers
OJPH_EXPORT
void read_headers(infile_base *file); // before resolution restrictions
OJPH_EXPORT
void restrict_input_resolution(ui32 skipped_res_for_data,
ui32 skipped_res_for_recon); // before create
OJPH_EXPORT
ui32 skipped_res_for_recon); //before create
void restrict_recon_region(rect region); // before create
void create();
OJPH_EXPORT
line_buf* pull(ui32 &comp_num);

OJPH_EXPORT
void close();

OJPH_EXPORT
param_siz access_siz();
OJPH_EXPORT
param_cod access_cod();
OJPH_EXPORT
param_qcd access_qcd();
OJPH_EXPORT
bool is_planar() const;

private:
Expand Down
12 changes: 4 additions & 8 deletions src/core/common/ojph_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,16 @@ namespace ojph {
};

////////////////////////////////////////////////////////////////////////////
class message_base {
class OJPH_EXPORT message_base {
public:
OJPH_EXPORT
virtual void operator() (int warn_code, const char* file_name,
int line_num, const char *fmt, ...) = 0;
};

////////////////////////////////////////////////////////////////////////////
class message_info : public message_base
class OJPH_EXPORT message_info : public message_base
{
public:
OJPH_EXPORT
virtual void operator() (int info_code, const char* file_name,
int line_num, const char* fmt, ...);
};
Expand All @@ -78,10 +76,9 @@ namespace ojph {
message_info& get_info();

////////////////////////////////////////////////////////////////////////////
class message_warning : public message_base
class OJPH_EXPORT message_warning : public message_base
{
public:
OJPH_EXPORT
virtual void operator() (int warn_code, const char* file_name,
int line_num, const char* fmt, ...);
};
Expand All @@ -95,10 +92,9 @@ namespace ojph {
message_warning& get_warning();

////////////////////////////////////////////////////////////////////////////
class message_error : public message_base
class OJPH_EXPORT message_error : public message_base
{
public:
OJPH_EXPORT
virtual void operator() (int warn_code, const char* file_name,
int line_num, const char *fmt, ...);
};
Expand Down
49 changes: 4 additions & 45 deletions src/core/common/ojph_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,129 +55,88 @@ namespace ojph {
}

////////////////////////////////////////////////////////////////////////////
class param_siz
class OJPH_EXPORT param_siz
{
public:
OJPH_EXPORT
param_siz(local::param_siz *p) : state(p) {}

//setters
OJPH_EXPORT
void set_image_extent(point extent);
OJPH_EXPORT
void set_tile_size(size s);
OJPH_EXPORT
void set_image_offset(point offset);
OJPH_EXPORT
void set_tile_offset(point offset);
OJPH_EXPORT
void set_num_components(ui32 num_comps);
OJPH_EXPORT
void set_component(ui32 comp_num, const point& downsampling,
ui32 bit_depth, bool is_signed);

//getters
OJPH_EXPORT
point get_image_extent() const;
OJPH_EXPORT
point get_image_offset() const;
OJPH_EXPORT
size get_tile_size() const;
OJPH_EXPORT
point get_tile_offset() const;
OJPH_EXPORT
ui32 get_num_components() const;
OJPH_EXPORT
ui32 get_bit_depth(ui32 comp_num) const;
OJPH_EXPORT
bool is_signed(ui32 comp_num) const;
OJPH_EXPORT
point get_downsampling(ui32 comp_num) const;

//deeper getters
OJPH_EXPORT
ui32 get_recon_width(ui32 comp_num) const;
OJPH_EXPORT
ui32 get_recon_height(ui32 comp_num) const;

private:
local::param_siz* state;
};

////////////////////////////////////////////////////////////////////////////
class param_cod
class OJPH_EXPORT param_cod
{
public:
OJPH_EXPORT
param_cod(local::param_cod* p) : state(p) {}

OJPH_EXPORT
void set_num_decomposition(ui32 num_decompositions);
OJPH_EXPORT
void set_block_dims(ui32 width, ui32 height);
OJPH_EXPORT
void set_precinct_size(int num_levels, size* precinct_size);
OJPH_EXPORT
void set_progression_order(const char *name);
OJPH_EXPORT
void set_color_transform(bool color_transform);
OJPH_EXPORT
void set_reversible(bool reversible);

OJPH_EXPORT
ui32 get_num_decompositions() const;
OJPH_EXPORT
size get_block_dims() const;
OJPH_EXPORT
size get_log_block_dims() const;
OJPH_EXPORT
bool is_reversible() const;
OJPH_EXPORT
size get_precinct_size(ui32 level_num) const;
OJPH_EXPORT
size get_log_precinct_size(ui32 level_num) const;
OJPH_EXPORT
int get_progression_order() const;
OJPH_EXPORT
const char* get_progression_order_as_string() const;
OJPH_EXPORT
int get_num_layers() const;
OJPH_EXPORT
bool is_using_color_transform() const;
OJPH_EXPORT
bool packets_may_use_sop() const;
OJPH_EXPORT
bool packets_use_eph() const;
OJPH_EXPORT
bool get_block_vertical_causality() const;

private:
local::param_cod* state;
};

////////////////////////////////////////////////////////////////////////////
class param_qcd
class OJPH_EXPORT param_qcd
{
public:
OJPH_EXPORT
param_qcd(local::param_qcd* p) : state(p) {}

OJPH_EXPORT
void set_irrev_quant(float delta);

private:
local::param_qcd* state;
};

////////////////////////////////////////////////////////////////////////////
class comment_exchange
class OJPH_EXPORT comment_exchange
{
friend class local::codestream;
public:
comment_exchange() : data(NULL), len(0), Rcom(0) {}
OJPH_EXPORT
void set_string(char* str);
OJPH_EXPORT
void set_data(char* data, ui16 len);

private:
Expand Down

0 comments on commit 8746516

Please sign in to comment.