/* deprecated attribute */
#ifdef __GNUC__
- #define DEPRECATED(func) func __attribute__ ((deprecated))
+ #define OPJ_DEPRECATED(func) func __attribute__ ((deprecated))
#elif defined(_MSC_VER)
- #define DEPRECATED(func) __declspec(deprecated) func
+ #define OPJ_DEPRECATED(func) __declspec(deprecated) func
#else
#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
- #define DEPRECATED(func) func
+ #define OPJ_DEPRECATED(func) func
#endif
#if defined(OPJ_STATIC) || !defined(_WIN32)
*/
typedef enum COLOR_SPACE {
OPJ_CLRSPC_UNKNOWN = -1, /**< not supported by the library */
- OPJ_CLRSPC_UNSPECIFIED = 0, /**< not specified in the codestream */
+ OPJ_CLRSPC_UNSPECIFIED = 0, /**< not specified in the codestream */
OPJ_CLRSPC_SRGB = 1, /**< sRGB */
OPJ_CLRSPC_GRAY = 2, /**< grayscale */
- OPJ_CLRSPC_SYCC = 3 /**< YUV */
+ OPJ_CLRSPC_SYCC = 3, /**< YUV */
+ OPJ_CLRSPC_EYCC = 4 /**< e-YCC */
} OPJ_COLOR_SPACE;
/**
OPJ_UINT32 factor;
/** image component data */
OPJ_INT32 *data;
+ /** alpha channel */
+ OPJ_UINT16 alpha;
} opj_image_comp_t;
/**
*
* @param p_stream the stream to destroy.
*/
-OPJ_API void OPJ_CALLCONV opj_stream_destroy(opj_stream_t* p_stream);
+OPJ_DEPRECATED(OPJ_API void OPJ_CALLCONV opj_stream_destroy(opj_stream_t* p_stream));
+
+/**
+ * Destroys a stream created by opj_create_stream. This function does NOT close the abstract stream.
+ * If needed the user must close its own implementation of the stream.
+ *
+ * @param p_stream the stream to destroy.
+ */
OPJ_API void OPJ_CALLCONV opj_stream_destroy_v3(opj_stream_t* p_stream);
/**
* @param p_file the file stream to operate on
* @param p_is_read_stream whether the stream is a read stream (true) or not (false)
*/
-OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream (FILE * p_file, OPJ_BOOL p_is_read_stream);
+OPJ_DEPRECATED(OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream (FILE * p_file, OPJ_BOOL p_is_read_stream));
+
+/**
+ * Create a stream from a file identified with its filename with default parameters (helper function)
+ * @param fname the filename of the file to stream
+ * @param p_is_read_stream whether the stream is a read stream (true) or not (false)
+*/
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream_v3 (const char *fname, OPJ_BOOL p_is_read_stream);
/**
* @param p_buffer_size size of the chunk used to stream
* @param p_is_read_stream whether the stream is a read stream (true) or not (false)
*/
-OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream (FILE * p_file,
+OPJ_DEPRECATED(OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream (FILE * p_file,
OPJ_SIZE_T p_buffer_size,
- OPJ_BOOL p_is_read_stream);
+ OPJ_BOOL p_is_read_stream));
+
+/** Create a stream from a file identified with its filename with a specific buffer size
+ * @param fname the filename of the file to stream
+ * @param p_buffer_size size of the chunk used to stream
+ * @param p_is_read_stream whether the stream is a read stream (true) or not (false)
+*/
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream_v3 (const char *fname,
OPJ_SIZE_T p_buffer_size,
OPJ_BOOL p_is_read_stream);