opj_free(cstr_info->numdecompos);
}
}
+
+void* OPJ_CALLCONV opj_image_data_alloc(size_t size)
+{
+ /* NOTE: this defers from libopenjp2 where we use opj_aligned_malloc */
+ void* ret = opj_malloc(size);
+ /* printf("opj_image_data_alloc %p\n", ret); */
+ return ret;
+}
+
+void OPJ_CALLCONV opj_image_data_free(void* ptr)
+{
+ /* NOTE: this defers from libopenjp2 where we use opj_aligned_free */
+ /* printf("opj_image_data_free %p\n", ptr); */
+ opj_free(ptr);
+}
*/
OPJ_API void OPJ_CALLCONV opj_image_destroy(opj_image_t *image);
+/**
+ * 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(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