Skip to content

Commit a88e337

Browse files
authored
Merge pull request #194 from aous72/restart
Adds an option to restart a codestream. See #194 for details.
2 parents caa3d3d + cd44004 commit a88e337

File tree

11 files changed

+747
-448
lines changed

11 files changed

+747
-448
lines changed

src/core/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,17 @@ else()
116116

117117
endif()
118118

119+
## Set debug postfix for different platforms
120+
if (MSVC)
121+
if (NOT DEFINED CMAKE_DEBUG_POSTFIX)
122+
set(CMAKE_DEBUG_POSTFIX "d")
123+
endif()
124+
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
125+
if (NOT DEFINED CMAKE_DEBUG_POSTFIX)
126+
set(CMAKE_DEBUG_POSTFIX "_d")
127+
endif()
128+
endif()
129+
119130
add_library(openjph ${SOURCES})
120131

121132
## The option BUILD_SHARED_LIBS

src/core/codestream/ojph_codestream.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
// This software is released under the 2-Clause BSD license, included
33
// below.
44
//
5-
// Copyright (c) 2019, Aous Naman
5+
// Copyright (c) 2019, Aous Naman
66
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
77
// Copyright (c) 2019, The University of New South Wales, Australia
8-
//
8+
//
99
// Redistribution and use in source and binary forms, with or without
1010
// modification, are permitted provided that the following conditions are
1111
// met:
12-
//
12+
//
1313
// 1. Redistributions of source code must retain the above copyright
1414
// notice, this list of conditions and the following disclaimer.
15-
//
15+
//
1616
// 2. Redistributions in binary form must reproduce the above copyright
1717
// notice, this list of conditions and the following disclaimer in the
1818
// documentation and/or other materials provided with the distribution.
19-
//
19+
//
2020
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
2121
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2222
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
@@ -57,7 +57,9 @@ namespace ojph {
5757
////////////////////////////////////////////////////////////////////////////
5858
codestream::~codestream()
5959
{
60-
if (state) delete state;
60+
if (state)
61+
delete state;
62+
state = NULL;
6163
}
6264

6365
////////////////////////////////////////////////////////////////////////////
@@ -66,6 +68,13 @@ namespace ojph {
6668
state = new local::codestream;
6769
}
6870

71+
////////////////////////////////////////////////////////////////////////////
72+
void codestream::restart()
73+
{
74+
assert(state != NULL);
75+
state->restart();
76+
}
77+
6978
////////////////////////////////////////////////////////////////////////////
7079
param_siz codestream::access_siz()
7180
{
@@ -103,7 +112,7 @@ namespace ojph {
103112
}
104113

105114
////////////////////////////////////////////////////////////////////////////
106-
void codestream::set_tilepart_divisions(bool at_resolutions,
115+
void codestream::set_tilepart_divisions(bool at_resolutions,
107116
bool at_components)
108117
{
109118
ui32 value = 0;
@@ -147,7 +156,7 @@ namespace ojph {
147156
}
148157

149158
////////////////////////////////////////////////////////////////////////////
150-
void codestream::write_headers(outfile_base *file,
159+
void codestream::write_headers(outfile_base *file,
151160
const comment_exchange* comments,
152161
ui32 num_comments)
153162
{

0 commit comments

Comments
 (0)