NAME
libopenjpeg - a library for reading and writing JPEG2000 image files. SYNOPSIS
#include
CONVERSION FORMATS PGX: imagetopgx() / pgxtoimage() PXM: imagetopnm() / pnmtoimage() BMP: imagetobmp() / bmptoimage() TIF: imagetotif() / tiftoimage() RAW: imagetoraw() / rawtoimage() TGA: imagetotga() / tgatoimage() PNG: imagetopng() / pngtoimage() YUV: imagetoyuv() / yuvtoimage() (MJ2) READ opjsetdefaultdecoderparameters(opjdparameterst *params); opjdinfot *opjcreatedecompress(OPJCODECFORMAT format); opjeventmgrt *opjseteventmgr(opjcommonptr info, opjeventmgrt *eventmgr, void *context); void opjsetupdecoder(opjdinfot *dinfo, opjdparameterst * params); opjciot *opjcioopen(opjcommonptr info, unsigned char *buf, int buflen); opjimaget *opjdecode(opjdinfot *dinfo, opjciot *cio); void opjcioclose(opjciot *cio); void opjdestroydecompress(opjdinfot *dinfo); void opjimagedestroy(opjimaget *image); WRITE void opjsetdefaultencoderparameters(opjcparameterst *params); /* opjimaget *FORMATtoimage(const char *fname, opjcparameterst *params); */ opjcinfot* opjcreatecompress(OPJCODECFORMAT format); opjeventmgrt *opjseteventmgr(opjcommonptr info, opjeventmgrt *eventmgr, void *context); void opjsetupencoder(opjcinfot *cinfo, opjcparameterst *params, opjimaget *image); opjciot *opjcioopen(opjcommonptr cinfo, NULL, 0); bool opjencode(opjcinfot *cinfo, opjciot *cio, opjimaget *image, char *index); void opjcioclose(opjciot *cio); void opjdestroycompress(opjcinfot *cinfo); void opjimagedestroy(opjimaget *image); GENERAL void opjimagecreate(int numcmpts, opjimagecmptparmt *cmptparms, OPJCOLORSPACE clrspc); int ciotell(opjciot *cio); void cioseek(opjciot *cio, int pos); opjimaget *opjdecodewithinfo(opjdinfot *dinfo, opjciot *cio, opjcodestreaminfot *cstrinfo); bool opjencodewithinfo(opjcinfot *cinfo, opjciot *cio, opjimaget *image, opjcodestreaminfot *cstrinfo); void opjdestroycstrinfo(opjcodestreaminfot *cstrinfo); const char *opjversion(void); OPJCODECFORMAT CODECJ2K or CODECJPT or CODECJP2 OPJCOLORSPACE CLRSPCUNKNOWN or CLRSPCUNSPECIFIED or CLRSPCSRGB or CLRSPCGRAY or CLRSPCSYCC DECOMPRESSION PARAMETERS typedef struct opjdparameters { /* Set the number of highest resolution levels to be discarded. The image resolution is effectively divided by 2 to the power of the number of discarded levels. The reduce factor is limited by the smallest total number of decomposition levels among tiles. if != 0, then original dimension divided by 2^(reduce); if == 0 or not used, image is decoded to the full resolution */ int cpreduce; /* Set the maximum number of quality layers to decode. If there are less quality layers than the specified number, all the quality layers are decoded. if != 0, then only the first "layer" layers are decoded; if == 0 or not used, all the quality layers are decoded */ int cplayer; /*command line encoder parameters (not used inside the library) */ /* input file name */ char infile[OPJPATHLEN]; /* output file name */ char outfile[OPJPATHLEN]; /* input file format: see OPJCODECFORMAT */ int decodformat; /* output file format */ int codformat; /*JPWL decoding parameters */ /* activates the JPWL correction capabilities */ bool jpwlcorrect; /* expected number of components */ int jpwlexpcomps; /* maximum number of tiles */ int jpwlmaxtiles; /* Specify whether the decoding should be done on the entire codestream, or be limited to the main header Limiting the decoding to the main header makes it possible to extract the characteristics of the codestream if == NOLIMITATION, the entire codestream is decoded; if == LIMITTOMAINHEADER, only the main header is decoded; */ OPJLIMITDECODING cplimitdecoding; } opjdparameterst; COMPRESSION PARAMETERS typedef struct opjcparameters { /* size of tile: tilesizeon = false (not in argument) or tilesizeon = true (in argument) */ bool tilesizeon; /* XTOsiz */ int cptx0; /* YTOsiz */ int cpty0; /* XTsiz */ int cptdx; /* YTsiz */ int cptdy; /* allocation by rate/distortion */ int cpdistoalloc; /* allocation by fixed layer */ int cpfixedalloc; /* add fixedquality */ int cpfixedquality; /* fixed layer */ int *cpmatrice; /* comment for coding */ char *cpcomment; /* coding style */ int csty; /* progression order: PROGUNKNOWN, LRCP(default), RLCP, RPCL, PCRL, CPRL */ OPJPROGORDER progorder; /* progression order changes */ opjpoct POC[32]; /* number of progression order changes (POC), default: 0 */ int numpocs; /* number of layers */ int tcpnumlayers; /* rates of layers */ float tcprates[100]; /* different psnr for successive layers */ float tcpdistoratio[100]; /* number of resolutions */ int numresolution; /* initial code block width, default: 64 */ int cblockwinit; /* initial code block height, default: 64 */ int cblockhinit; /* mode switch (cblkstyle) */ /* 1 : use the irreversible DWT 9-7, 0 : use lossless compression (default) */ int irreversible; /* region of interest: affected component in [0..3],
-1 means no ROI */ int roicompno; /* region of interest: upshift value */ int roishift; /* number of precinct size specifications */ int resspec; /* initial precinct width */ int prcwinit[J2KMAXRLVLS]; /* initial precinct height */ int prchinit[J2KMAXRLVLS]; /*command line encoder parameters (not used inside the library) */ /* input file name */ char infile[OPJPATHLEN]; /* output file name */ char outfile[OPJPATHLEN]; /* DEPRECATED. Index generation is now handeld with the opjencodewithinfo() function. Set to NULL */ int indexon; /* DEPRECATED. Index generation is now handeld with the opjencodewithinfo() function. Set to NULL */ char index[OPJPATHLEN]; /* subimage encoding: origin image offset in x direction */ int imageoffsetx0; /* subimage encoding: origin image offset in y direction */ int imageoffsety0; /* subsampling value for dx */ int subsamplingdx; /* subsampling value for dy */ int subsamplingdy; /* input file format */ int decodformat; /* output file format: see OPJCODECFORMAT */ int codformat; /*JPWL encoding parameters */ /* enables writing of EPC in MH, thus activating JPWL */ bool jpwlepcon;
/* error protection method for MH (0,1,16,32,37-128) */ int jpwlhprotMH; /* tile number of header protection specification (>=0) */ int jpwlhprotTPHtileno[JPWLMAXNOTILESPECS];
/* error protection methods for TPHs (0,1,16,32,37-128) */ int jpwlhprotTPH[JPWLMAXNOTILESPECS]; /* tile number of packet protection specification (>=0) */ int jpwlpprottileno[JPWLMAXNOPACKSPECS]; /* packet number of packet protection specification (>=0) */ int jpwlpprotpackno[JPWLMAXNOPACKSPECS];
/* error protection methods for packets (0,1,16,32,37-128) */ int jpwlpprot[JPWLMAXNOPACKSPECS]; /* enables writing of ESD, (0=no/1/2 bytes) */ int jpwlsenssize; /* sensitivity addressing size (0=auto/2/4 bytes) */ int jpwlsensaddr;
/* sensitivity range (0-3) */ int jpwlsensrange;
/* sensitivity method for MH (-1=no,0-7) */ int jpwlsensMH; /* tile number of sensitivity specification (>=0) */ int jpwlsensTPHtileno[JPWLMAXNOTILESPECS];
/* sensitivity methods for TPHs (-1=no,0-7) */ int jpwlsensTPH[JPWLMAXNOTILESPECS];
/* Digital Cinema compliance: OFF-not compliant, CINEMA2K24, CINEMA2K48, CINEMA4K24 */ OPJCINEMAMODE cpcinema; /* Maximum rate for each component. If == 0, component size limitation is not considered */ int maxcompsize; /* Profile name*/ OPJRSIZCAPABILITIES cprsiz; /* Tile part generation*/ char tpon; /* Flag for Tile part generation*/ char tpflag; /* MCT (multiple component transform) */ char tcpmct; } opjcparameterst; AUTHORS
Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
Copyright (c) 2002-2007, Professor Benoit Macq
Copyright (c) 2001-2003, David Janssens
Copyright (c) 2002-2003, Yannick Verschueren
Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe Copyright (c) 2005, Herve Drolon, FreeImage Team
Copyright (c) 2006-2007, Parvatha Elangovan SEE ALSO imagetoj2k(1) j2ktoimage(1) j2kdump(1) JPWLimagetoj2k(1) JPWLj2ktoimage(1) extractj2kfrommj2(1) wrapj2kinmj2(1) framestomj2(1) mj2toframes(1) Version 1.4.0 Oct 2010 libopenjpeg(3)