19 #include "jasper/jasper.h"
45 jas_image_t *image = NULL;
46 jas_stream_t *jpcstream;
47 jas_image_cmpt_t *pcmpt;
53 jpcstream = jas_stream_memopen(injpc, bufsize);
56 if (!(image = jpc_decode(jpcstream, opts)))
58 printf(
" jpc_decode return\n");
62 pcmpt = image->cmpts_[0];
94 if (image->numcmpts_ != 1)
96 printf(
"dec_jpeg2000: Found color image. Grayscale expected.\n");
102 data = jas_matrix_create(jas_image_height(image), jas_image_width(image));
103 jas_image_readcmpt(image, 0, 0, 0, jas_image_width(image),
104 jas_image_height(image), data);
108 for (i = 0; i < pcmpt->height_; i++)
109 for (j = 0; j < pcmpt->width_; j++)
110 outfld[k++] = data->rows_[i][j];
113 jas_matrix_destroy(data);
114 jas_stream_close(jpcstream);
115 jas_image_destroy(image);
int dec_jpeg2000(char *injpc, g2int bufsize, g2int *outfld)
This Function decodes a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i....
Header file for NCEPLIBS-g2c library.
int64_t g2int
Long integer type.