1/*
2 * Copyright (c) 1999-2000 Image Power, Inc. and the University of
3 *   British Columbia.
4 * Copyright (c) 2001-2002 Michael David Adams.
5 * All rights reserved.
6 */
7
8/* __START_OF_JASPER_LICENSE__
9 *
10 * JasPer Software License
11 *
12 * IMAGE POWER JPEG-2000 PUBLIC LICENSE
13 * ************************************
14 *
15 * GRANT:
16 *
17 * Permission is hereby granted, free of charge, to any person (the "User")
18 * obtaining a copy of this software and associated documentation, to deal
19 * in the JasPer Software without restriction, including without limitation
20 * the right to use, copy, modify, merge, publish, distribute, sublicense,
21 * and/or sell copies of the JasPer Software (in source and binary forms),
22 * and to permit persons to whom the JasPer Software is furnished to do so,
23 * provided further that the License Conditions below are met.
24 *
25 * License Conditions
26 * ******************
27 *
28 * A.  Redistributions of source code must retain the above copyright notice,
29 * and this list of conditions, and the following disclaimer.
30 *
31 * B.  Redistributions in binary form must reproduce the above copyright
32 * notice, and this list of conditions, and the following disclaimer in
33 * the documentation and/or other materials provided with the distribution.
34 *
35 * C.  Neither the name of Image Power, Inc. nor any other contributor
36 * (including, but not limited to, the University of British Columbia and
37 * Michael David Adams) may be used to endorse or promote products derived
38 * from this software without specific prior written permission.
39 *
40 * D.  User agrees that it shall not commence any action against Image Power,
41 * Inc., the University of British Columbia, Michael David Adams, or any
42 * other contributors (collectively "Licensors") for infringement of any
43 * intellectual property rights ("IPR") held by the User in respect of any
44 * technology that User owns or has a right to license or sublicense and
45 * which is an element required in order to claim compliance with ISO/IEC
46 * 15444-1 (i.e., JPEG-2000 Part 1).  "IPR" means all intellectual property
47 * rights worldwide arising under statutory or common law, and whether
48 * or not perfected, including, without limitation, all (i) patents and
49 * patent applications owned or licensable by User; (ii) rights associated
50 * with works of authorship including copyrights, copyright applications,
51 * copyright registrations, mask work rights, mask work applications,
52 * mask work registrations; (iii) rights relating to the protection of
53 * trade secrets and confidential information; (iv) any right analogous
54 * to those set forth in subsections (i), (ii), or (iii) and any other
55 * proprietary rights relating to intangible property (other than trademark,
56 * trade dress, or service mark rights); and (v) divisions, continuations,
57 * renewals, reissues and extensions of the foregoing (as and to the extent
58 * applicable) now existing, hereafter filed, issued or acquired.
59 *
60 * E.  If User commences an infringement action against any Licensor(s) then
61 * such Licensor(s) shall have the right to terminate User's license and
62 * all sublicenses that have been granted hereunder by User to other parties.
63 *
64 * F.  This software is for use only in hardware or software products that
65 * are compliant with ISO/IEC 15444-1 (i.e., JPEG-2000 Part 1).  No license
66 * or right to this Software is granted for products that do not comply
67 * with ISO/IEC 15444-1.  The JPEG-2000 Part 1 standard can be purchased
68 * from the ISO.
69 *
70 * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE.
71 * NO USE OF THE JASPER SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
72 * THIS DISCLAIMER.  THE JASPER SOFTWARE IS PROVIDED BY THE LICENSORS AND
73 * CONTRIBUTORS UNDER THIS LICENSE ON AN ``AS-IS'' BASIS, WITHOUT WARRANTY
74 * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
75 * WARRANTIES THAT THE JASPER SOFTWARE IS FREE OF DEFECTS, IS MERCHANTABLE,
76 * IS FIT FOR A PARTICULAR PURPOSE OR IS NON-INFRINGING.  THOSE INTENDING
77 * TO USE THE JASPER SOFTWARE OR MODIFICATIONS THEREOF FOR USE IN HARDWARE
78 * OR SOFTWARE PRODUCTS ARE ADVISED THAT THEIR USE MAY INFRINGE EXISTING
79 * PATENTS, COPYRIGHTS, TRADEMARKS, OR OTHER INTELLECTUAL PROPERTY RIGHTS.
80 * THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE JASPER SOFTWARE
81 * IS WITH THE USER.  SHOULD ANY PART OF THE JASPER SOFTWARE PROVE DEFECTIVE
82 * IN ANY RESPECT, THE USER (AND NOT THE INITIAL DEVELOPERS, THE UNIVERSITY
83 * OF BRITISH COLUMBIA, IMAGE POWER, INC., MICHAEL DAVID ADAMS, OR ANY
84 * OTHER CONTRIBUTOR) SHALL ASSUME THE COST OF ANY NECESSARY SERVICING,
85 * REPAIR OR CORRECTION.  UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY,
86 * WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE
87 * INITIAL DEVELOPER, THE UNIVERSITY OF BRITISH COLUMBIA, IMAGE POWER, INC.,
88 * MICHAEL DAVID ADAMS, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE
89 * JASPER SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO
90 * THE USER OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
91 * CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
92 * DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
93 * MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF
94 * SUCH PARTY HAD BEEN INFORMED, OR OUGHT TO HAVE KNOWN, OF THE POSSIBILITY
95 * OF SUCH DAMAGES.  THE JASPER SOFTWARE AND UNDERLYING TECHNOLOGY ARE NOT
96 * FAULT-TOLERANT AND ARE NOT DESIGNED, MANUFACTURED OR INTENDED FOR USE OR
97 * RESALE AS ON-LINE CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING
98 * FAIL-SAFE PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES,
99 * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT
100 * LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
101 * JASPER SOFTWARE OR UNDERLYING TECHNOLOGY OR PRODUCT COULD LEAD DIRECTLY
102 * TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE
103 * ("HIGH RISK ACTIVITIES").  LICENSOR SPECIFICALLY DISCLAIMS ANY EXPRESS
104 * OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.  USER WILL NOT
105 * KNOWINGLY USE, DISTRIBUTE OR RESELL THE JASPER SOFTWARE OR UNDERLYING
106 * TECHNOLOGY OR PRODUCTS FOR HIGH RISK ACTIVITIES AND WILL ENSURE THAT ITS
107 * CUSTOMERS AND END-USERS OF ITS PRODUCTS ARE PROVIDED WITH A COPY OF THE
108 * NOTICE SPECIFIED IN THIS SECTION.
109 *
110 * __END_OF_JASPER_LICENSE__
111 */
112
113/*
114 * Image Class
115 *
116 * $Id: jas_image.h 14449 2005-10-20 12:15:56Z stippi $
117 */
118
119#ifndef JAS_IMAGE_H
120#define JAS_IMAGE_H
121
122/******************************************************************************\
123* Includes.
124\******************************************************************************/
125
126#include <jasper/jas_stream.h>
127#include <jasper/jas_seq.h>
128
129#ifdef __cplusplus
130extern "C" {
131#endif
132
133/******************************************************************************\
134* Constants.
135\******************************************************************************/
136
137/*
138 * Miscellaneous constants.
139 */
140
141/* The threshold at which image data is no longer stored in memory. */
142#define JAS_IMAGE_INMEMTHRESH	(16 * 1024 * 1024)
143
144/*
145 * Color models.
146 */
147
148#define JAS_IMAGE_CS_UNKNOWN	0	/* Unknown */
149#define	JAS_IMAGE_CS_GRAY	1	/* Standard Gray */
150#define	JAS_IMAGE_CS_RGB	2	/* Standard RGB */
151#define	JAS_IMAGE_CS_YCBCR	3	/* Standard YCC */
152//#define	JAS_IMAGE_CM_ICC	4	/* ICC Profile */
153
154/*
155 * Component types
156 */
157
158#define	JAS_IMAGE_CT_UNKNOWN	0x10000
159#define	JAS_IMAGE_CT_COLOR(n)	((n) & 0x7fff)
160#define	JAS_IMAGE_CT_OPACITY	0x08000
161
162#define	JAS_IMAGE_CT_RGB_R	0
163#define	JAS_IMAGE_CT_RGB_G	1
164#define	JAS_IMAGE_CT_RGB_B	2
165
166#define	JAS_IMAGE_CT_YCBCR_Y	0
167#define	JAS_IMAGE_CT_YCBCR_CB	1
168#define	JAS_IMAGE_CT_YCBCR_CR	2
169
170#define	JAS_IMAGE_CT_GRAY_Y	0
171
172/******************************************************************************\
173* Image class and supporting classes.
174\******************************************************************************/
175
176/* Image component class. */
177
178typedef struct {
179
180	uint_fast32_t tlx_;
181	/* The x-coordinate of the top-left corner of the component. */
182
183	uint_fast32_t tly_;
184	/* The y-coordinate of the top-left corner of the component. */
185
186	uint_fast32_t hstep_;
187	/* The horizontal sampling period in units of the reference grid. */
188
189	uint_fast32_t vstep_;
190	/* The vertical sampling period in units of the reference grid. */
191
192	uint_fast32_t width_;
193	/* The component width in samples. */
194
195	uint_fast32_t height_;
196	/* The component height in samples. */
197
198	uint_fast16_t prec_;
199	/* The precision of the sample data (i.e., the number of bits per
200	sample).  If the samples are signed values, this quantity
201	includes the sign bit. */
202
203	uint_fast8_t sgnd_;
204	/* The signedness of the sample data. */
205
206	jas_stream_t *stream_;
207	/* The stream containing the component data. */
208
209	int cps_;
210	/* The number of characters per sample in the stream. */
211
212	uint_fast32_t type_;
213	/* The type of component (e.g., opacity, red, green, blue, luma). */
214
215} jas_image_cmpt_t;
216
217/* Image class. */
218
219typedef struct {
220
221	uint_fast32_t tlx_;
222	/* The x-coordinate of the top-left corner of the image bounding box. */
223
224	uint_fast32_t tly_;
225	/* The y-coordinate of the top-left corner of the image bounding box. */
226
227	uint_fast32_t brx_;
228	/* The x-coordinate of the bottom-right corner of the image bounding
229	  box (plus one). */
230
231	uint_fast32_t bry_;
232	/* The y-coordinate of the bottom-right corner of the image bounding
233	  box (plus one). */
234
235	uint_fast16_t numcmpts_;
236	/* The number of components. */
237
238	uint_fast16_t maxcmpts_;
239	/* The maximum number of components that this image can have (i.e., the
240	  allocated size of the components array). */
241
242	jas_image_cmpt_t **cmpts_;
243	/* Per-component information. */
244
245	int colorspace_;
246	/* The color space used (e.g., RGB, YCbCr, gray).  This field is only
247	of particular relevance in the case of a multi-component image. */
248
249	jpr_uchar_t *iccp_;
250	/* ICC profile information. */
251
252	int iccplen_;
253
254	JPR_BOOL inmem_;
255
256} jas_image_t;
257
258/* Component parameters class. */
259/* This data type exists solely/mainly for the purposes of the
260  jas_image_create function. */
261
262typedef struct {
263
264	uint_fast32_t tlx;
265	/* The x-coordinate of the top-left corner of the component. */
266
267	uint_fast32_t tly;
268	/* The y-coordinate of the top-left corner of the component. */
269
270	uint_fast32_t hstep;
271	/* The horizontal sampling period in units of the reference grid. */
272
273	uint_fast32_t vstep;
274	/* The vertical sampling period in units of the reference grid. */
275
276	uint_fast32_t width;
277	/* The width of the component in samples. */
278
279	uint_fast32_t height;
280	/* The height of the component in samples. */
281
282	uint_fast16_t prec;
283	/* The precision of the component sample data. */
284
285	JPR_BOOL sgnd;
286	/* The signedness of the component sample data. */
287
288} jas_image_cmptparm_t;
289
290/******************************************************************************\
291* File format related classes.
292\******************************************************************************/
293
294#define	JAS_IMAGE_MAXFMTS	32
295/* The maximum number of image data formats supported. */
296
297/* Image format-dependent operations. */
298
299typedef struct {
300
301	jas_image_t *(*decode)(jas_stream_t *in, char *opts);
302	/* Decode image data from a stream. */
303
304	int (*encode)(jas_image_t *image, jas_stream_t *out, char *opts);
305	/* Encode image data to a stream. */
306
307	int (*validate)(jas_stream_t *in);
308	/* Determine if stream data is in a particular format. */
309
310} jas_image_fmtops_t;
311
312/* Image format information. */
313
314typedef struct {
315
316	int id;
317	/* The ID for this format. */
318
319	char *name;
320	/* The name by which this format is identified. */
321
322	char *ext;
323	/* The file name extension associated with this format. */
324
325	char *desc;
326	/* A brief description of the format. */
327
328	jas_image_fmtops_t ops;
329	/* The operations for this format. */
330
331} jas_image_fmtinfo_t;
332
333/******************************************************************************\
334* Image operations.
335\******************************************************************************/
336
337/* Create an image. */
338jas_image_t *jas_image_create(uint_fast16_t numcmpts,
339  jas_image_cmptparm_t *cmptparms, int colorspace);
340
341/* Create an "empty" image. */
342jas_image_t *jas_image_create0();
343
344/* Clone an image. */
345jas_image_t *jas_image_copy(jas_image_t *image);
346
347/* Deallocate any resources associated with an image. */
348void jas_image_destroy(jas_image_t *image);
349
350/* Get the width of the image in units of the image reference grid. */
351#define jas_image_width(image) \
352	((image)->brx_ - (image)->tlx_)
353
354/* Get the height of the image in units of the image reference grid. */
355#define	jas_image_height(image) \
356	((image)->bry_ - (image)->tly_)
357
358/* Get the x-coordinate of the top-left corner of the image bounding box
359  on the reference grid. */
360#define jas_image_tlx(image) \
361	((image)->tlx_)
362
363/* Get the y-coordinate of the top-left corner of the image bounding box
364  on the reference grid. */
365#define jas_image_tly(image) \
366	((image)->tly_)
367
368/* Get the x-coordinate of the bottom-right corner of the image bounding box
369  on the reference grid (plus one). */
370#define jas_image_brx(image) \
371	((image)->brx_)
372
373/* Get the y-coordinate of the bottom-right corner of the image bounding box
374  on the reference grid (plus one). */
375#define jas_image_bry(image) \
376	((image)->bry_)
377
378/* Get the number of image components. */
379#define	jas_image_numcmpts(image) \
380	((image)->numcmpts_)
381
382/* Get the color model used by the image. */
383#define	jas_image_colorspace(image) \
384	((image)->colorspace_)
385
386/* Set the color model for an image. */
387#define jas_image_setcolorspace(image, colorspace) \
388	((image)->colorspace_ = (colorspace))
389
390#define jas_image_cmpttype(image, cmptno) \
391	((image)->cmpts_[(cmptno)]->type_)
392#define jas_image_setcmpttype(image, cmptno, type) \
393	((image)->cmpts_[(cmptno)]->type_ = (type))
394
395/* Get the width of a component. */
396#define	jas_image_cmptwidth(image, cmptno) \
397	((image)->cmpts_[cmptno]->width_)
398
399/* Get the height of a component. */
400#define	jas_image_cmptheight(image, cmptno) \
401	((image)->cmpts_[cmptno]->height_)
402
403/* Get the signedness of the sample data for a component. */
404#define	jas_image_cmptsgnd(image, cmptno) \
405	((image)->cmpts_[cmptno]->sgnd_)
406
407/* Get the precision of the sample data for a component. */
408#define	jas_image_cmptprec(image, cmptno) \
409	((image)->cmpts_[cmptno]->prec_)
410
411/* Get the horizontal subsampling factor for a component. */
412#define	jas_image_cmpthstep(image, cmptno) \
413	((image)->cmpts_[cmptno]->hstep_)
414
415/* Get the vertical subsampling factor for a component. */
416#define	jas_image_cmptvstep(image, cmptno) \
417	((image)->cmpts_[cmptno]->vstep_)
418
419/* Get the x-coordinate of the top-left corner of a component. */
420#define	jas_image_cmpttlx(image, cmptno) \
421	((image)->cmpts_[cmptno]->tlx_)
422
423/* Get the y-coordinate of the top-left corner of a component. */
424#define	jas_image_cmpttly(image, cmptno) \
425	((image)->cmpts_[cmptno]->tly_)
426
427/* Get the x-coordinate of the bottom-right corner of a component
428  (plus "one"). */
429#define	jas_image_cmptbrx(image, cmptno) \
430	((image)->cmpts_[cmptno]->tlx_ + (image)->cmpts_[cmptno]->width_ * \
431	  (image)->cmpts_[cmptno]->hstep_)
432
433/* Get the y-coordinate of the bottom-right corner of a component
434  (plus "one"). */
435#define	jas_image_cmptbry(image, cmptno) \
436	((image)->cmpts_[cmptno]->tly_ + (image)->cmpts_[cmptno]->height_ * \
437	  (image)->cmpts_[cmptno]->vstep_)
438
439/* Get the raw size of an image (i.e., the nominal size of the image without
440  any compression. */
441uint_fast32_t jas_image_rawsize(jas_image_t *image);
442
443/* Create an image from a stream in some specified format. */
444jas_image_t *jas_image_decode(jas_stream_t *in, int fmt, char *optstr);
445
446/* Write an image to a stream in a specified format. */
447int jas_image_encode(jas_image_t *image, jas_stream_t *out, int fmt,
448  char *optstr);
449
450/* Read a rectangular region of an image component. */
451/* The position and size of the rectangular region to be read is specified
452relative to the component's coordinate system. */
453int jas_image_readcmpt(jas_image_t *image, uint_fast16_t cmptno,
454  uint_fast32_t x, uint_fast32_t y, uint_fast32_t width, uint_fast32_t height,
455  jas_matrix_t *data);
456
457/* Write a rectangular region of an image component. */
458int jas_image_writecmpt(jas_image_t *image, uint_fast16_t cmptno,
459  uint_fast32_t x, uint_fast32_t y, uint_fast32_t width, uint_fast32_t height,
460  jas_matrix_t *data);
461
462/* Delete a component from an image. */
463void jas_image_delcmpt(jas_image_t *image, uint_fast16_t cmptno);
464
465/* Add a component to an image. */
466int jas_image_addcmpt(jas_image_t *image, uint_fast16_t cmptno,
467  jas_image_cmptparm_t *cmptparm);
468
469/* Copy a component from one image to another. */
470int jas_image_copycmpt(jas_image_t *dstimage, int dstcmptno,
471  jas_image_t *srcimage, int srccmptno);
472
473#if 0
474int_fast64_t jas_image_readcmpt1(jas_image_t *image, uint_fast16_t cmptno,
475  uint_fast32_t x, uint_fast32_t y);
476#endif
477
478#define	JAS_IMAGE_CDT_GETSGND(dtype) (((dtype) >> 7) & 1)
479#define	JAS_IMAGE_CDT_SETSGND(dtype) (((dtype) & 1) << 7)
480#define	JAS_IMAGE_CDT_GETPREC(dtype) ((dtype) & 0x7f)
481#define	JAS_IMAGE_CDT_SETPREC(dtype) ((dtype) & 0x7f)
482
483#define	jas_image_cmptdtype(image, cmptno) \
484	(JAS_IMAGE_CDT_SETSGND((image)->cmpts_[cmptno]->sgnd_) | JAS_IMAGE_CDT_SETPREC((image)->cmpts_[cmptno]->prec_))
485
486int jas_image_depalettize(jas_image_t *image, int cmptno, int numlutents,
487  int_fast32_t *lutents, int dtype, int newcmptno);
488
489int jas_image_readcmptsample(jas_image_t *image, int cmptno, int x, int y);
490void jas_image_writecmptsample(jas_image_t *image, int cmptno, int x, int y,
491  int_fast32_t v);
492
493int jas_image_getcmptbytype(jas_image_t *image, int ctype);
494
495/******************************************************************************\
496* Image format-related operations.
497\******************************************************************************/
498
499/* Clear the table of image formats. */
500void jas_image_clearfmts();
501
502/* Add entry to table of image formats. */
503int jas_image_addfmt(int id, char *name, char *ext, char *desc,
504  jas_image_fmtops_t *ops);
505
506/* Get the ID for the image format with the specified name. */
507int jas_image_strtofmt(char *s);
508
509/* Get the name of the image format with the specified ID. */
510char *jas_image_fmttostr(int fmt);
511
512/* Lookup image format information by the format ID. */
513jas_image_fmtinfo_t *jas_image_lookupfmtbyid(int id);
514
515/* Lookup image format information by the format name. */
516jas_image_fmtinfo_t *jas_image_lookupfmtbyname(const char *name);
517
518/* Guess the format of an image file based on its name. */
519int jas_image_fmtfromname(char *filename);
520
521/* Get the format of image data in a stream. */
522int jas_image_getfmt(jas_stream_t *in);
523
524/******************************************************************************\
525* Image format-dependent operations.
526\******************************************************************************/
527
528#if !defined(EXCLUDE_JPG_SUPPORT)
529/* Format-dependent operations for JPG support. */
530jas_image_t *jpg_decode(jas_stream_t *in, char *optstr);
531int jpg_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
532int jpg_validate(jas_stream_t *in);
533#endif
534
535#if !defined(EXCLUDE_MIF_SUPPORT)
536/* Format-dependent operations for MIF support. */
537jas_image_t *mif_decode(jas_stream_t *in, char *optstr);
538int mif_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
539int mif_validate(jas_stream_t *in);
540#endif
541
542#if !defined(EXCLUDE_PNM_SUPPORT)
543/* Format-dependent operations for PNM support. */
544jas_image_t *pnm_decode(jas_stream_t *in, char *optstr);
545int pnm_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
546int pnm_validate(jas_stream_t *in);
547#endif
548
549#if !defined(EXCLUDE_RAS_SUPPORT)
550/* Format-dependent operations for Sun Rasterfile support. */
551jas_image_t *ras_decode(jas_stream_t *in, char *optstr);
552int ras_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
553int ras_validate(jas_stream_t *in);
554#endif
555
556#if !defined(EXCLUDE_BMP_SUPPORT)
557/* Format-dependent operations for BMP support. */
558jas_image_t *bmp_decode(jas_stream_t *in, char *optstr);
559int bmp_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
560int bmp_validate(jas_stream_t *in);
561#endif
562
563#if !defined(EXCLUDE_JP2_SUPPORT)
564/* Format-dependent operations for JP2 support. */
565jas_image_t *jp2_decode(jas_stream_t *in, char *optstr);
566int jp2_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
567int jp2_validate(jas_stream_t *in);
568#endif
569
570#if !defined(EXCLUDE_JPC_SUPPORT)
571/* Format-dependent operations for JPEG-2000 code stream support. */
572jas_image_t *jpc_decode(jas_stream_t *in, char *optstr);
573int jpc_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
574int jpc_validate(jas_stream_t *in);
575#endif
576
577#if !defined(EXCLUDE_PGX_SUPPORT)
578/* Format-dependent operations for PGX support. */
579jas_image_t *pgx_decode(jas_stream_t *in, char *optstr);
580int pgx_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
581int pgx_validate(jas_stream_t *in);
582#endif
583
584#ifdef __cplusplus
585}
586#endif
587
588#endif
589