libopenjp2.3 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. '\" t
  2. '\" The line above instructs most `man' programs to invoke tbl
  3. '\"
  4. '\" Separate paragraphs; not the same as PP which resets indent level.
  5. .de SP
  6. .if t .sp .5
  7. .if n .sp
  8. ..
  9. '\"
  10. '\" Replacement em-dash for nroff (default is too short).
  11. .ie n .ds m " -
  12. .el .ds m \(em
  13. '\"
  14. '\" Placeholder macro for if longer nroff arrow is needed.
  15. .ds RA \(->
  16. '\"
  17. '\" Decimal point set slightly raised
  18. .if t .ds d \v'-.15m'.\v'+.15m'
  19. .if n .ds d .
  20. '\"
  21. '\" Enclosure macro for examples
  22. .de EX
  23. .SP
  24. .nf
  25. .ft CW
  26. ..
  27. .de EE
  28. .ft R
  29. .SP
  30. .fi
  31. ..
  32. .TH libopenjp2 3 "Oct 2010" "Version 1.4.0" "Oct 2010"
  33. .P
  34. .SH NAME
  35. libopenjp2 -
  36. a library for reading and writing JPEG2000 image files.
  37. .SP
  38. .SH SYNOPSIS
  39. .P
  40. .B #include <openjpeg.h>
  41. .P
  42. .SS CONVERSION FORMATS
  43. .B PGX: imagetopgx() \fR/\fB pgxtoimage()
  44. .P
  45. .B PXM: imagetopnm() \fR/\fB pnmtoimage()
  46. .P
  47. .B BMP: imagetobmp() \fR/\fB bmptoimage()
  48. .P
  49. .B TIF: imagetotif() \fR/\fB tiftoimage()
  50. .P
  51. .B RAW: imagetoraw() \fR/\fB rawtoimage()
  52. .P
  53. .B TGA: imagetotga() \fR/\fB tgatoimage()
  54. .P
  55. .B PNG: imagetopng() \fR/\fB pngtoimage()
  56. .P
  57. .B YUV: imagetoyuv() \fR/\fB yuvtoimage() \fR(MJ2)
  58. .P
  59. .SS READ
  60. .B opj_set_default_decoder_parameters(opj_dparameters_t *\fIparams\fB);
  61. .P
  62. .B opj_dinfo_t *opj_create_decompress(OPJ_CODEC_FORMAT \fIformat\fB);
  63. .P
  64. .B opj_event_mgr_t *opj_set_event_mgr(opj_common_ptr \fIinfo\fB, opj_event_mgr_t *\fIevent_mgr\fB, void *\fIcontext\fB);
  65. .P
  66. .B void opj_setup_decoder(opj_dinfo_t *\fIdinfo\fB, opj_dparameters_t * \fIparams\fB);
  67. .P
  68. .B opj_cio_t *opj_cio_open(opj_common_ptr \fIinfo\fB, unsigned char *\fIbuf\fB, int \fIbuf_len\fB);
  69. .P
  70. .B opj_image_t *opj_decode(opj_dinfo_t *\fIdinfo\fB, opj_cio_t *\fIcio\fB);
  71. .P
  72. .B void opj_cio_close(opj_cio_t *\fIcio\fB);
  73. .P
  74. .B void opj_destroy_decompress(opj_dinfo_t *\fIdinfo\fB);
  75. .P
  76. .B void opj_image_destroy(opj_image_t *\fIimage\fB);
  77. .P
  78. .SS WRITE
  79. .B void opj_set_default_encoder_parameters(opj_cparameters_t *\fIparams\fB);
  80. .P
  81. /*
  82. .B opj_image_t *FORMATtoimage(const char *\fIfname\fB, opj_cparameters_t *\fIparams\fB);
  83. .P
  84. */
  85. .br
  86. .B opj_cinfo_t* opj_create_compress(OPJ_CODEC_FORMAT \fIformat\fB);
  87. .P
  88. .B opj_event_mgr_t *opj_set_event_mgr(opj_common_ptr \fIinfo\fB, opj_event_mgr_t *\fIevent_mgr\fB, void *\fIcontext\fB);
  89. .P
  90. .B void opj_setup_encoder(opj_cinfo_t *\fIcinfo\fB, opj_cparameters_t *\fIparams\fB, opj_image_t *\fIimage\fB);
  91. .P
  92. .B opj_cio_t *opj_cio_open(opj_common_ptr \fIcinfo\fB, \fINULL\fB, \fI0\fB);
  93. .P
  94. .B bool opj_encode(opj_cinfo_t *\fIcinfo\fB, opj_cio_t *\fIcio\fB, opj_image_t *\fIimage\fB, char *\fIindex\fB);
  95. .P
  96. .B void opj_cio_close(opj_cio_t *\fIcio\fB);
  97. .P
  98. .B void opj_destroy_compress(opj_cinfo_t *\fIcinfo\fB);
  99. .P
  100. .B void opj_image_destroy(opj_image_t *\fIimage\fB);
  101. .P
  102. .SS GENERAL
  103. .P
  104. .B void opj_image_create(int \fInumcmpts\fB, opj_image_cmptparm_t *\fIcmptparms\fB, OPJ_COLOR_SPACE \fIclrspc\fB);
  105. .P
  106. .B int cio_tell(opj_cio_t *\fIcio\fB);
  107. .P
  108. .B void cio_seek(opj_cio_t *\fIcio\fB, int \fIpos\fB);
  109. .P
  110. .B opj_image_t *opj_decode_with_info(opj_dinfo_t *\fIdinfo\fB, opj_cio_t *\fIcio\fB, opj_codestream_info_t *\fIcstr_info\fB);
  111. .P
  112. .B bool opj_encode_with_info(opj_cinfo_t *\fIcinfo\fB, opj_cio_t *\fIcio\fB, opj_image_t *\fIimage\fB, opj_codestream_info_t *\fIcstr_info\fB);
  113. .P
  114. .B void opj_destroy_cstr_info(opj_codestream_info_t *\fIcstr_info\fB);
  115. .P
  116. .B const char *opj_version(\fIvoid\fB);
  117. .P
  118. .SH OPJ_CODEC_FORMAT
  119. .P
  120. .B CODEC_J2K\fR or \fBCODEC_JPT\fR or \fBCODEC_JP2
  121. .P
  122. .SH OPJ_COLOR_SPACE
  123. .P
  124. .B CLRSPC_UNKNOWN\fR or \fBCLRSPC_UNSPECIFIED\fR or \fBCLRSPC_SRGB\fR or \fBCLRSPC_GRAY\fR or \fBCLRSPC_SYCC
  125. .P
  126. .SH DECOMPRESSION PARAMETERS
  127. .p
  128. typedef struct opj_dparameters
  129. .br
  130. {
  131. /*
  132. Set the number of highest resolution levels to be discarded.
  133. The image resolution is effectively divided by 2 to the power
  134. of the number of discarded levels.
  135. The reduce factor is limited by the smallest total number of
  136. decomposition levels among tiles.
  137. if != 0, then original dimension divided by 2^(reduce);
  138. if == 0 or not used, image is decoded to the full resolution
  139. */
  140. \fBint\fR cp_reduce;
  141. /*
  142. Set the maximum number of quality layers to decode.
  143. If there are less quality layers than the specified number,
  144. all the quality layers are decoded.
  145. if != 0, then only the first "layer" layers are decoded;
  146. if == 0 or not used, all the quality layers are decoded
  147. */
  148. \fBint\fR cp_layer;
  149. /*command line encoder parameters (not used inside the library) */
  150. /* input file name */
  151. \fBchar\fR infile[OPJ_PATH_LEN];
  152. /* output file name */
  153. \fBchar\fR outfile[OPJ_PATH_LEN];
  154. /* input file format: see OPJ_CODEC_FORMAT */
  155. \fBint\fR decod_format;
  156. /* output file format */
  157. \fBint\fR cod_format;
  158. /*JPWL decoding parameters */
  159. /* activates the JPWL correction capabilities */
  160. \fBbool\fR jpwl_correct;
  161. /* expected number of components */
  162. \fBint\fR jpwl_exp_comps;
  163. /* maximum number of tiles */
  164. \fBint\fR jpwl_max_tiles;
  165. /*
  166. Specify whether the decoding should be done on the entire
  167. codestream, or be limited to the main header
  168. Limiting the decoding to the main header makes it possible
  169. to extract the characteristics of the codestream
  170. if == NO_LIMITATION, the entire codestream is decoded;
  171. if == LIMIT_TO_MAIN_HEADER, only the main header is decoded;
  172. */
  173. \fBOPJ_LIMIT_DECODING\fR cp_limit_decoding;
  174. .br
  175. } opj_dparameters_t;
  176. .SH COMPRESSION PARAMETERS
  177. .P
  178. typedef struct opj_cparameters
  179. .br
  180. {
  181. /* size of tile: tile_size_on = false (not in argument)
  182. or tile_size_on = true (in argument) */
  183. \fBbool\fR tile_size_on;
  184. /* XTOsiz */
  185. \fBint\fR cp_tx0;
  186. /* YTOsiz */
  187. \fBint\fR cp_ty0;
  188. /* XTsiz */
  189. \fBint\fR cp_tdx;
  190. /* YTsiz */
  191. \fBint\fR cp_tdy;
  192. /* allocation by rate/distortion */
  193. \fBint\fR cp_disto_alloc;
  194. /* allocation by fixed layer */
  195. \fBint\fR cp_fixed_alloc;
  196. /* add fixed_quality */
  197. \fBint\fR cp_fixed_quality;
  198. /* fixed layer */
  199. \fBint *\fRcp_matrice;
  200. /* comment for coding */
  201. \fBchar *\fRcp_comment;
  202. /* coding style */
  203. \fBint\fR csty;
  204. /* progression order:
  205. PROG_UNKNOWN, LRCP(default), RLCP, RPCL, PCRL, CPRL */
  206. \fBOPJ_PROG_ORDER\fR prog_order;
  207. /* progression order changes */
  208. \fBopj_poc_t\fR POC[32];
  209. /* number of progression order changes (POC), default: 0 */
  210. \fBint\fR numpocs;
  211. /* number of layers */
  212. \fBint\fR tcp_numlayers;
  213. /* rates of layers */
  214. \fBfloat\fR tcp_rates[100];
  215. /* different psnr for successive layers */
  216. \fBfloat\fR tcp_distoratio[100];
  217. /* number of resolutions */
  218. \fBint\fR numresolution;
  219. /* initial code block width, default: 64 */
  220. \fBint\fR cblockw_init;
  221. /* initial code block height, default: 64 */
  222. \fBint\fR cblockh_init;
  223. /* mode switch (cblk_style) */
  224. /* 1 : use the irreversible DWT 9-7,
  225. 0 : use lossless compression (default) */
  226. \fBint\fR irreversible;
  227. /* region of interest: affected component in [0..3],
  228. -1 means no ROI */
  229. \fBint\fR roi_compno;
  230. /* region of interest: upshift value */
  231. \fBint\fR roi_shift;
  232. /* number of precinct size specifications */
  233. \fBint\fR res_spec;
  234. /* initial precinct width */
  235. \fBint\fR prcw_init[J2K_MAXRLVLS];
  236. /* initial precinct height */
  237. \fBint\fR prch_init[J2K_MAXRLVLS];
  238. /*command line encoder parameters (not used inside the library) */
  239. /* input file name */
  240. \fBchar\fR infile[OPJ_PATH_LEN];
  241. /* output file name */
  242. \fBchar\fR outfile[OPJ_PATH_LEN];
  243. /* DEPRECATED. Index generation is now handeld with the
  244. opj_encode_with_info() function. Set to NULL */
  245. \fBint\fR index_on;
  246. /* DEPRECATED. Index generation is now handeld with the
  247. opj_encode_with_info() function. Set to NULL */
  248. \fBchar\fR index[OPJ_PATH_LEN];
  249. /* subimage encoding: origin image offset in x direction */
  250. \fBint\fR image_offset_x0;
  251. /* subimage encoding: origin image offset in y direction */
  252. \fBint\fR image_offset_y0;
  253. /* subsampling value for dx */
  254. \fBint\fR subsampling_dx;
  255. /* subsampling value for dy */
  256. \fBint\fR subsampling_dy;
  257. /* input file format */
  258. \fBint\fR decod_format;
  259. /* output file format: see OPJ_CODEC_FORMAT */
  260. \fBint\fR cod_format;
  261. /*JPWL encoding parameters */
  262. /* enables writing of EPC in MH, thus activating JPWL */
  263. \fBbool\fR jpwl_epc_on;
  264. /* error protection method for MH (0,1,16,32,37-128) */
  265. \fBint\fR jpwl_hprot_MH;
  266. /* tile number of header protection specification (>=0) */
  267. \fBint\fR jpwl_hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS];
  268. /* error protection methods for TPHs (0,1,16,32,37-128) */
  269. \fBint\fR jpwl_hprot_TPH[JPWL_MAX_NO_TILESPECS];
  270. /* tile number of packet protection specification (>=0) */
  271. \fBint\fR jpwl_pprot_tileno[JPWL_MAX_NO_PACKSPECS];
  272. /* packet number of packet protection specification (>=0) */
  273. \fBint\fR jpwl_pprot_packno[JPWL_MAX_NO_PACKSPECS];
  274. /* error protection methods for packets (0,1,16,32,37-128) */
  275. \fBint\fR jpwl_pprot[JPWL_MAX_NO_PACKSPECS];
  276. /* enables writing of ESD, (0=no/1/2 bytes) */
  277. \fBint\fR jpwl_sens_size;
  278. /* sensitivity addressing size (0=auto/2/4 bytes) */
  279. \fBint\fR jpwl_sens_addr;
  280. /* sensitivity range (0-3) */
  281. \fBint\fR jpwl_sens_range;
  282. /* sensitivity method for MH (-1=no,0-7) */
  283. \fBint\fR jpwl_sens_MH;
  284. /* tile number of sensitivity specification (>=0) */
  285. \fBint\fR jpwl_sens_TPH_tileno[JPWL_MAX_NO_TILESPECS];
  286. /* sensitivity methods for TPHs (-1=no,0-7) */
  287. \fBint\fR jpwl_sens_TPH[JPWL_MAX_NO_TILESPECS];
  288. /* Digital Cinema compliance: OFF-not compliant,
  289. CINEMA2K_24, CINEMA2K_48, CINEMA4K_24 */
  290. \fBOPJ_CINEMA_MODE\fR cp_cinema;
  291. /* Maximum rate for each component.
  292. If == 0, component size limitation is not considered */
  293. \fBint\fR max_comp_size;
  294. /* Profile name*/
  295. \fBOPJ_RSIZ_CAPABILITIES\fR cp_rsiz;
  296. /* Tile part generation*/
  297. \fBchar\fR tp_on;
  298. /* Flag for Tile part generation*/
  299. \fBchar\fR tp_flag;
  300. /* MCT (multiple component transform) */
  301. \fBchar\fR tcp_mct;
  302. .br
  303. } opj_cparameters_t;
  304. '\".SH OPTIONS
  305. '\".SH BUGS
  306. .SH AUTHORS
  307. Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
  308. Copyright (c) 2002-2014, Professor Benoit Macq
  309. Copyright (c) 2001-2003, David Janssens
  310. Copyright (c) 2002-2003, Yannick Verschueren
  311. Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
  312. Copyright (c) 2005, Herve Drolon, FreeImage Team
  313. Copyright (c) 2006-2007, Parvatha Elangovan
  314. .P
  315. .SH "SEE ALSO"
  316. \fBimage_to_j2k\fR(1) \fBj2k_to_image\fR(1) \fBj2k_dump\fR(1)
  317. \fBJPWL_image_to_j2k\fR(1) \fBJPWL_j2k_to_image\fR(1)
  318. \fBextract_j2k_from_mj2\fR(1) \fBwrap_j2k_in_mj2\fR(1)
  319. \fBframes_to_mj2\fR(1) \fBmj2_to_frames\fR(1)