[trunk] Fix compilation:

- using mingw32 compiler (missing exported symbols)
- using -fvisibility=hidden (gcc on UNIX)
This commit is contained in:
Mathieu Malaterre 2012-10-15 09:44:34 +00:00
parent b24cf8d157
commit dff377a741
32 changed files with 194 additions and 161 deletions

View File

@ -17,13 +17,13 @@ include_directories(
${TIFF_INCLUDE_DIRNAME} ${TIFF_INCLUDE_DIRNAME}
) )
IF(WIN32) if(WIN32)
IF(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS) add_definitions(-DOPJ_EXPORTS)
ELSE(BUILD_SHARED_LIBS) else()
ADD_DEFINITIONS(-DOPJ_STATIC) add_definitions(-DOPJ_STATIC)
ENDIF(BUILD_SHARED_LIBS) endif()
ENDIF(WIN32) endif()
# Loop over all executables: # Loop over all executables:
FOREACH(exe opj_jp3d_compress opj_jp3d_decompress) FOREACH(exe opj_jp3d_compress opj_jp3d_decompress)
@ -38,4 +38,4 @@ FOREACH(exe opj_jp3d_compress opj_jp3d_decompress)
EXPORT OpenJP3DTargets EXPORT OpenJP3DTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
) )
ENDFOREACH(exe) endforeach()

View File

@ -50,6 +50,11 @@ set(EXES
) )
foreach(exe ${EXES}) foreach(exe ${EXES})
if(${exe} STREQUAL "opj_jpip_compress") if(${exe} STREQUAL "opj_jpip_compress")
include_directories(
${Z_INCLUDE_DIRNAME}
${PNG_INCLUDE_DIRNAME}
${TIFF_INCLUDE_DIRNAME}
)
add_executable(${exe} ${exe}.c add_executable(${exe} ${exe}.c
${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.c ${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.c
${OPENJPEG_SOURCE_DIR}/src/bin/jp2/convert.c ${OPENJPEG_SOURCE_DIR}/src/bin/jp2/convert.c

View File

@ -47,6 +47,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "opj_config.h"
#include "openjpip.h" #include "openjpip.h"
#ifdef _WIN32 #ifdef _WIN32

View File

@ -3,7 +3,11 @@
set(common_SRCS ${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.c) set(common_SRCS ${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.c)
if(WIN32) if(WIN32)
add_definitions(-DOPJ_STATIC) if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS)
else()
add_definitions(-DOPJ_STATIC)
endif()
endif() endif()
# Headers file are located here: # Headers file are located here:

View File

@ -29,6 +29,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "opj_config.h"
#include "openjpeg.h" #include "openjpeg.h"
#include "j2k_lib.h" #include "j2k_lib.h"
#include "cio.h" #include "cio.h"

View File

@ -28,7 +28,7 @@ set(OPENJPEG_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/t2.c ${CMAKE_CURRENT_SOURCE_DIR}/t2.c
${CMAKE_CURRENT_SOURCE_DIR}/tcd.c ${CMAKE_CURRENT_SOURCE_DIR}/tcd.c
${CMAKE_CURRENT_SOURCE_DIR}/tgt.c ${CMAKE_CURRENT_SOURCE_DIR}/tgt.c
${CMAKE_CURRENT_SOURCE_DIR}/function_list.c ${CMAKE_CURRENT_SOURCE_DIR}/function_list.c
) )
# Build the library # Build the library

View File

@ -154,7 +154,7 @@ unsigned char cio_bytein(opj_cio_t *cio) {
* v : value to write * v : value to write
* n : number of bytes to write * n : number of bytes to write
*/ */
unsigned int cio_write(opj_cio_t *cio, unsigned long long int v, int n) { unsigned int OPJ_CALLCONV cio_write(opj_cio_t *cio, unsigned long long int v, int n) {
int i; int i;
for (i = n - 1; i >= 0; i--) { for (i = n - 1; i >= 0; i--) {
if( !cio_byteout(cio, (unsigned char) ((v >> (i << 3)) & 0xff)) ) if( !cio_byteout(cio, (unsigned char) ((v >> (i << 3)) & 0xff)) )
@ -171,7 +171,7 @@ unsigned int cio_write(opj_cio_t *cio, unsigned long long int v, int n) {
* *
* return : value of the n bytes read * return : value of the n bytes read
*/ */
unsigned int cio_read(opj_cio_t *cio, int n) { unsigned int OPJ_CALLCONV cio_read(opj_cio_t *cio, int n) {
int i; int i;
unsigned int v = 0; unsigned int v = 0;
for (i = n - 1; i >= 0; i--) { for (i = n - 1; i >= 0; i--) {
@ -186,13 +186,13 @@ unsigned int cio_read(opj_cio_t *cio, int n) {
* *
* n : number of bytes to skip * n : number of bytes to skip
*/ */
void cio_skip(opj_cio_t *cio, int n) { void OPJ_CALLCONV cio_skip(opj_cio_t *cio, int n) {
cio->bp += n; cio->bp += n;
} }
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
void opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes) void OPJ_CALLCONV opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes)
{ {
const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + p_nb_bytes; const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + p_nb_bytes;
@ -201,7 +201,7 @@ void opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_n
memcpy(p_buffer,l_data_ptr,p_nb_bytes); memcpy(p_buffer,l_data_ptr,p_nb_bytes);
} }
void opj_write_bytes_LE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes) void OPJ_CALLCONV opj_write_bytes_LE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes)
{ {
const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + p_nb_bytes - 1; const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + p_nb_bytes - 1;
OPJ_UINT32 i; OPJ_UINT32 i;
@ -213,7 +213,7 @@ void opj_write_bytes_LE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_n
} }
} }
void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes) void OPJ_CALLCONV opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes)
{ {
OPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value); OPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value);
@ -223,7 +223,7 @@ void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT
memcpy(l_data_ptr+4-p_nb_bytes,p_buffer,p_nb_bytes); memcpy(l_data_ptr+4-p_nb_bytes,p_buffer,p_nb_bytes);
} }
void opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes) void OPJ_CALLCONV opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes)
{ {
OPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value) + p_nb_bytes-1; OPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value) + p_nb_bytes-1;
OPJ_UINT32 i; OPJ_UINT32 i;
@ -242,7 +242,7 @@ void opj_write_double_BE(OPJ_BYTE * p_buffer, OPJ_FLOAT64 p_value)
memcpy(p_buffer,l_data_ptr,sizeof(OPJ_FLOAT64)); memcpy(p_buffer,l_data_ptr,sizeof(OPJ_FLOAT64));
} }
void opj_write_double_LE(OPJ_BYTE * p_buffer, OPJ_FLOAT64 p_value) void OPJ_CALLCONV opj_write_double_LE(OPJ_BYTE * p_buffer, OPJ_FLOAT64 p_value)
{ {
const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + sizeof(OPJ_FLOAT64) - 1; const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + sizeof(OPJ_FLOAT64) - 1;
OPJ_UINT32 i; OPJ_UINT32 i;
@ -404,7 +404,7 @@ OPJ_API void OPJ_CALLCONV opj_stream_set_user_data_length(opj_stream_t* p_stream
l_stream->m_user_data_length = data_length; l_stream->m_user_data_length = data_length;
} }
OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, opj_event_mgr_t * p_event_mgr) OPJ_SIZE_T OPJ_CALLCONV opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, opj_event_mgr_t * p_event_mgr)
{ {
OPJ_SIZE_T l_read_nb_bytes = 0; OPJ_SIZE_T l_read_nb_bytes = 0;
if (p_stream->m_bytes_in_buffer >= p_size) { if (p_stream->m_bytes_in_buffer >= p_size) {
@ -511,7 +511,7 @@ OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_bu
} }
} }
OPJ_SIZE_T opj_stream_write_data (opj_stream_private_t * p_stream, OPJ_SIZE_T OPJ_CALLCONV opj_stream_write_data (opj_stream_private_t * p_stream,
const OPJ_BYTE * p_buffer, const OPJ_BYTE * p_buffer,
OPJ_SIZE_T p_size, OPJ_SIZE_T p_size,
opj_event_mgr_t * p_event_mgr) opj_event_mgr_t * p_event_mgr)
@ -683,7 +683,7 @@ OPJ_OFF_T opj_stream_write_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_si
return l_skip_nb_bytes; return l_skip_nb_bytes;
} }
OPJ_OFF_T opj_stream_tell (const opj_stream_private_t * p_stream) OPJ_OFF_T OPJ_CALLCONV opj_stream_tell (const opj_stream_private_t * p_stream)
{ {
return p_stream->m_byte_offset; return p_stream->m_byte_offset;
} }
@ -697,7 +697,7 @@ OPJ_OFF_T opj_stream_get_number_byte_left (const opj_stream_private_t * p_stream
0; 0;
} }
OPJ_OFF_T opj_stream_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, opj_event_mgr_t * p_event_mgr) OPJ_OFF_T OPJ_CALLCONV opj_stream_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, opj_event_mgr_t * p_event_mgr)
{ {
assert(p_size >= 0); assert(p_size >= 0);
return p_stream->m_opj_skip(p_stream,p_size,p_event_mgr); return p_stream->m_opj_skip(p_stream,p_size,p_event_mgr);
@ -744,13 +744,13 @@ opj_bool opj_stream_write_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_siz
return OPJ_TRUE; return OPJ_TRUE;
} }
opj_bool opj_stream_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr) opj_bool OPJ_CALLCONV opj_stream_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr)
{ {
assert(p_size >= 0); assert(p_size >= 0);
return p_stream->m_opj_seek(p_stream,p_size,p_event_mgr); return p_stream->m_opj_seek(p_stream,p_size,p_event_mgr);
} }
opj_bool opj_stream_has_seek (const opj_stream_private_t * p_stream) opj_bool OPJ_CALLCONV opj_stream_has_seek (const opj_stream_private_t * p_stream)
{ {
return p_stream->m_seek_fn != opj_stream_default_seek; return p_stream->m_seek_fn != opj_stream_default_seek;
} }

View File

@ -71,20 +71,20 @@ Write some bytes
@param n Number of bytes to write @param n Number of bytes to write
@return Returns the number of bytes written or 0 if an error occured @return Returns the number of bytes written or 0 if an error occured
*/ */
unsigned int cio_write(opj_cio_t *cio, unsigned long long int v, int n); OPJ_API unsigned int OPJ_CALLCONV cio_write(opj_cio_t *cio, unsigned long long int v, int n);
/** /**
Read some bytes Read some bytes
@param cio CIO handle @param cio CIO handle
@param n Number of bytes to read @param n Number of bytes to read
@return Returns the value of the n bytes read @return Returns the value of the n bytes read
*/ */
unsigned int cio_read(opj_cio_t *cio, int n); OPJ_API unsigned int OPJ_CALLCONV cio_read(opj_cio_t *cio, int n);
/** /**
Skip some bytes Skip some bytes
@param cio CIO handle @param cio CIO handle
@param n Number of bytes to skip @param n Number of bytes to skip
*/ */
void cio_skip(opj_cio_t *cio, int n); OPJ_API void OPJ_CALLCONV cio_skip(opj_cio_t *cio, int n);
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/*@}*/ /*@}*/
@ -206,7 +206,7 @@ opj_stream_private_t;
* @param p_value the value to write * @param p_value the value to write
* @param p_nb_bytes the number of bytes to write * @param p_nb_bytes the number of bytes to write
*/ */
void opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes); OPJ_API void OPJ_CALLCONV opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes);
/** /**
* Reads some bytes from the given data buffer, this function is used in Big Endian cpus. * Reads some bytes from the given data buffer, this function is used in Big Endian cpus.
@ -215,7 +215,7 @@ void opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_n
* @param p_nb_bytes the nb bytes to read. * @param p_nb_bytes the nb bytes to read.
* @return the number of bytes read or -1 if an error occured. * @return the number of bytes read or -1 if an error occured.
*/ */
void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes); OPJ_API void OPJ_CALLCONV opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes);
/** /**
* Write some bytes to the given data buffer, this function is used in Little Endian cpus. * Write some bytes to the given data buffer, this function is used in Little Endian cpus.
@ -224,7 +224,7 @@ void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT
* @param p_nb_bytes the number of bytes to write * @param p_nb_bytes the number of bytes to write
* @return the number of bytes written or -1 if an error occured * @return the number of bytes written or -1 if an error occured
*/ */
void opj_write_bytes_LE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes); OPJ_API void OPJ_CALLCONV opj_write_bytes_LE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes);
/** /**
* Reads some bytes from the given data buffer, this function is used in Little Endian cpus. * Reads some bytes from the given data buffer, this function is used in Little Endian cpus.
@ -233,7 +233,7 @@ void opj_write_bytes_LE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_n
* @param p_nb_bytes the nb bytes to read. * @param p_nb_bytes the nb bytes to read.
* @return the number of bytes read or -1 if an error occured. * @return the number of bytes read or -1 if an error occured.
*/ */
void opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes); OPJ_API void OPJ_CALLCONV opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes);
/** /**
@ -241,7 +241,7 @@ void opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT
* @param p_buffer pointer the data buffer to write data to. * @param p_buffer pointer the data buffer to write data to.
* @param p_value the value to write * @param p_value the value to write
*/ */
void opj_write_double_LE(OPJ_BYTE * p_buffer, OPJ_FLOAT64 p_value); OPJ_API void OPJ_CALLCONV opj_write_double_LE(OPJ_BYTE * p_buffer, OPJ_FLOAT64 p_value);
/*** /***
* Write some bytes to the given data buffer, this function is used in Big Endian cpus. * Write some bytes to the given data buffer, this function is used in Big Endian cpus.
@ -300,7 +300,7 @@ void opj_write_float_BE(OPJ_BYTE * p_buffer, OPJ_FLOAT32 p_value);
* @param p_event_mgr the user event manager to be notified of special events. * @param p_event_mgr the user event manager to be notified of special events.
* @return the number of bytes read, or -1 if an error occured or if the stream is at the end. * @return the number of bytes read, or -1 if an error occured or if the stream is at the end.
*/ */
OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr); OPJ_API OPJ_SIZE_T OPJ_CALLCONV opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr);
/** /**
* Writes some bytes to the stream. * Writes some bytes to the stream.
@ -310,7 +310,7 @@ OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_bu
* @param p_event_mgr the user event manager to be notified of special events. * @param p_event_mgr the user event manager to be notified of special events.
* @return the number of bytes writtent, or -1 if an error occured. * @return the number of bytes writtent, or -1 if an error occured.
*/ */
OPJ_SIZE_T opj_stream_write_data (opj_stream_private_t * p_stream,const OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr); OPJ_API OPJ_SIZE_T OPJ_CALLCONV opj_stream_write_data (opj_stream_private_t * p_stream,const OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr);
/** /**
* Writes the content of the stream buffer to the stream. * Writes the content of the stream buffer to the stream.
@ -327,7 +327,7 @@ opj_bool opj_stream_flush (opj_stream_private_t * p_stream, struct opj_event_mgr
* @param p_event_mgr the user event manager to be notified of special events. * @param p_event_mgr the user event manager to be notified of special events.
* @return the number of bytes skipped, or -1 if an error occured. * @return the number of bytes skipped, or -1 if an error occured.
*/ */
OPJ_OFF_T opj_stream_skip (opj_stream_private_t * p_stream,OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr); OPJ_API OPJ_OFF_T OPJ_CALLCONV opj_stream_skip (opj_stream_private_t * p_stream,OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
/** /**
* Tells the byte offset on the stream (similar to ftell). * Tells the byte offset on the stream (similar to ftell).
@ -336,7 +336,7 @@ OPJ_OFF_T opj_stream_skip (opj_stream_private_t * p_stream,OPJ_OFF_T p_size, str
* *
* @return the current position o fthe stream. * @return the current position o fthe stream.
*/ */
OPJ_OFF_T opj_stream_tell (const opj_stream_private_t * p_stream); OPJ_API OPJ_OFF_T OPJ_CALLCONV opj_stream_tell (const opj_stream_private_t * p_stream);
/** /**
@ -391,12 +391,12 @@ opj_bool opj_stream_write_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_siz
* @param p_event_mgr the user event manager to be notified of special events. * @param p_event_mgr the user event manager to be notified of special events.
* @return true if the stream is seekable. * @return true if the stream is seekable.
*/ */
opj_bool opj_stream_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr); OPJ_API opj_bool OPJ_CALLCONV opj_stream_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
/** /**
* Tells if the given stream is seekable. * Tells if the given stream is seekable.
*/ */
opj_bool opj_stream_has_seek (const opj_stream_private_t * p_stream); OPJ_API opj_bool OPJ_CALLCONV opj_stream_has_seek (const opj_stream_private_t * p_stream);
OPJ_SIZE_T opj_stream_default_read (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data); OPJ_SIZE_T opj_stream_default_read (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data);
OPJ_SIZE_T opj_stream_default_write (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data); OPJ_SIZE_T opj_stream_default_write (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data);

View File

@ -117,7 +117,7 @@ opj_bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ..
} }
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
opj_bool opj_event_msg_v2(opj_event_mgr_t* p_event_mgr, int event_type, const char *fmt, ...) { opj_bool OPJ_CALLCONV opj_event_msg_v2(opj_event_mgr_t* p_event_mgr, int event_type, const char *fmt, ...) {
#define MSG_SIZE 512 /* 512 bytes should be more than enough for a short message */ #define MSG_SIZE 512 /* 512 bytes should be more than enough for a short message */
opj_msg_callback msg_handler = 00; opj_msg_callback msg_handler = 00;
void * l_data = 00; void * l_data = 00;
@ -167,7 +167,7 @@ opj_bool opj_event_msg_v2(opj_event_mgr_t* p_event_mgr, int event_type, const ch
return OPJ_TRUE; return OPJ_TRUE;
} }
void opj_set_default_event_handler(opj_event_mgr_t * p_manager) void OPJ_CALLCONV opj_set_default_event_handler(opj_event_mgr_t * p_manager)
{ {
p_manager->m_error_data = 00; p_manager->m_error_data = 00;
p_manager->m_warning_data = 00; p_manager->m_warning_data = 00;

View File

@ -89,13 +89,13 @@ opj_bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ..
* *
* @return Returns true if successful, returns false otherwise * @return Returns true if successful, returns false otherwise
*/ */
opj_bool opj_event_msg_v2(opj_event_mgr_t* event_mgr, int event_type, const char *fmt, ...); OPJ_API opj_bool OPJ_CALLCONV opj_event_msg_v2(opj_event_mgr_t* event_mgr, int event_type, const char *fmt, ...);
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/** /**
* Set the event manager with the default callback function for the 3 levels. * Set the event manager with the default callback function for the 3 levels.
*/ */
void opj_set_default_event_handler(opj_event_mgr_t * p_manager); OPJ_API void OPJ_CALLCONV opj_set_default_event_handler(opj_event_mgr_t * p_manager);
/*@}*/ /*@}*/

View File

@ -67,7 +67,7 @@ void opj_procedure_list_destroy(opj_procedure_list_t * p_list)
opj_free(p_list); opj_free(p_list);
} }
opj_bool opj_procedure_list_add_procedure (opj_procedure_list_t * p_validation_list, opj_procedure p_procedure) opj_bool OPJ_CALLCONV opj_procedure_list_add_procedure (opj_procedure_list_t * p_validation_list, opj_procedure p_procedure)
{ {
if (p_validation_list->m_nb_max_procedures == p_validation_list->m_nb_procedures) if (p_validation_list->m_nb_max_procedures == p_validation_list->m_nb_procedures)
{ {
@ -98,17 +98,17 @@ opj_bool opj_procedure_list_add_procedure (opj_procedure_list_t * p_validation_
return OPJ_TRUE; return OPJ_TRUE;
} }
OPJ_UINT32 opj_procedure_list_get_nb_procedures (opj_procedure_list_t * p_validation_list) OPJ_UINT32 OPJ_CALLCONV opj_procedure_list_get_nb_procedures (opj_procedure_list_t * p_validation_list)
{ {
return p_validation_list->m_nb_procedures; return p_validation_list->m_nb_procedures;
} }
opj_procedure* opj_procedure_list_get_first_procedure (opj_procedure_list_t * p_validation_list) opj_procedure* OPJ_CALLCONV opj_procedure_list_get_first_procedure (opj_procedure_list_t * p_validation_list)
{ {
return p_validation_list->m_procedures; return p_validation_list->m_procedures;
} }
void opj_procedure_list_clear (opj_procedure_list_t * p_validation_list) void OPJ_CALLCONV opj_procedure_list_clear (opj_procedure_list_t * p_validation_list)
{ {
p_validation_list->m_nb_procedures = 0; p_validation_list->m_nb_procedures = 0;
} }

View File

@ -90,7 +90,7 @@ void opj_procedure_list_destroy(opj_procedure_list_t * p_list);
* *
* @return OPJ_FALSE if the procedure could ne added. * @return OPJ_FALSE if the procedure could ne added.
*/ */
opj_bool opj_procedure_list_add_procedure (opj_procedure_list_t * p_validation_list, opj_procedure p_procedure); OPJ_API opj_bool OPJ_CALLCONV opj_procedure_list_add_procedure (opj_procedure_list_t * p_validation_list, opj_procedure p_procedure);
/** /**
* Gets the number of validation procedures. * Gets the number of validation procedures.
@ -99,7 +99,7 @@ opj_bool opj_procedure_list_add_procedure (opj_procedure_list_t * p_validation_l
* *
* @return the number of validation procedures. * @return the number of validation procedures.
*/ */
OPJ_UINT32 opj_procedure_list_get_nb_procedures (opj_procedure_list_t * p_validation_list); OPJ_API OPJ_UINT32 OPJ_CALLCONV opj_procedure_list_get_nb_procedures (opj_procedure_list_t * p_validation_list);
/** /**
* Gets the pointer on the first validation procedure. This function is similar to the C++ * Gets the pointer on the first validation procedure. This function is similar to the C++
@ -110,7 +110,7 @@ OPJ_UINT32 opj_procedure_list_get_nb_procedures (opj_procedure_list_t * p_valida
* *
* @return a pointer to the first procedure. * @return a pointer to the first procedure.
*/ */
opj_procedure* opj_procedure_list_get_first_procedure (opj_procedure_list_t * p_validation_list); OPJ_API opj_procedure* OPJ_CALLCONV opj_procedure_list_get_first_procedure (opj_procedure_list_t * p_validation_list);
/** /**
@ -119,7 +119,7 @@ opj_procedure* opj_procedure_list_get_first_procedure (opj_procedure_list_t * p_
* @param p_validation_list the list of procedure to clear. * @param p_validation_list the list of procedure to clear.
* *
*/ */
void opj_procedure_list_clear (opj_procedure_list_t * p_validation_list); OPJ_API void OPJ_CALLCONV opj_procedure_list_clear (opj_procedure_list_t * p_validation_list);
/*@}*/ /*@}*/
#endif /* __FUNCTION_LIST_H */ #endif /* __FUNCTION_LIST_H */

View File

@ -9061,7 +9061,7 @@ opj_bool opj_j2k_encode_v2( opj_j2k_v2_t * p_j2k,
return OPJ_TRUE; return OPJ_TRUE;
} }
opj_bool opj_j2k_end_compress( opj_j2k_v2_t *p_j2k, opj_bool OPJ_CALLCONV opj_j2k_end_compress( opj_j2k_v2_t *p_j2k,
opj_stream_private_t *p_stream, opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager) opj_event_mgr_t * p_manager)
{ {
@ -9076,7 +9076,7 @@ opj_bool opj_j2k_end_compress( opj_j2k_v2_t *p_j2k,
return OPJ_TRUE; return OPJ_TRUE;
} }
opj_bool opj_j2k_start_compress(opj_j2k_v2_t *p_j2k, OPJ_API opj_bool OPJ_CALLCONV opj_j2k_start_compress(opj_j2k_v2_t *p_j2k,
opj_stream_private_t *p_stream, opj_stream_private_t *p_stream,
opj_image_t * p_image, opj_image_t * p_image,
opj_event_mgr_t * p_manager) opj_event_mgr_t * p_manager)

View File

@ -1024,7 +1024,7 @@ opj_bool opj_j2k_encode_v2( opj_j2k_v2_t * p_j2k,
* *
* @return true if the codec is valid. * @return true if the codec is valid.
*/ */
opj_bool opj_j2k_start_compress(opj_j2k_v2_t *p_j2k, opj_bool OPJ_CALLCONV opj_j2k_start_compress(opj_j2k_v2_t *p_j2k,
opj_stream_private_t *p_stream, opj_stream_private_t *p_stream,
opj_image_t * p_image, opj_image_t * p_image,
opj_event_mgr_t * p_manager); opj_event_mgr_t * p_manager);
@ -1033,7 +1033,7 @@ opj_bool opj_j2k_start_compress(opj_j2k_v2_t *p_j2k,
* Ends the compression procedures and possibiliy add data to be read after the * Ends the compression procedures and possibiliy add data to be read after the
* codestream. * codestream.
*/ */
opj_bool opj_j2k_end_compress( opj_j2k_v2_t *p_j2k, OPJ_API opj_bool OPJ_CALLCONV opj_j2k_end_compress( opj_j2k_v2_t *p_j2k,
opj_stream_private_t *cio, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager); opj_event_mgr_t * p_manager);

View File

@ -1108,7 +1108,7 @@ opj_bool opj_jp2_decode(opj_jp2_v2_t *jp2,
return OPJ_TRUE; return OPJ_TRUE;
} }
opj_bool opj_jp2_write_jp2h(opj_jp2_v2_t *jp2, opj_bool OPJ_CALLCONV opj_jp2_write_jp2h(opj_jp2_v2_t *jp2,
opj_stream_private_t *stream, opj_stream_private_t *stream,
opj_event_mgr_t * p_manager opj_event_mgr_t * p_manager
) )
@ -1339,7 +1339,7 @@ void opj_jp2_setup_decoder(opj_jp2_v2_t *jp2, opj_dparameters_t *parameters)
/* JP2 encoder interface */ /* JP2 encoder interface */
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
void opj_jp2_setup_encoder( opj_jp2_v2_t *jp2, void OPJ_CALLCONV opj_jp2_setup_encoder( opj_jp2_v2_t *jp2,
opj_cparameters_t *parameters, opj_cparameters_t *parameters,
opj_image_t *image, opj_image_t *image,
opj_event_mgr_t * p_manager) opj_event_mgr_t * p_manager)
@ -1417,7 +1417,7 @@ void opj_jp2_setup_encoder( opj_jp2_v2_t *jp2,
jp2->approx = 0; /* APPROX */ jp2->approx = 0; /* APPROX */
} }
opj_bool opj_jp2_encode(opj_jp2_v2_t *jp2, opj_bool OPJ_CALLCONV opj_jp2_encode(opj_jp2_v2_t *jp2,
opj_stream_private_t *stream, opj_stream_private_t *stream,
opj_event_mgr_t * p_manager) opj_event_mgr_t * p_manager)
{ {
@ -2095,7 +2095,7 @@ opj_bool opj_jp2_read_tile_header ( opj_jp2_v2_t * p_jp2,
p_manager); p_manager);
} }
opj_bool opj_jp2_write_tile ( opj_jp2_v2_t *p_jp2, opj_bool OPJ_CALLCONV opj_jp2_write_tile ( opj_jp2_v2_t *p_jp2,
OPJ_UINT32 p_tile_index, OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data, OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size, OPJ_UINT32 p_data_size,
@ -2118,7 +2118,7 @@ opj_bool opj_jp2_decode_tile ( opj_jp2_v2_t * p_jp2,
return opj_j2k_decode_tile (p_jp2->j2k,p_tile_index,p_data,p_data_size,p_stream,p_manager); return opj_j2k_decode_tile (p_jp2->j2k,p_tile_index,p_data,p_data_size,p_stream,p_manager);
} }
void opj_jp2_destroy(opj_jp2_v2_t *jp2) void OPJ_CALLCONV opj_jp2_destroy(opj_jp2_v2_t *jp2)
{ {
if (jp2) { if (jp2) {
/* destroy the J2K codec */ /* destroy the J2K codec */
@ -2249,7 +2249,7 @@ opj_bool opj_jp2_get_tile( opj_jp2_v2_t *p_jp2,
/* JP2 encoder interface */ /* JP2 encoder interface */
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
opj_jp2_v2_t* opj_jp2_create(opj_bool p_is_decoder) opj_jp2_v2_t* OPJ_CALLCONV opj_jp2_create(opj_bool p_is_decoder)
{ {
opj_jp2_v2_t *jp2 = (opj_jp2_v2_t*)opj_malloc(sizeof(opj_jp2_v2_t)); opj_jp2_v2_t *jp2 = (opj_jp2_v2_t*)opj_malloc(sizeof(opj_jp2_v2_t));
if (jp2) { if (jp2) {
@ -2308,7 +2308,7 @@ opj_codestream_index_t* jp2_get_cstr_index(opj_jp2_v2_t* p_jp2)
return j2k_get_cstr_index(p_jp2->j2k); return j2k_get_cstr_index(p_jp2->j2k);
} }
opj_codestream_info_v2_t* jp2_get_cstr_info(opj_jp2_v2_t* p_jp2) opj_codestream_info_v2_t* OPJ_CALLCONV jp2_get_cstr_info(opj_jp2_v2_t* p_jp2)
{ {
return j2k_get_cstr_info(p_jp2->j2k); return j2k_get_cstr_info(p_jp2->j2k);
} }

View File

@ -265,7 +265,7 @@ opj_jp2_img_header_writer_handler_t;
* *
* @return true if writing was successful. * @return true if writing was successful.
*/ */
opj_bool opj_jp2_write_jp2h(opj_jp2_v2_t *jp2, OPJ_API opj_bool OPJ_CALLCONV opj_jp2_write_jp2h(opj_jp2_v2_t *jp2,
opj_stream_private_t *stream, opj_stream_private_t *stream,
opj_event_mgr_t * p_manager ); opj_event_mgr_t * p_manager );
@ -300,7 +300,7 @@ opj_bool opj_jp2_decode(opj_jp2_v2_t *jp2,
* @param image input filled image * @param image input filled image
* @param p_manager FIXME DOC * @param p_manager FIXME DOC
*/ */
void opj_jp2_setup_encoder( opj_jp2_v2_t *jp2, OPJ_API void OPJ_CALLCONV opj_jp2_setup_encoder( opj_jp2_v2_t *jp2,
opj_cparameters_t *parameters, opj_cparameters_t *parameters,
opj_image_t *image, opj_image_t *image,
opj_event_mgr_t * p_manager); opj_event_mgr_t * p_manager);
@ -312,7 +312,7 @@ Encode an image into a JPEG-2000 file stream
@param p_manager event manager @param p_manager event manager
@return Returns true if successful, returns false otherwise @return Returns true if successful, returns false otherwise
*/ */
opj_bool opj_jp2_encode( opj_jp2_v2_t *jp2, OPJ_API opj_bool OPJ_CALLCONV opj_jp2_encode( opj_jp2_v2_t *jp2,
opj_stream_private_t *stream, opj_stream_private_t *stream,
opj_event_mgr_t * p_manager); opj_event_mgr_t * p_manager);
@ -402,7 +402,7 @@ opj_bool opj_jp2_read_tile_header ( opj_jp2_v2_t * p_jp2,
* @param p_stream the stream to write data to. * @param p_stream the stream to write data to.
* @param p_manager the user event manager. * @param p_manager the user event manager.
*/ */
opj_bool opj_jp2_write_tile ( opj_jp2_v2_t *p_jp2, OPJ_API opj_bool OPJ_CALLCONV opj_jp2_write_tile ( opj_jp2_v2_t *p_jp2,
OPJ_UINT32 p_tile_index, OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data, OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size, OPJ_UINT32 p_data_size,
@ -432,13 +432,13 @@ opj_bool opj_jp2_decode_tile ( opj_jp2_v2_t * p_jp2,
* *
* @return an empty jpeg2000 file codec. * @return an empty jpeg2000 file codec.
*/ */
opj_jp2_v2_t* opj_jp2_create (opj_bool p_is_decoder); OPJ_API opj_jp2_v2_t* OPJ_CALLCONV opj_jp2_create (opj_bool p_is_decoder);
/** /**
Destroy a JP2 decompressor handle Destroy a JP2 decompressor handle
@param jp2 JP2 decompressor handle to destroy @param jp2 JP2 decompressor handle to destroy
*/ */
void opj_jp2_destroy(opj_jp2_v2_t *jp2); OPJ_API void OPJ_CALLCONV opj_jp2_destroy(opj_jp2_v2_t *jp2);
/** /**
@ -496,7 +496,7 @@ void jp2_dump (opj_jp2_v2_t* p_jp2, OPJ_INT32 flag, FILE* out_stream);
* *
*@return the codestream information extract from the jpg2000 codec *@return the codestream information extract from the jpg2000 codec
*/ */
opj_codestream_info_v2_t* jp2_get_cstr_info(opj_jp2_v2_t* p_jp2); OPJ_API opj_codestream_info_v2_t* OPJ_CALLCONV jp2_get_cstr_info(opj_jp2_v2_t* p_jp2);
/** /**
* Get the codestream index from a JPEG2000 codec. * Get the codestream index from a JPEG2000 codec.

View File

@ -1,37 +1,42 @@
# openjp3d
include_regular_expression("^.*$")
INCLUDE_REGULAR_EXPRESSION("^.*$") include_directories(
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
)
SET(OPENJP3D_LIBRARY_NAME openjp3d) SET(OPENJP3D_LIBRARY_NAME openjp3d)
# Defines the source code for the library # Defines the source code for the library
SET(OPENJP3D_SRCS SET(OPENJP3D_SRCS
bio.c cio.c dwt.c event.c jp3d.c jp3d_lib.c mct.c mqc.c openjp3d.c pi.c raw.c t1.c t1_3d.c t2.c tcd.c tgt.c volume.c bio.c cio.c dwt.c event.c jp3d.c jp3d_lib.c mct.c mqc.c openjp3d.c
pi.c raw.c t1.c t1_3d.c t2.c tcd.c tgt.c volume.c
) )
# Build the library # Build the library
IF(WIN32) if(WIN32)
IF(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS) add_definitions(-DOPJ_EXPORTS)
ELSE(BUILD_SHARED_LIBS) else()
ADD_DEFINITIONS(-DOPJ_STATIC) add_definitions(-DOPJ_STATIC)
ENDIF(BUILD_SHARED_LIBS) endif()
ENDIF(WIN32) endif()
# build jp3d lib: # build jp3d lib:
ADD_LIBRARY(${OPENJP3D_LIBRARY_NAME} ${OPENJP3D_SRCS}) add_library(${OPENJP3D_LIBRARY_NAME} ${OPENJP3D_SRCS})
IF(UNIX) if(UNIX)
TARGET_LINK_LIBRARIES(${OPENJP3D_LIBRARY_NAME} m) target_link_libraries(${OPENJP3D_LIBRARY_NAME} m)
ENDIF(UNIX) endif()
SET_TARGET_PROPERTIES(${OPENJP3D_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES}) set_target_properties(${OPENJP3D_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
# Install library # Install library
INSTALL(TARGETS ${OPENJP3D_LIBRARY_NAME} install(TARGETS ${OPENJP3D_LIBRARY_NAME}
EXPORT OpenJP3DTargets EXPORT OpenJP3DTargets
DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} DESTINATION ${OPENJPEG_INSTALL_LIB_DIR}
COMPONENT Libraries COMPONENT Libraries
) )
# Install includes files # Install includes files
INSTALL(FILES openjp3d.h install(FILES openjp3d.h
DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR}
COMPONENT Headers COMPONENT Headers
) )

View File

@ -30,6 +30,7 @@
#endif /* _WIN32 */ #endif /* _WIN32 */
#include "opj_includes.h" #include "opj_includes.h"
#include "openjp3d.h"
#define JP3D_VERSION "1.3.0" #define JP3D_VERSION "1.3.0"
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
#ifdef _WIN32 #ifdef _WIN32

View File

@ -38,10 +38,18 @@
*/ */
#if defined(OPJ_STATIC) || !defined(_WIN32) #if defined(OPJ_STATIC) || !defined(_WIN32)
/* http://gcc.gnu.org/wiki/Visibility */
#if __GNUC__ >= 4
#define OPJ_API __attribute__ ((visibility ("default")))
#define OPJ_LOCAL __attribute__ ((visibility ("hidden")))
#else
#define OPJ_API #define OPJ_API
#define OPJ_LOCAL
#endif
#define OPJ_CALLCONV #define OPJ_CALLCONV
#else #else
#define OPJ_CALLCONV __stdcall #define OPJ_CALLCONV __stdcall
/* /*
The following ifdef block is the standard way of creating macros which make exporting The following ifdef block is the standard way of creating macros which make exporting
from a DLL simpler. All files within this DLL are compiled with the OPJ_EXPORTS from a DLL simpler. All files within this DLL are compiled with the OPJ_EXPORTS

View File

@ -25,6 +25,8 @@
*/ */
#include "opj_includes.h" #include "opj_includes.h"
#include "volume.h"
#include "openjp3d.h"
opj_volume_t* OPJ_CALLCONV opj_volume_create(int numcmpts, opj_volume_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc) { opj_volume_t* OPJ_CALLCONV opj_volume_create(int numcmpts, opj_volume_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc) {
int compno; int compno;

View File

@ -209,7 +209,7 @@ void local_log( bool query, bool messages, bool sessions, bool targets, QR_t *qr
#ifndef SERVER #ifndef SERVER
dec_server_record_t * init_dec_server( int port) dec_server_record_t * OPJ_CALLCONV init_dec_server( int port)
{ {
dec_server_record_t *record = (dec_server_record_t *)opj_malloc( sizeof(dec_server_record_t)); dec_server_record_t *record = (dec_server_record_t *)opj_malloc( sizeof(dec_server_record_t));
@ -222,7 +222,7 @@ dec_server_record_t * init_dec_server( int port)
return record; return record;
} }
void terminate_dec_server( dec_server_record_t **rec) void OPJ_CALLCONV terminate_dec_server( dec_server_record_t **rec)
{ {
delete_cachelist( &(*rec)->cachelist); delete_cachelist( &(*rec)->cachelist);
opj_free( (*rec)->jpipstream); opj_free( (*rec)->jpipstream);
@ -236,7 +236,7 @@ void terminate_dec_server( dec_server_record_t **rec)
opj_free( *rec); opj_free( *rec);
} }
client_t accept_connection( dec_server_record_t *rec) client_t OPJ_CALLCONV accept_connection( dec_server_record_t *rec)
{ {
client_t client; client_t client;
@ -247,7 +247,7 @@ client_t accept_connection( dec_server_record_t *rec)
return client; return client;
} }
bool handle_clientreq( client_t client, dec_server_record_t *rec) bool OPJ_CALLCONV handle_clientreq( client_t client, dec_server_record_t *rec)
{ {
bool quit = false; bool quit = false;
msgtype_t msgtype = identify_clientmsg( client); msgtype_t msgtype = identify_clientmsg( client);
@ -306,7 +306,7 @@ bool handle_clientreq( client_t client, dec_server_record_t *rec)
} }
jpip_dec_param_t * init_jpipdecoder( bool jp2) jpip_dec_param_t * OPJ_CALLCONV init_jpipdecoder( bool jp2)
{ {
jpip_dec_param_t *dec; jpip_dec_param_t *dec;
@ -321,7 +321,7 @@ jpip_dec_param_t * init_jpipdecoder( bool jp2)
} }
bool fread_jpip( const char fname[], jpip_dec_param_t *dec) bool OPJ_CALLCONV fread_jpip( const char fname[], jpip_dec_param_t *dec)
{ {
int infd; int infd;
@ -346,7 +346,7 @@ bool fread_jpip( const char fname[], jpip_dec_param_t *dec)
return true; return true;
} }
void decode_jpip( jpip_dec_param_t *dec) void OPJ_CALLCONV decode_jpip( jpip_dec_param_t *dec)
{ {
parse_JPIPstream( dec->jpipstream, dec->jpiplen, 0, dec->msgqueue); parse_JPIPstream( dec->jpipstream, dec->jpiplen, 0, dec->msgqueue);
@ -361,7 +361,7 @@ void decode_jpip( jpip_dec_param_t *dec)
dec->jp2kstream = recons_j2k( dec->msgqueue, dec->jpipstream, dec->msgqueue->first->csn, 0, 0, &dec->jp2klen); dec->jp2kstream = recons_j2k( dec->msgqueue, dec->jpipstream, dec->msgqueue->first->csn, 0, 0, &dec->jp2klen);
} }
bool fwrite_jp2k( const char fname[], jpip_dec_param_t *dec) bool OPJ_CALLCONV fwrite_jp2k( const char fname[], jpip_dec_param_t *dec)
{ {
int outfd; int outfd;
@ -382,7 +382,7 @@ bool fwrite_jp2k( const char fname[], jpip_dec_param_t *dec)
return true; return true;
} }
void output_log( bool messages, bool metadata, bool ihdrbox, jpip_dec_param_t *dec) void OPJ_CALLCONV output_log( bool messages, bool metadata, bool ihdrbox, jpip_dec_param_t *dec)
{ {
if( messages) if( messages)
print_msgqueue( dec->msgqueue); print_msgqueue( dec->msgqueue);
@ -396,7 +396,7 @@ void output_log( bool messages, bool metadata, bool ihdrbox, jpip_dec_param_t *d
} }
} }
void destroy_jpipdecoder( jpip_dec_param_t **dec) void OPJ_CALLCONV destroy_jpipdecoder( jpip_dec_param_t **dec)
{ {
opj_free( (*dec)->jpipstream); opj_free( (*dec)->jpipstream);
delete_msgqueue( &(*dec)->msgqueue); delete_msgqueue( &(*dec)->msgqueue);
@ -409,7 +409,7 @@ void destroy_jpipdecoder( jpip_dec_param_t **dec)
opj_free( *dec); opj_free( *dec);
} }
index_t * get_index_from_JP2file( int fd) index_t * OPJ_CALLCONV get_index_from_JP2file( int fd)
{ {
char *data; char *data;
@ -437,12 +437,12 @@ index_t * get_index_from_JP2file( int fd)
return parse_jp2file( fd); return parse_jp2file( fd);
} }
void destroy_index( index_t **idx) void OPJ_CALLCONV destroy_index( index_t **idx)
{ {
delete_index( idx); delete_index( idx);
} }
void output_index( index_t *index) void OPJ_CALLCONV output_index( index_t *index)
{ {
print_index( *index); print_index( *index);
} }

View File

@ -172,14 +172,14 @@ typedef SOCKET client_t;
* @param[in] port opening tcp port (valid No. 49152-65535) * @param[in] port opening tcp port (valid No. 49152-65535)
* @return intialized decoding server record pointer * @return intialized decoding server record pointer
*/ */
dec_server_record_t * init_dec_server( int port); OPJ_API dec_server_record_t * OPJ_CALLCONV init_dec_server( int port);
/** /**
* Terminate the image decoding server * Terminate the image decoding server
* *
* @param[in] rec address of deleting decoding server static record pointer * @param[in] rec address of deleting decoding server static record pointer
*/ */
void terminate_dec_server( dec_server_record_t **rec); OPJ_API void OPJ_CALLCONV terminate_dec_server( dec_server_record_t **rec);
/** /**
* Accept client connection * Accept client connection
@ -187,7 +187,7 @@ void terminate_dec_server( dec_server_record_t **rec);
* @param[in] rec decoding server static record pointer * @param[in] rec decoding server static record pointer
* @return client socket ID, -1 if failed * @return client socket ID, -1 if failed
*/ */
client_t accept_connection( dec_server_record_t *rec); OPJ_API client_t OPJ_CALLCONV accept_connection( dec_server_record_t *rec);
/** /**
* Handle client request * Handle client request
@ -196,7 +196,7 @@ client_t accept_connection( dec_server_record_t *rec);
* @param[in] rec decoding server static record pointer * @param[in] rec decoding server static record pointer
* @return true if succeed * @return true if succeed
*/ */
bool handle_clientreq( client_t client, dec_server_record_t *rec); OPJ_API bool OPJ_CALLCONV handle_clientreq( client_t client, dec_server_record_t *rec);
#endif /*SERVER*/ #endif /*SERVER*/
@ -229,14 +229,14 @@ typedef struct jpip_dec_param{
* @param[in] jp2 true in case of jp2 file encoding, else j2k file encoding * @param[in] jp2 true in case of jp2 file encoding, else j2k file encoding
* @return JPIP decoding parameters pointer * @return JPIP decoding parameters pointer
*/ */
jpip_dec_param_t * init_jpipdecoder( bool jp2); OPJ_API jpip_dec_param_t * OPJ_CALLCONV init_jpipdecoder( bool jp2);
/** /**
* Destroy jpip decoding parameters * Destroy jpip decoding parameters
* *
* @param[in] dec address of JPIP decoding parameters pointer * @param[in] dec address of JPIP decoding parameters pointer
*/ */
void destroy_jpipdecoder( jpip_dec_param_t **dec); OPJ_API void OPJ_CALLCONV destroy_jpipdecoder( jpip_dec_param_t **dec);
/** /**
* Read jpip codestream from a file * Read jpip codestream from a file
@ -245,14 +245,14 @@ void destroy_jpipdecoder( jpip_dec_param_t **dec);
* @param[in] dec JPIP decoding parameters pointer * @param[in] dec JPIP decoding parameters pointer
* @return true if succeed * @return true if succeed
*/ */
bool fread_jpip( const char fname[], jpip_dec_param_t *dec); OPJ_API bool OPJ_CALLCONV fread_jpip( const char fname[], jpip_dec_param_t *dec);
/** /**
* Decode jpip codestream * Decode jpip codestream
* *
* @param[in] dec JPIP decoding parameters pointer * @param[in] dec JPIP decoding parameters pointer
*/ */
void decode_jpip( jpip_dec_param_t *dec); OPJ_API void OPJ_CALLCONV decode_jpip( jpip_dec_param_t *dec);
/** /**
* Write J2K/JP2 codestream to a file * Write J2K/JP2 codestream to a file
@ -261,7 +261,7 @@ void decode_jpip( jpip_dec_param_t *dec);
* @param[in] dec JPIP decoding parameters pointer * @param[in] dec JPIP decoding parameters pointer
* @return true if succeed * @return true if succeed
*/ */
bool fwrite_jp2k( const char fname[], jpip_dec_param_t *dec); OPJ_API bool OPJ_CALLCONV fwrite_jp2k( const char fname[], jpip_dec_param_t *dec);
/** /**
* Option; print out parameter values to stderr * Option; print out parameter values to stderr
@ -271,7 +271,7 @@ bool fwrite_jp2k( const char fname[], jpip_dec_param_t *dec);
* @param[in] ihdrbox true if image header data is to be printed out * @param[in] ihdrbox true if image header data is to be printed out
* @param[in] dec JPIP decoding parameters pointer * @param[in] dec JPIP decoding parameters pointer
*/ */
void output_log( bool messages, bool metadata, bool ihdrbox, jpip_dec_param_t *dec); OPJ_API void OPJ_CALLCONV output_log( bool messages, bool metadata, bool ihdrbox, jpip_dec_param_t *dec);
/* /*
* test the format of index (cidx) box in JP2 file * test the format of index (cidx) box in JP2 file
@ -286,14 +286,14 @@ typedef index_param_t index_t;
* @param[in] fd file descriptor of the JP2 file * @param[in] fd file descriptor of the JP2 file
* @return pointer to the generated structure of index parameters * @return pointer to the generated structure of index parameters
*/ */
index_t * get_index_from_JP2file( int fd); OPJ_API index_t * OPJ_CALLCONV get_index_from_JP2file( int fd);
/** /**
* Destroy index parameters * Destroy index parameters
* *
* @param[in,out] idx addressof the index pointer * @param[in,out] idx addressof the index pointer
*/ */
void destroy_index( index_t **idx); OPJ_API void OPJ_CALLCONV destroy_index( index_t **idx);
/** /**
@ -301,7 +301,7 @@ void destroy_index( index_t **idx);
* *
* @param[in] index index parameters * @param[in] index index parameters
*/ */
void output_index( index_t *index); OPJ_API void OPJ_CALLCONV output_index( index_t *index);
OPJ_API opj_codec_t* OPJ_CALLCONV opj_jpip_create_compress(OPJ_CODEC_FORMAT format); OPJ_API opj_codec_t* OPJ_CALLCONV opj_jpip_create_compress(OPJ_CODEC_FORMAT format);

View File

@ -1,4 +1,10 @@
# openmj2:
set(OPENMJ2_LIBRARY_NAME openmj2) set(OPENMJ2_LIBRARY_NAME openmj2)
include_directories(
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
)
set(OPENMJ2_SRCS set(OPENMJ2_SRCS
mj2.c mj2.c
mj2_convert.c mj2_convert.c
@ -27,15 +33,10 @@ set(OPENMJ2_SRCS
if(WIN32) if(WIN32)
if(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS) add_definitions(-DOPJ_EXPORTS)
else(BUILD_SHARED_LIBS) else()
add_definitions(-DOPJ_STATIC) add_definitions(-DOPJ_STATIC)
endif(BUILD_SHARED_LIBS) endif()
endif(WIN32) endif()
include_directories(
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
#${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
)
# build mj2 lib: # build mj2 lib:
add_library(${OPENMJ2_LIBRARY_NAME} ${OPENMJ2_SRCS}) add_library(${OPENMJ2_LIBRARY_NAME} ${OPENMJ2_SRCS})

View File

@ -152,7 +152,7 @@ unsigned char cio_bytein(opj_cio_t *cio) {
* v : value to write * v : value to write
* n : number of bytes to write * n : number of bytes to write
*/ */
unsigned int cio_write(opj_cio_t *cio, unsigned int64 v, int n) { unsigned int OPJ_CALLCONV cio_write(opj_cio_t *cio, unsigned int64 v, int n) {
int i; int i;
for (i = n - 1; i >= 0; i--) { for (i = n - 1; i >= 0; i--) {
if( !cio_byteout(cio, (unsigned char) ((v >> (i << 3)) & 0xff)) ) if( !cio_byteout(cio, (unsigned char) ((v >> (i << 3)) & 0xff)) )
@ -168,7 +168,7 @@ unsigned int cio_write(opj_cio_t *cio, unsigned int64 v, int n) {
* *
* return : value of the n bytes read * return : value of the n bytes read
*/ */
unsigned int cio_read(opj_cio_t *cio, int n) { unsigned int OPJ_CALLCONV cio_read(opj_cio_t *cio, int n) {
int i; int i;
unsigned int v; unsigned int v;
v = 0; v = 0;
@ -183,7 +183,7 @@ unsigned int cio_read(opj_cio_t *cio, int n) {
* *
* n : number of bytes to skip * n : number of bytes to skip
*/ */
void cio_skip(opj_cio_t *cio, int n) { void OPJ_CALLCONV cio_skip(opj_cio_t *cio, int n) {
cio->bp += n; cio->bp += n;
} }

View File

@ -70,20 +70,20 @@ Write some bytes
@param n Number of bytes to write @param n Number of bytes to write
@return Returns the number of bytes written or 0 if an error occured @return Returns the number of bytes written or 0 if an error occured
*/ */
unsigned int cio_write(opj_cio_t *cio, unsigned int64 v, int n); OPJ_API unsigned int OPJ_CALLCONV cio_write(opj_cio_t *cio, unsigned int64 v, int n);
/** /**
Read some bytes Read some bytes
@param cio CIO handle @param cio CIO handle
@param n Number of bytes to read @param n Number of bytes to read
@return Returns the value of the n bytes read @return Returns the value of the n bytes read
*/ */
unsigned int cio_read(opj_cio_t *cio, int n); OPJ_API unsigned int OPJ_CALLCONV cio_read(opj_cio_t *cio, int n);
/** /**
Skip some bytes Skip some bytes
@param cio CIO handle @param cio CIO handle
@param n Number of bytes to skip @param n Number of bytes to skip
*/ */
void cio_skip(opj_cio_t *cio, int n); OPJ_API void OPJ_CALLCONV cio_skip(opj_cio_t *cio, int n);
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/*@}*/ /*@}*/

View File

@ -33,7 +33,7 @@
#endif /* _WIN32 */ #endif /* _WIN32 */
#include "opj_includes.h" #include "opj_includes.h"
double opj_clock(void) { double OPJ_CALLCONV opj_clock(void) {
#ifdef _WIN32 #ifdef _WIN32
/* _WIN32: use QueryPerformance (very accurate) */ /* _WIN32: use QueryPerformance (very accurate) */
LARGE_INTEGER freq , t ; LARGE_INTEGER freq , t ;

View File

@ -43,7 +43,7 @@ The functions in J2K_LIB.C are internal utilities mainly used for timing.
Difference in successive opj_clock() calls tells you the elapsed time Difference in successive opj_clock() calls tells you the elapsed time
@return Returns time in seconds @return Returns time in seconds
*/ */
double opj_clock(void); OPJ_API double OPJ_CALLCONV opj_clock(void);
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/*@}*/ /*@}*/

View File

@ -78,7 +78,7 @@ int mj2_read_boxhdr(mj2_box_t * box, opj_cio_t *cio)
* *
*/ */
int mj2_init_stdmovie(opj_mj2_t * movie) int OPJ_CALLCONV mj2_init_stdmovie(opj_mj2_t * movie)
{ {
mj2_tk_t *tk0; mj2_tk_t *tk0;
int i, w, h, prec; int i, w, h, prec;
@ -300,7 +300,7 @@ void mj2_stco_decompact(mj2_tk_t * tk)
* JP Signature box * JP Signature box
* *
*/ */
void mj2_write_jp(opj_cio_t *cio) void OPJ_CALLCONV mj2_write_jp(opj_cio_t *cio)
{ {
mj2_box_t box; mj2_box_t box;
box.init_pos = cio_tell(cio); box.init_pos = cio_tell(cio);
@ -348,7 +348,7 @@ int mj2_read_jp(opj_cio_t *cio)
* File type box * File type box
* *
*/ */
void mj2_write_ftyp(opj_mj2_t * movie, opj_cio_t *cio) void OPJ_CALLCONV mj2_write_ftyp(opj_mj2_t * movie, opj_cio_t *cio)
{ {
int i; int i;
mj2_box_t box; mj2_box_t box;
@ -2536,7 +2536,7 @@ int mj2_read_mvhd(opj_mj2_t * movie, opj_cio_t *cio)
* Movie Box * Movie Box
* *
*/ */
void mj2_write_moov(opj_mj2_t * movie, opj_cio_t *cio) void OPJ_CALLCONV mj2_write_moov(opj_mj2_t * movie, opj_cio_t *cio)
{ {
int i; int i;
mj2_box_t box; mj2_box_t box;
@ -2608,7 +2608,7 @@ int mj2_read_moov(opj_mj2_t * movie, opj_image_t * img, opj_cio_t *cio)
return 0; return 0;
} }
int mj2_read_struct(FILE *file, opj_mj2_t *movie) { int OPJ_CALLCONV mj2_read_struct(FILE *file, opj_mj2_t *movie) {
mj2_box_t box; mj2_box_t box;
opj_image_t img; opj_image_t img;
unsigned char * src; unsigned char * src;
@ -2721,7 +2721,7 @@ int mj2_read_struct(FILE *file, opj_mj2_t *movie) {
/* MJ2 decoder interface */ /* MJ2 decoder interface */
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
opj_dinfo_t* mj2_create_decompress() { opj_dinfo_t* OPJ_CALLCONV mj2_create_decompress() {
opj_mj2_t* mj2; opj_mj2_t* mj2;
opj_dinfo_t *dinfo = (opj_dinfo_t*) opj_calloc(1, sizeof(opj_dinfo_t)); opj_dinfo_t *dinfo = (opj_dinfo_t*) opj_calloc(1, sizeof(opj_dinfo_t));
if(!dinfo) return NULL; if(!dinfo) return NULL;
@ -2739,7 +2739,7 @@ opj_dinfo_t* mj2_create_decompress() {
return dinfo; return dinfo;
} }
void mj2_setup_decoder(opj_mj2_t *movie, mj2_dparameters_t *mj2_parameters) { void OPJ_CALLCONV mj2_setup_decoder(opj_mj2_t *movie, mj2_dparameters_t *mj2_parameters) {
movie->num_vtk=0; movie->num_vtk=0;
movie->num_stk=0; movie->num_stk=0;
movie->num_htk=0; movie->num_htk=0;
@ -2750,7 +2750,7 @@ void mj2_setup_decoder(opj_mj2_t *movie, mj2_dparameters_t *mj2_parameters) {
} }
void mj2_destroy_decompress(opj_mj2_t *movie) { void OPJ_CALLCONV mj2_destroy_decompress(opj_mj2_t *movie) {
if(movie) { if(movie) {
int i; int i;
mj2_tk_t *tk=NULL; mj2_tk_t *tk=NULL;
@ -2799,8 +2799,7 @@ void mj2_destroy_decompress(opj_mj2_t *movie) {
/* MJ2 encoder interface */ /* MJ2 encoder interface */
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
opj_cinfo_t* OPJ_CALLCONV mj2_create_compress() {
opj_cinfo_t* mj2_create_compress() {
opj_mj2_t* mj2; opj_mj2_t* mj2;
opj_cinfo_t *cinfo = (opj_cinfo_t*) opj_calloc(1, sizeof(opj_cinfo_t)); opj_cinfo_t *cinfo = (opj_cinfo_t*) opj_calloc(1, sizeof(opj_cinfo_t));
if(!cinfo) return NULL; if(!cinfo) return NULL;
@ -2817,7 +2816,7 @@ opj_cinfo_t* mj2_create_compress() {
return cinfo; return cinfo;
} }
void mj2_setup_encoder(opj_mj2_t *movie, mj2_cparameters_t *parameters) { void OPJ_CALLCONV mj2_setup_encoder(opj_mj2_t *movie, mj2_cparameters_t *parameters) {
if(movie && parameters) { if(movie && parameters) {
opj_jp2_t *jp2_struct; opj_jp2_t *jp2_struct;
@ -2868,7 +2867,7 @@ void mj2_setup_encoder(opj_mj2_t *movie, mj2_cparameters_t *parameters) {
} }
} }
void mj2_destroy_compress(opj_mj2_t *movie) { void OPJ_CALLCONV mj2_destroy_compress(opj_mj2_t *movie) {
if(movie) { if(movie) {
int i; int i;
mj2_tk_t *tk=NULL; mj2_tk_t *tk=NULL;

View File

@ -306,30 +306,30 @@ typedef struct mj2_cparameters {
/** /**
Write the JP box Write the JP box
*/ */
void mj2_write_jp(opj_cio_t *cio); OPJ_API void OPJ_CALLCONV mj2_write_jp(opj_cio_t *cio);
/** /**
Write the FTYP box Write the FTYP box
@param movie MJ2 movie @param movie MJ2 movie
@param cio Output buffer stream @param cio Output buffer stream
*/ */
void mj2_write_ftyp(opj_mj2_t *movie, opj_cio_t *cio); OPJ_API void OPJ_CALLCONV mj2_write_ftyp(opj_mj2_t *movie, opj_cio_t *cio);
/** /**
Creates an MJ2 decompression structure Creates an MJ2 decompression structure
@return Returns a handle to a MJ2 decompressor if successful, returns NULL otherwise @return Returns a handle to a MJ2 decompressor if successful, returns NULL otherwise
*/ */
opj_dinfo_t* mj2_create_decompress(); OPJ_API opj_dinfo_t* OPJ_CALLCONV mj2_create_decompress();
/** /**
Destroy a MJ2 decompressor handle Destroy a MJ2 decompressor handle
@param movie MJ2 decompressor handle to destroy @param movie MJ2 decompressor handle to destroy
*/ */
void mj2_destroy_decompress(opj_mj2_t *movie); OPJ_API void OPJ_CALLCONV mj2_destroy_decompress(opj_mj2_t *movie);
/** /**
Setup the decoder decoding parameters using user parameters. Setup the decoder decoding parameters using user parameters.
Decoding parameters are returned in mj2->j2k->cp. Decoding parameters are returned in mj2->j2k->cp.
@param movie MJ2 decompressor handle @param movie MJ2 decompressor handle
@param mj2_parameters decompression parameters @param mj2_parameters decompression parameters
*/ */
void mj2_setup_decoder(opj_mj2_t *movie, mj2_dparameters_t *mj2_parameters); OPJ_API void OPJ_CALLCONV mj2_setup_decoder(opj_mj2_t *movie, mj2_dparameters_t *mj2_parameters);
/** /**
Decode an image from a JPEG-2000 file stream Decode an image from a JPEG-2000 file stream
@param movie MJ2 decompressor handle @param movie MJ2 decompressor handle
@ -341,19 +341,19 @@ opj_image_t* mj2_decode(opj_mj2_t *movie, opj_cio_t *cio);
Creates a MJ2 compression structure Creates a MJ2 compression structure
@return Returns a handle to a MJ2 compressor if successful, returns NULL otherwise @return Returns a handle to a MJ2 compressor if successful, returns NULL otherwise
*/ */
opj_cinfo_t* mj2_create_compress(); OPJ_API opj_cinfo_t* OPJ_CALLCONV mj2_create_compress();
/** /**
Destroy a MJ2 compressor handle Destroy a MJ2 compressor handle
@param movie MJ2 compressor handle to destroy @param movie MJ2 compressor handle to destroy
*/ */
void mj2_destroy_compress(opj_mj2_t *movie); OPJ_API void OPJ_CALLCONV mj2_destroy_compress(opj_mj2_t *movie);
/** /**
Setup the encoder parameters using the current image and using user parameters. Setup the encoder parameters using the current image and using user parameters.
Coding parameters are returned in mj2->j2k->cp. Coding parameters are returned in mj2->j2k->cp.
@param movie MJ2 compressor handle @param movie MJ2 compressor handle
@param parameters compression parameters @param parameters compression parameters
*/ */
void mj2_setup_encoder(opj_mj2_t *movie, mj2_cparameters_t *parameters); OPJ_API void OPJ_CALLCONV mj2_setup_encoder(opj_mj2_t *movie, mj2_cparameters_t *parameters);
/** /**
Encode an image into a JPEG-2000 file stream Encode an image into a JPEG-2000 file stream
@param movie MJ2 compressor handle @param movie MJ2 compressor handle
@ -369,20 +369,20 @@ Init a Standard MJ2 movie
@param movie MJ2 Movie @param movie MJ2 Movie
@return Returns 0 if successful, returns 1 otherwise @return Returns 0 if successful, returns 1 otherwise
*/ */
int mj2_init_stdmovie(opj_mj2_t *movie); OPJ_API int OPJ_CALLCONV mj2_init_stdmovie(opj_mj2_t *movie);
/** /**
Read the structure of an MJ2 file Read the structure of an MJ2 file
@param file MJ2 input File @param file MJ2 input File
@param mj2 J2 movie structure @param mj2 J2 movie structure
@return Returns 0 if successful, returns 1 otherwise @return Returns 0 if successful, returns 1 otherwise
*/ */
int mj2_read_struct(FILE *file, opj_mj2_t *mj2); OPJ_API int OPJ_CALLCONV mj2_read_struct(FILE *file, opj_mj2_t *mj2);
/** /**
Write the the MOOV box to an output buffer stream Write the the MOOV box to an output buffer stream
@param movie MJ2 movie structure @param movie MJ2 movie structure
@param cio Output buffer stream @param cio Output buffer stream
*/ */
void mj2_write_moov(opj_mj2_t *movie, opj_cio_t *cio); OPJ_API void OPJ_CALLCONV mj2_write_moov(opj_mj2_t *movie, opj_cio_t *cio);
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */

View File

@ -27,7 +27,7 @@
*/ */
#include "opj_includes.h" #include "opj_includes.h"
#include "mj2.h" #include "mj2_convert.h"
/* ----------------------- */ /* ----------------------- */
/* */ /* */
@ -37,7 +37,7 @@
/* */ /* */
/* ----------------------- */ /* ----------------------- */
unsigned int yuv_num_frames(mj2_tk_t * tk, char *infile) unsigned int OPJ_CALLCONV yuv_num_frames(mj2_tk_t * tk, char *infile)
{ {
unsigned int prec_size; unsigned int prec_size;
long end_of_f, frame_size; long end_of_f, frame_size;
@ -74,7 +74,7 @@ unsigned int yuv_num_frames(mj2_tk_t * tk, char *infile)
/* */ /* */
/* ----------------------- */ /* ----------------------- */
opj_image_t *mj2_image_create(mj2_tk_t * tk, opj_cparameters_t *parameters) opj_image_t * OPJ_CALLCONV mj2_image_create(mj2_tk_t * tk, opj_cparameters_t *parameters)
{ {
opj_image_cmptparm_t cmptparm[3]; opj_image_cmptparm_t cmptparm[3];
opj_image_t * img; opj_image_t * img;
@ -99,7 +99,7 @@ opj_image_t *mj2_image_create(mj2_tk_t * tk, opj_cparameters_t *parameters)
return img; return img;
} }
char yuvtoimage(mj2_tk_t * tk, opj_image_t * img, int frame_num, opj_cparameters_t *parameters, char* infile) char OPJ_CALLCONV yuvtoimage(mj2_tk_t * tk, opj_image_t * img, int frame_num, opj_cparameters_t *parameters, char* infile)
{ {
int i, compno; int i, compno;
int offset, size, max, prec_bytes, is_16, v; int offset, size, max, prec_bytes, is_16, v;
@ -177,7 +177,7 @@ char yuvtoimage(mj2_tk_t * tk, opj_image_t * img, int frame_num, opj_cparameters
/* ----------------------- */ /* ----------------------- */
opj_bool imagetoyuv(opj_image_t * img, char *outfile) opj_bool OPJ_CALLCONV imagetoyuv(opj_image_t * img, char *outfile)
{ {
FILE *f; FILE *f;
int *data; int *data;
@ -270,7 +270,7 @@ opj_bool imagetoyuv(opj_image_t * img, char *outfile)
/* */ /* */
/* ----------------------- */ /* ----------------------- */
int imagetobmp(opj_image_t * img, char *outfile) { int OPJ_CALLCONV imagetobmp(opj_image_t * img, char *outfile) {
int w,wr,h,hr,i,pad; int w,wr,h,hr,i,pad;
FILE *f; FILE *f;

View File

@ -31,15 +31,15 @@
#ifndef __MJ2_CONVERT_H #ifndef __MJ2_CONVERT_H
#define __MJ2_CONVERT_H #define __MJ2_CONVERT_H
int imagetoyuv(opj_image_t * img, char *outfile); OPJ_API int OPJ_CALLCONV imagetoyuv(opj_image_t * img, char *outfile);
int imagetobmp(opj_image_t * img, char *outfile); OPJ_API int OPJ_CALLCONV imagetobmp(opj_image_t * img, char *outfile);
opj_image_t *mj2_image_create(mj2_tk_t * tk, opj_cparameters_t *parameters); OPJ_API opj_image_t * OPJ_CALLCONV mj2_image_create(mj2_tk_t * tk, opj_cparameters_t *parameters);
char yuvtoimage(mj2_tk_t * tk, opj_image_t * img, int frame_num, opj_cparameters_t *parameters, char* infile); OPJ_API char OPJ_CALLCONV yuvtoimage(mj2_tk_t * tk, opj_image_t * img, int frame_num, opj_cparameters_t *parameters, char* infile);
unsigned int yuv_num_frames(mj2_tk_t * tk, char *infile); OPJ_API unsigned int OPJ_CALLCONV yuv_num_frames(mj2_tk_t * tk, char *infile);
#endif #endif

View File

@ -33,7 +33,6 @@
#ifndef OPENJPEG_H #ifndef OPENJPEG_H
#define OPENJPEG_H #define OPENJPEG_H
/* /*
========================================================== ==========================================================
Compiler directives Compiler directives
@ -41,7 +40,14 @@
*/ */
#if defined(OPJ_STATIC) || !defined(_WIN32) #if defined(OPJ_STATIC) || !defined(_WIN32)
/* http://gcc.gnu.org/wiki/Visibility */
#if __GNUC__ >= 4
#define OPJ_API __attribute__ ((visibility ("default")))
#define OPJ_LOCAL __attribute__ ((visibility ("hidden")))
#else
#define OPJ_API #define OPJ_API
#define OPJ_LOCAL
#endif
#define OPJ_CALLCONV #define OPJ_CALLCONV
#else #else
#define OPJ_CALLCONV __stdcall #define OPJ_CALLCONV __stdcall