diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2017-07-06 01:47:40 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2017-08-07 18:32:52 +0200 |
| commit | f58aab9d6a57e48bdc60e15dd373c24de74719a9 (patch) | |
| tree | 8c2153b701957850fc186d5fd74decc61e30220e /src/lib/openjp2/openjpeg.h | |
| parent | 61fb5dd7f81c2e3dfabbb99f59dc89572d59fa37 (diff) | |
Add opj_image_data_alloc() / opj_image_data_free()
As bin/common/color.c used to directly call malloc()/free(), we need
to export functions dedicated to allocating/freeing image component data.
Diffstat (limited to 'src/lib/openjp2/openjpeg.h')
| -rw-r--r-- | src/lib/openjp2/openjpeg.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/openjp2/openjpeg.h b/src/lib/openjp2/openjpeg.h index 0aea383b..5fbf7ac3 100644 --- a/src/lib/openjp2/openjpeg.h +++ b/src/lib/openjp2/openjpeg.h @@ -1093,6 +1093,27 @@ OPJ_API void OPJ_CALLCONV opj_image_destroy(opj_image_t *image); OPJ_API opj_image_t* OPJ_CALLCONV opj_image_tile_create(OPJ_UINT32 numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc); +/** + * Allocator for opj_image_t->comps[].data + * To be paired with opj_image_data_free. + * + * @param size number of bytes to allocate + * + * @return a new pointer if successful, NULL otherwise. + * @since 2.2.0 +*/ +OPJ_API void* OPJ_CALLCONV opj_image_data_alloc(OPJ_SIZE_T size); + +/** + * Destructor for opj_image_t->comps[].data + * To be paired with opj_image_data_alloc. + * + * @param ptr Pointer to free + * + * @since 2.2.0 +*/ +OPJ_API void OPJ_CALLCONV opj_image_data_free(void* ptr); + /* ========================================================== stream functions definitions |
