void jp2_destroy_compress(opj_jp2_t *jp2) { if(jp2) { /* destroy the J2K codec */ j2k_destroy_compress(jp2->j2k); if(jp2->comps) { opj_free(jp2->comps); } if(jp2->cl) { opj_free(jp2->cl); } opj_free(jp2); } }
void jp2_destroy_compress(opj_jp2_t *jp2) { if(jp2) { /* destroy the J2K codec */ j2k_destroy_compress(jp2->j2k); if(jp2->comps) { opj_free(jp2->comps); } if(jp2->cl) { opj_free(jp2->cl); } //if (jp2->xmp_data != 0) // opj_free(jp2->xmp_data); opj_free(jp2); } }
void OPJ_CALLCONV opj_destroy_compress(opj_cinfo_t *cinfo) { if(cinfo) { /* destroy the codec */ switch(cinfo->codec_format) { case CODEC_J2K: j2k_destroy_compress((opj_j2k_t*)cinfo->j2k_handle); break; case CODEC_JP2: jp2_destroy_compress((opj_jp2_t*)cinfo->jp2_handle); break; case CODEC_JPT: case CODEC_UNKNOWN: default: break; } /* destroy the decompressor */ opj_free(cinfo); } }