Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add accessors for tilepart division #120

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/core/codestream/ojph_codestream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,20 @@ namespace ojph {
state->set_tilepart_divisions(value);
}

////////////////////////////////////////////////////////////////////////////
bool codestream::is_tilepart_division_at_resolutions()
{
ui32 res = state->get_tilepart_div() & OJPH_TILEPART_RESOLUTIONS;
return res ? true : false;
}

////////////////////////////////////////////////////////////////////////////
bool codestream::is_tilepart_division_at_components()
{
ui32 comp = state->get_tilepart_div() & OJPH_TILEPART_COMPONENTS;
return comp ? true : false;
}

////////////////////////////////////////////////////////////////////////////
void codestream::request_tlm_marker(bool needed)
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/codestream/ojph_codestream_local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace ojph {
employ_color_transform = false;
planar = -1;
profile = OJPH_PN_UNDEFINED;
tilepart_div = OJPH_TILEPART_NODIVSIONS;
tilepart_div = OJPH_TILEPART_NO_DIVISIONS;
need_tlm = false;

cur_comp = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/core/codestream/ojph_params_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ namespace ojph {
const char OJPH_PN_STRING_IMF[] = "IMF";

////////////////////////////////////////////////////////////////////////////
enum OJPH_TILEPART_DIVISONS: ui32 {
OJPH_TILEPART_NODIVSIONS = 0x0, // no divisions to tile parts
enum OJPH_TILEPART_DIVISIONS: ui32 {
OJPH_TILEPART_NO_DIVISIONS = 0x0, // no divisions to tile parts
OJPH_TILEPART_RESOLUTIONS = 0x1,
OJPH_TILEPART_COMPONENTS = 0x2,
OJPH_TILEPART_LAYERS = 0x4, // these are meaningless with HTJ2K
Expand Down
6 changes: 3 additions & 3 deletions src/core/codestream/ojph_tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ namespace ojph {
//////////////////////////////////////////////////////////////////////////
void tile::fill_tlm(param_tlm *tlm)
{
if (tilepart_div == OJPH_TILEPART_NODIVSIONS) {
if (tilepart_div == OJPH_TILEPART_NO_DIVISIONS) {
tlm->set_next_pair(sot.get_tile_index(), this->num_bytes);
}
else if (tilepart_div == OJPH_TILEPART_RESOLUTIONS)
Expand Down Expand Up @@ -471,7 +471,7 @@ namespace ojph {
max_decompositions = ojph_max(max_decompositions,
comps[c].get_num_decompositions());

if (tilepart_div == OJPH_TILEPART_NODIVSIONS)
if (tilepart_div == OJPH_TILEPART_NO_DIVISIONS)
{
//write tile header
if (!sot.write(file, this->num_bytes))
Expand All @@ -487,7 +487,7 @@ namespace ojph {
//sequence the writing of precincts according to progression order
if (prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP)
{
if (tilepart_div == OJPH_TILEPART_NODIVSIONS)
if (tilepart_div == OJPH_TILEPART_NO_DIVISIONS)
{
for (ui32 r = 0; r <= max_decompositions; ++r)
for (ui32 c = 0; c < num_comps; ++c)
Expand Down
5 changes: 5 additions & 0 deletions src/core/common/ojph_codestream.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ namespace ojph {
void set_profile(const char* s);
OJPH_EXPORT
void set_tilepart_divisions(bool at_resolutions, bool at_components);
OJPH_EXPORT
bool is_tilepart_division_at_resolutions();
OJPH_EXPORT
bool is_tilepart_division_at_components();

OJPH_EXPORT
void request_tlm_marker(bool needed);
OJPH_EXPORT
Expand Down
Loading