Skip to content

Commit d10f2ca

Browse files
authored
Merge pull request #202 from aous72/a_few_pr
Improves installation of the library. Adds a new way to read the mem_file file size.
2 parents 6a66602 + 4bb038d commit d10f2ca

File tree

5 files changed

+24
-7
lines changed

5 files changed

+24
-7
lines changed

src/core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ endif()
137137
## include library version/name
138138
set_target_properties(openjph PROPERTIES POSITION_INDEPENDENT_CODE ON)
139139
target_compile_definitions(openjph PUBLIC _FILE_OFFSET_BITS=64)
140-
target_include_directories(openjph PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common> $<INSTALL_INTERFACE:include/openjph>)
140+
target_include_directories(openjph PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common> $<INSTALL_INTERFACE:include>)
141141

142142
if (MSVC)
143143
set(OJPH_LIB_NAME_STRING "openjph.${OPENJPH_VERSION_MAJOR}.${OPENJPH_VERSION_MINOR}")

src/core/codestream/ojph_params_local.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,7 @@ namespace ojph {
10851085
avail = NULL;
10861086
d = d_store;
10871087
max_steps = sizeof(d_store) / sizeof(lifting_step);
1088+
this->top_atk = top_atk;
10881089
this->type = type;
10891090
init(this);
10901091
}
@@ -1162,7 +1163,7 @@ namespace ojph {
11621163
float Katk; // only for irreversible scaling factor K
11631164
ui8 Natk; // number of lifting steps
11641165
lifting_step* d; // pointer to data, initialized to d_store
1165-
int max_steps; // maximum number of steps without memory allocation
1166+
ui32 max_steps; // maximum number of steps without memory allocation
11661167
lifting_step d_store[6]; // lifting step coefficient
11671168
param_atk* next; // used for chaining if more than one atk segment
11681169
// exist in the codestream

src/core/common/ojph_file.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,21 @@ namespace ojph {
203203
*/
204204
void write_to_file(const char *file_name) const;
205205

206+
/**
207+
* @brief Call this function to get the used size of the memory file.
208+
*
209+
* @return the used size of the memory file in bytes.
210+
*/
211+
size_t get_used_size() const { return used_size; }
212+
213+
/**
214+
* @brief Call this function to get the total buffer size of the memory
215+
* file including unused space (this is the allocated memory).
216+
*
217+
* @return the full size of the memory file in bytes.
218+
*/
219+
size_t get_buf_size() const { return buf_size; }
220+
206221
private:
207222
/**
208223
* @brief This function expands storage by x1.5 needed space.

src/core/common/ojph_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@
3434
//***************************************************************************/
3535

3636
#define OPENJPH_VERSION_MAJOR 0
37-
#define OPENJPH_VERSION_MINOR 22
37+
#define OPENJPH_VERSION_MINOR 23
3838
#define OPENJPH_VERSION_PATCH 0

src/openjph.pc.in

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
prefix=@CMAKE_INSTALL_PREFIX@
2+
libdir=@PKG_CONFIG_LIBDIR@
3+
includedir=@PKG_CONFIG_INCLUDEDIR@
4+
15
Name: @PROJECT_NAME@
26
Description: @PROJECT_DESCRIPTION@
37
Version: @PROJECT_VERSION@
48
Requires: @PKG_CONFIG_REQUIRES@
5-
prefix=@CMAKE_INSTALL_PREFIX@
6-
includedir=@PKG_CONFIG_INCLUDEDIR@
7-
libdir=@PKG_CONFIG_LIBDIR@
89
Libs: -L${libdir} -lopenjph
9-
Cflags: -I${includedir}
10+
Cflags: -I${includedir} -D_FILE_OFFSET_BITS=64

0 commit comments

Comments
 (0)