Logo Search packages:      
Sourcecode: gdcm version File versions

void j2k_destroy_compress ( opj_j2k_t j2k  ) 

Destroy a J2K compressor handle

Parameters:
j2k J2K compressor handle to destroy

Definition at line 1378 of file j2k.c.

References opj_cp::comment, opj_j2k::cp, opj_j2k::image_info, opj_image_info::index_on, opj_cp::matrice, opj_free(), opj_tile_info::packet, opj_tcp::tccps, opj_cp::tcps, opj_cp::th, opj_tile_info::thresh, opj_image_info::tile, and opj_cp::tw.

Referenced by jp2_destroy_compress().

                                          {
      int tileno;

      if(!j2k) return;

      if(j2k->image_info != NULL) {
            opj_image_info_t *image_info = j2k->image_info;
            if (image_info->index_on && j2k->cp) {
                  opj_cp_t *cp = j2k->cp;
                  for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {
                        opj_tile_info_t *tile_info = &image_info->tile[tileno];
                        opj_free(tile_info->thresh);
                        opj_free(tile_info->packet);
                  }
                  opj_free(image_info->tile);
            }
            opj_free(image_info);
      }
      if(j2k->cp != NULL) {
            opj_cp_t *cp = j2k->cp;

            if(cp->comment) {
                  opj_free(cp->comment);
            }
            if(cp->matrice) {
                  opj_free(cp->matrice);
            }
            for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {
                  opj_free(cp->tcps[tileno].tccps);
            }
            opj_free(cp->tcps);
            opj_free(cp);
      }

      opj_free(j2k);
}


Generated by  Doxygen 1.6.0   Back to index