added "OPJ_EXPORT" in openjpeg.h to generate shared lib with win32
authorAntonin Descampe <antonin@gmail.com>
Wed, 25 Jan 2006 08:50:18 +0000 (08:50 +0000)
committerAntonin Descampe <antonin@gmail.com>
Wed, 25 Jan 2006 08:50:18 +0000 (08:50 +0000)
ChangeLog
libopenjpeg/openjpeg.h

index c4157c690912b457e13764b07781942c84d74336..9bba4ad3fe2ab5bdd660c010f22339c39d7441e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@ What's New for OpenJPEG
 + : added
 
 January 25, 2006
++ added "OPJ_EXPORT" in openjpeg.h to generate shared lib with win32
 ! removed all CtrlM from files (openjpeg.h,t2.c,j2k_to_image.c)
 
 January 24, 2006
index ad2c4d6a5267a2bf09aa68295a2db5a15afb520b..ce99e3c5862810fe42d7c8075c994f0bd6f81d57 100644 (file)
 
 #define OPENJPEG_VERSION "1.0.0"
 
+#if defined(_WIN32) && !defined (OPJ_STATIC)
+#ifdef OPJ_SHARED
+#define OPJ_EXPORT __declspec(dllexport)
+#else
+#define OPJ_EXPORT __declspec(dllimport)
+#endif
+#else
+#ifdef OPJ_STATIC
+#define OPJ_EXPORT extern
+#else
+#define OPJ_EXPORT
+#endif
+#endif
+
 /* 
 ==========================================================
    Compiler directives
@@ -461,13 +475,13 @@ Create an image
 @param clrspc image color space
 @return returns a new image structure if successful, returns NULL otherwise
 */
-opj_image_t *opj_image_create(int numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
+OPJ_EXPORT opj_image_t *opj_image_create(int numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
 
 /**
 Deallocate any resources associated with an image
 @param image image to be destroyed
 */
-void opj_image_destroy(opj_image_t *image);
+OPJ_EXPORT void opj_image_destroy(opj_image_t *image);
 
 /* 
 ==========================================================
@@ -486,20 +500,20 @@ to contain encoded data.
 @param length Reading: buffer length. Writing: 0
 @return Returns a CIO handle if successful, returns NULL otherwise
 */
-opj_cio_t* opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer, int length);
+OPJ_EXPORT opj_cio_t* opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer, int length);
 
 /**
 Close and free a CIO handle
 @param cio CIO handle to free
 */
-void opj_cio_close(opj_cio_t *cio);
+OPJ_EXPORT void opj_cio_close(opj_cio_t *cio);
 
 /**
 Get position in byte stream
 @param cio CIO handle
 @return Returns the position in bytes
 */
-int cio_tell(opj_cio_t *cio);
+OPJ_EXPORT int cio_tell(opj_cio_t *cio);
 /**
 Set position in byte stream
 @param cio CIO handle
@@ -513,7 +527,7 @@ void cio_seek(opj_cio_t *cio, int pos);
 ==========================================================
 */
 
-opj_event_mgr_t* opj_set_event_mgr(opj_common_ptr cinfo, opj_event_mgr_t *event_mgr, void *context);
+OPJ_EXPORT opj_event_mgr_t* opj_set_event_mgr(opj_common_ptr cinfo, opj_event_mgr_t *event_mgr, void *context);
 
 /* 
 ==========================================================
@@ -525,42 +539,42 @@ Creates a J2K/JPT/JP2 decompression structure
 @param format Decoder to select
 @return Returns a handle to a decompressor if successful, returns NULL otherwise
 */
-opj_dinfo_t* opj_create_decompress(OPJ_CODEC_FORMAT format);
+OPJ_EXPORT opj_dinfo_t* opj_create_decompress(OPJ_CODEC_FORMAT format);
 /**
 Destroy a decompressor handle
 @param dinfo decompressor handle to destroy
 */
-void opj_destroy_decompress(opj_dinfo_t *dinfo);
+OPJ_EXPORT void opj_destroy_decompress(opj_dinfo_t *dinfo);
 /**
 Set decoding parameters to default values
 @param parameters Decompression parameters
 */
-void opj_set_default_decoder_parameters(opj_dparameters_t *parameters);
+OPJ_EXPORT void opj_set_default_decoder_parameters(opj_dparameters_t *parameters);
 /**
 Setup the decoder decoding parameters using user parameters.
 Decoding parameters are returned in j2k->cp. 
 @param dinfo decompressor handle
 @param parameters decompression parameters
 */
-void opj_setup_decoder(opj_dinfo_t *dinfo, opj_dparameters_t *parameters);
+OPJ_EXPORT void opj_setup_decoder(opj_dinfo_t *dinfo, opj_dparameters_t *parameters);
 /**
 Decode an image from a JPEG-2000 codestream
 @param dinfo decompressor handle
 @param cio Input buffer stream
 @return Returns a decoded image if successful, returns NULL otherwise
 */
-opj_image_t* opj_decode(opj_dinfo_t *dinfo, opj_cio_t *cio);
+OPJ_EXPORT opj_image_t* opj_decode(opj_dinfo_t *dinfo, opj_cio_t *cio);
 /**
 Creates a J2K/JP2 compression structure
 @param format Coder to select
 @return Returns a handle to a compressor if successful, returns NULL otherwise
 */
-opj_cinfo_t* opj_create_compress(OPJ_CODEC_FORMAT format);
+OPJ_EXPORT opj_cinfo_t* opj_create_compress(OPJ_CODEC_FORMAT format);
 /**
 Destroy a compressor handle
 @param cinfo compressor handle to destroy
 */
-void opj_destroy_compress(opj_cinfo_t *cinfo);
+OPJ_EXPORT void opj_destroy_compress(opj_cinfo_t *cinfo);
 /**
 Set encoding parameters to default values, that means : 
 <ul>
@@ -582,14 +596,14 @@ Set encoding parameters to default values, that means :
 </ul>
 @param parameters Compression parameters
 */
-void opj_set_default_encoder_parameters(opj_cparameters_t *parameters);
+OPJ_EXPORT void opj_set_default_encoder_parameters(opj_cparameters_t *parameters);
 /**
 Setup the encoder parameters using the current image and using user parameters. 
 @param cinfo compressor handle
 @param parameters compression parameters
 @param image input filled image
 */
-void opj_setup_encoder(opj_cinfo_t *cinfo, opj_cparameters_t *parameters, opj_image_t *image);
+OPJ_EXPORT void opj_setup_encoder(opj_cinfo_t *cinfo, opj_cparameters_t *parameters, opj_image_t *image);
 /**
 Encode an image into a JPEG-2000 codestream
 @param cinfo compressor handle
@@ -598,7 +612,7 @@ Encode an image into a JPEG-2000 codestream
 @param index Name of the index file if required, NULL otherwise
 @return Returns true if successful, returns false otherwise
 */
-bool opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, char *index);
+OPJ_EXPORT bool opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, char *index);
 
 #ifdef __cplusplus
 }