Lines Matching refs:jp2_image
275 *jp2_image; in ReadJP2Image() local
343 if (opj_read_header(jp2_stream,jp2_codec,&jp2_image) == 0) in ReadJP2Image()
356 jp2_status=opj_set_decode_area(jp2_codec,jp2_image, in ReadJP2Image()
361 jp2_status=opj_set_decode_area(jp2_codec,jp2_image,0,0, in ReadJP2Image()
362 jp2_image->comps[0].w,jp2_image->comps[0].h); in ReadJP2Image()
367 opj_image_destroy(jp2_image); in ReadJP2Image()
371 if ((AcquireMagickResource(WidthResource,(size_t) jp2_image->comps[0].w) == MagickFalse) || in ReadJP2Image()
372 (AcquireMagickResource(HeightResource,(size_t) jp2_image->comps[0].h) == MagickFalse)) in ReadJP2Image()
376 opj_image_destroy(jp2_image); in ReadJP2Image()
380 jp2_status=opj_get_decoded_tile(jp2_codec,jp2_stream,jp2_image, in ReadJP2Image()
385 jp2_status=opj_decode(jp2_codec,jp2_stream,jp2_image); in ReadJP2Image()
393 opj_image_destroy(jp2_image); in ReadJP2Image()
397 for (i=0; i < (ssize_t) jp2_image->numcomps; i++) in ReadJP2Image()
399 if ((jp2_image->comps[i].dx == 0) || (jp2_image->comps[i].dy == 0) || in ReadJP2Image()
400 (jp2_image->comps[0].prec != jp2_image->comps[i].prec) || in ReadJP2Image()
401 (jp2_image->comps[0].prec > 64) || in ReadJP2Image()
402 (jp2_image->comps[0].sgnd != jp2_image->comps[i].sgnd) || in ReadJP2Image()
403 ((image->ping == MagickFalse) && (jp2_image->comps[i].data == NULL))) in ReadJP2Image()
406 opj_image_destroy(jp2_image); in ReadJP2Image()
413 image->columns=(size_t) jp2_image->comps[0].w; in ReadJP2Image()
414 image->rows=(size_t) jp2_image->comps[0].h; in ReadJP2Image()
415 image->depth=jp2_image->comps[0].prec; in ReadJP2Image()
417 if (jp2_image->numcomps == 1) in ReadJP2Image()
420 if (jp2_image->color_space == 2) in ReadJP2Image()
423 if (jp2_image->numcomps > 1) in ReadJP2Image()
427 if (jp2_image->color_space == 3) in ReadJP2Image()
429 if (jp2_image->numcomps > 3) in ReadJP2Image()
431 if (jp2_image->icc_profile_buf != (unsigned char *) NULL) in ReadJP2Image()
436 profile=BlobToStringInfo(jp2_image->icc_profile_buf, in ReadJP2Image()
437 jp2_image->icc_profile_len); in ReadJP2Image()
447 opj_image_destroy(jp2_image); in ReadJP2Image()
454 opj_image_destroy(jp2_image); in ReadJP2Image()
470 for (i=0; i < (ssize_t) jp2_image->numcomps; i++) in ReadJP2Image()
480 pad=image->columns % jp2_image->comps[i].dx; in ReadJP2Image()
481 index=y/jp2_image->comps[i].dy*(image->columns+pad)/ in ReadJP2Image()
482 jp2_image->comps[i].dx+x/jp2_image->comps[i].dx; in ReadJP2Image()
484 (index >= (jp2_image->comps[i].h*jp2_image->comps[i].w))) in ReadJP2Image()
487 opj_image_destroy(jp2_image); in ReadJP2Image()
491 scale=QuantumRange/(double) ((1UL << jp2_image->comps[i].prec)-1); in ReadJP2Image()
492 pixel=scale*(jp2_image->comps[i].data[index]+ in ReadJP2Image()
493 (jp2_image->comps[i].sgnd ? 1UL << (jp2_image->comps[i].prec-1) : 0)); in ReadJP2Image()
498 if (jp2_image->numcomps == 1) in ReadJP2Image()
512 if (jp2_image->numcomps == 2) in ReadJP2Image()
545 opj_image_destroy(jp2_image); in ReadJP2Image()
725 static void CinemaProfileCompliance(const opj_image_t *jp2_image, in CinemaProfileCompliance() argument
748 if ((jp2_image->comps[0].w == 2048) || (jp2_image->comps[0].h == 1080)) in CinemaProfileCompliance()
760 if ((jp2_image->comps[0].w == 4096) || (jp2_image->comps[0].h == 2160)) in CinemaProfileCompliance()
789 parameters->tcp_rates[0]=((float) (jp2_image->numcomps*jp2_image->comps[0].w* in CinemaProfileCompliance()
790 jp2_image->comps[0].h*jp2_image->comps[0].prec))/(parameters->max_comp_size* in CinemaProfileCompliance()
791 8*jp2_image->comps[0].dx*jp2_image->comps[0].dy); in CinemaProfileCompliance()
832 *jp2_image; in WriteJP2Image() local
1012 jp2_image=opj_image_create((OPJ_UINT32) channels,jp2_info,jp2_colorspace); in WriteJP2Image()
1013 if (jp2_image == (opj_image_t *) NULL) in WriteJP2Image()
1018 jp2_image->x0=parameters->image_offset_x0; in WriteJP2Image()
1019 jp2_image->y0=parameters->image_offset_y0; in WriteJP2Image()
1020 jp2_image->x1=(unsigned int) (2*parameters->image_offset_x0+ in WriteJP2Image()
1022 jp2_image->y1=(unsigned int) (2*parameters->image_offset_y0+ in WriteJP2Image()
1027 CinemaProfileCompliance(jp2_image,parameters); in WriteJP2Image()
1029 jp2_image->comps[3].alpha=1; in WriteJP2Image()
1032 jp2_image->comps[1].alpha=1; in WriteJP2Image()
1057 scale=(double) (((size_t) 1UL << jp2_image->comps[i].prec)-1)/ in WriteJP2Image()
1059 q=jp2_image->comps[i].data+(ssize_t) (y*PerceptibleReciprocal( in WriteJP2Image()
1060 jp2_image->comps[i].dy)*image->columns*PerceptibleReciprocal( in WriteJP2Image()
1061 jp2_image->comps[i].dx)+x*PerceptibleReciprocal( in WriteJP2Image()
1062 jp2_image->comps[i].dx)); in WriteJP2Image()
1113 opj_setup_encoder(jp2_codec,parameters,jp2_image); in WriteJP2Image()
1118 opj_image_destroy(jp2_image); in WriteJP2Image()
1127 jp2_status=opj_start_compress(jp2_codec,jp2_image,jp2_stream); in WriteJP2Image()
1133 opj_image_destroy(jp2_image); in WriteJP2Image()
1142 opj_image_destroy(jp2_image); in WriteJP2Image()