Subversion Repositories AndroidProjects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
244 chris 1
/*
2
 * Copyright (c) 2002-2003 Michael David Adams.
3
 * All rights reserved.
4
 */
5
 
6
/* __START_OF_JASPER_LICENSE__
7
 *
8
 * JasPer Software License
9
 *
10
 * IMAGE POWER JPEG-2000 PUBLIC LICENSE
11
 * ************************************
12
 *
13
 * GRANT:
14
 *
15
 * Permission is hereby granted, free of charge, to any person (the "User")
16
 * obtaining a copy of this software and associated documentation, to deal
17
 * in the JasPer Software without restriction, including without limitation
18
 * the right to use, copy, modify, merge, publish, distribute, sublicense,
19
 * and/or sell copies of the JasPer Software (in source and binary forms),
20
 * and to permit persons to whom the JasPer Software is furnished to do so,
21
 * provided further that the License Conditions below are met.
22
 *
23
 * License Conditions
24
 * ******************
25
 *
26
 * A.  Redistributions of source code must retain the above copyright notice,
27
 * and this list of conditions, and the following disclaimer.
28
 *
29
 * B.  Redistributions in binary form must reproduce the above copyright
30
 * notice, and this list of conditions, and the following disclaimer in
31
 * the documentation and/or other materials provided with the distribution.
32
 *
33
 * C.  Neither the name of Image Power, Inc. nor any other contributor
34
 * (including, but not limited to, the University of British Columbia and
35
 * Michael David Adams) may be used to endorse or promote products derived
36
 * from this software without specific prior written permission.
37
 *
38
 * D.  User agrees that it shall not commence any action against Image Power,
39
 * Inc., the University of British Columbia, Michael David Adams, or any
40
 * other contributors (collectively "Licensors") for infringement of any
41
 * intellectual property rights ("IPR") held by the User in respect of any
42
 * technology that User owns or has a right to license or sublicense and
43
 * which is an element required in order to claim compliance with ISO/IEC
44
 * 15444-1 (i.e., JPEG-2000 Part 1).  "IPR" means all intellectual property
45
 * rights worldwide arising under statutory or common law, and whether
46
 * or not perfected, including, without limitation, all (i) patents and
47
 * patent applications owned or licensable by User; (ii) rights associated
48
 * with works of authorship including copyrights, copyright applications,
49
 * copyright registrations, mask work rights, mask work applications,
50
 * mask work registrations; (iii) rights relating to the protection of
51
 * trade secrets and confidential information; (iv) any right analogous
52
 * to those set forth in subsections (i), (ii), or (iii) and any other
53
 * proprietary rights relating to intangible property (other than trademark,
54
 * trade dress, or service mark rights); and (v) divisions, continuations,
55
 * renewals, reissues and extensions of the foregoing (as and to the extent
56
 * applicable) now existing, hereafter filed, issued or acquired.
57
 *
58
 * E.  If User commences an infringement action against any Licensor(s) then
59
 * such Licensor(s) shall have the right to terminate User's license and
60
 * all sublicenses that have been granted hereunder by User to other parties.
61
 *
62
 * F.  This software is for use only in hardware or software products that
63
 * are compliant with ISO/IEC 15444-1 (i.e., JPEG-2000 Part 1).  No license
64
 * or right to this Software is granted for products that do not comply
65
 * with ISO/IEC 15444-1.  The JPEG-2000 Part 1 standard can be purchased
66
 * from the ISO.
67
 *
68
 * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE.
69
 * NO USE OF THE JASPER SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
70
 * THIS DISCLAIMER.  THE JASPER SOFTWARE IS PROVIDED BY THE LICENSORS AND
71
 * CONTRIBUTORS UNDER THIS LICENSE ON AN ``AS-IS'' BASIS, WITHOUT WARRANTY
72
 * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
73
 * WARRANTIES THAT THE JASPER SOFTWARE IS FREE OF DEFECTS, IS MERCHANTABLE,
74
 * IS FIT FOR A PARTICULAR PURPOSE OR IS NON-INFRINGING.  THOSE INTENDING
75
 * TO USE THE JASPER SOFTWARE OR MODIFICATIONS THEREOF FOR USE IN HARDWARE
76
 * OR SOFTWARE PRODUCTS ARE ADVISED THAT THEIR USE MAY INFRINGE EXISTING
77
 * PATENTS, COPYRIGHTS, TRADEMARKS, OR OTHER INTELLECTUAL PROPERTY RIGHTS.
78
 * THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE JASPER SOFTWARE
79
 * IS WITH THE USER.  SHOULD ANY PART OF THE JASPER SOFTWARE PROVE DEFECTIVE
80
 * IN ANY RESPECT, THE USER (AND NOT THE INITIAL DEVELOPERS, THE UNIVERSITY
81
 * OF BRITISH COLUMBIA, IMAGE POWER, INC., MICHAEL DAVID ADAMS, OR ANY
82
 * OTHER CONTRIBUTOR) SHALL ASSUME THE COST OF ANY NECESSARY SERVICING,
83
 * REPAIR OR CORRECTION.  UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY,
84
 * WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE
85
 * INITIAL DEVELOPER, THE UNIVERSITY OF BRITISH COLUMBIA, IMAGE POWER, INC.,
86
 * MICHAEL DAVID ADAMS, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE
87
 * JASPER SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO
88
 * THE USER OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
89
 * CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
90
 * DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
91
 * MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF
92
 * SUCH PARTY HAD BEEN INFORMED, OR OUGHT TO HAVE KNOWN, OF THE POSSIBILITY
93
 * OF SUCH DAMAGES.  THE JASPER SOFTWARE AND UNDERLYING TECHNOLOGY ARE NOT
94
 * FAULT-TOLERANT AND ARE NOT DESIGNED, MANUFACTURED OR INTENDED FOR USE OR
95
 * RESALE AS ON-LINE CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING
96
 * FAIL-SAFE PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES,
97
 * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT
98
 * LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
99
 * JASPER SOFTWARE OR UNDERLYING TECHNOLOGY OR PRODUCT COULD LEAD DIRECTLY
100
 * TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE
101
 * ("HIGH RISK ACTIVITIES").  LICENSOR SPECIFICALLY DISCLAIMS ANY EXPRESS
102
 * OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.  USER WILL NOT
103
 * KNOWINGLY USE, DISTRIBUTE OR RESELL THE JASPER SOFTWARE OR UNDERLYING
104
 * TECHNOLOGY OR PRODUCTS FOR HIGH RISK ACTIVITIES AND WILL ENSURE THAT ITS
105
 * CUSTOMERS AND END-USERS OF ITS PRODUCTS ARE PROVIDED WITH A COPY OF THE
106
 * NOTICE SPECIFIED IN THIS SECTION.
107
 *
108
 * __END_OF_JASPER_LICENSE__
109
 */
110
 
111
#ifndef JAS_ICC_H
112
#define JAS_ICC_H
113
 
114
#include "jas_config.h"
115
#include "jas_types.h"
116
#include "jas_stream.h"
117
 
118
#ifdef __cplusplus
119
extern "C" {
120
#endif
121
 
122
/* Profile file signature. */
123
#define JAS_ICC_MAGIC           0x61637370
124
 
125
#define JAS_ICC_HDRLEN  128
126
 
127
/* Profile/device class signatures. */
128
#define JAS_ICC_CLAS_IN 0x73636e72 /* input device */
129
#define JAS_ICC_CLAS_DPY        0x6d6e7472 /* display device */
130
#define JAS_ICC_CLAS_OUT        0x70727472 /* output device */
131
#define JAS_ICC_CLAS_LNK        0x6c696e6b /* device link */
132
#define JAS_ICC_CLAS_CNV        0x73706163 /* color space conversion */
133
#define JAS_ICC_CLAS_ABS        0x61627374 /* abstract */
134
#define JAS_ICC_CLAS_NAM        0x6e6d636c /* named color */
135
 
136
/* Color space signatures. */
137
#define JAS_ICC_COLORSPC_XYZ    0x58595a20 /* XYZ */
138
#define JAS_ICC_COLORSPC_LAB    0x4c616220 /* LAB */
139
#define JAS_ICC_COLORSPC_LUV    0x4c757620 /* LUV */
140
#define JAS_ICC_COLORSPC_YCBCR  0x59436272 /* YCbCr */
141
#define JAS_ICC_COLORSPC_YXY    0x59787920 /* Yxy */
142
#define JAS_ICC_COLORSPC_RGB    0x52474220 /* RGB */
143
#define JAS_ICC_COLORSPC_GRAY   0x47524159 /* Gray */
144
#define JAS_ICC_COLORSPC_HSV    0x48535620 /* HSV */
145
#define JAS_ICC_COLORSPC_HLS    0x484c5320 /* HLS */
146
#define JAS_ICC_COLORSPC_CMYK   0x434d594b /* CMYK */
147
#define JAS_ICC_COLORSPC_CMY    0x434d5920 /* CMY */
148
#define JAS_ICC_COLORSPC_2      0x32434c52 /* 2 channel color */
149
#define JAS_ICC_COLORSPC_3      0x33434c52 /* 3 channel color */
150
#define JAS_ICC_COLORSPC_4      0x34434c52 /* 4 channel color */
151
#define JAS_ICC_COLORSPC_5      0x35434c52 /* 5 channel color */
152
#define JAS_ICC_COLORSPC_6      0x36434c52 /* 6 channel color */
153
#define JAS_ICC_COLORSPC_7      0x37434c52 /* 7 channel color */
154
#define JAS_ICC_COLORSPC_8      0x38434c52 /* 8 channel color */
155
#define JAS_ICC_COLORSPC_9      0x39434c52 /* 9 channel color */
156
#define JAS_ICC_COLORSPC_10     0x41434c52 /* 10 channel color */
157
#define JAS_ICC_COLORSPC_11     0x42434c52 /* 11 channel color */
158
#define JAS_ICC_COLORSPC_12     0x43434c52 /* 12 channel color */
159
#define JAS_ICC_COLORSPC_13     0x44434c52 /* 13 channel color */
160
#define JAS_ICC_COLORSPC_14     0x45434c52 /* 14 channel color */
161
#define JAS_ICC_COLORSPC_15     0x46434c52 /* 15 channel color */
162
 
163
/* Profile connection color space (PCS) signatures. */
164
#define JAS_ICC_REFCOLORSPC_XYZ         0x58595a20 /* CIE XYZ */
165
#define JAS_ICC_REFCOLORSPC_LAB         0x4c616220 /* CIE Lab */
166
 
167
/* Primary platform signatures. */
168
#define JAS_ICC_PLATFORM_APPL   0x4150504c /* Apple Computer */
169
#define JAS_ICC_PLATFORM_MSFT   0x4d534654 /* Microsoft */
170
#define JAS_ICC_PLATFORM_SGI    0x53474920 /* Silicon Graphics */
171
#define JAS_ICC_PLATFORM_SUNW   0x53554e57 /* Sun Microsystems */
172
#define JAS_ICC_PLATFORM_TGNT   0x54474e54 /* Taligent */
173
 
174
/* Profile flags. */
175
#define JAS_ICC_FLAGS_EMBED     0x01 /* embedded */
176
#define JAS_ICC_FLAGS_NOSEP     0x02 /* no separate use */
177
 
178
/* Attributes. */
179
#define JAS_ICC_ATTR_TRANS      0x01 /* transparent */
180
#define JAS_ICC_ATTR_MATTE      0x02 /* matte */
181
 
182
/* Rendering intents. */
183
#define JAS_ICC_INTENT_PER      0 /* perceptual */
184
#define JAS_ICC_INTENT_REL      1 /* relative colorimetric */
185
#define JAS_ICC_INTENT_SAT      2 /* saturation */
186
#define JAS_ICC_INTENT_ABS      3 /* absolute colorimetric */
187
 
188
/* Tag signatures. */
189
#define JAS_ICC_TAG_ATOB0               0x41324230 /* */
190
#define JAS_ICC_TAG_ATOB1               0x41324231 /* */
191
#define JAS_ICC_TAG_ATOB2               0x41324232 /* */
192
#define JAS_ICC_TAG_BLUMATCOL           0x6258595a /* */
193
#define JAS_ICC_TAG_BLUTRC              0x62545243 /* */
194
#define JAS_ICC_TAG_BTOA0               0x42324130 /* */
195
#define JAS_ICC_TAG_BTOA1               0x42324131 /* */
196
#define JAS_ICC_TAG_BTOA2               0x42324132 /* */
197
#define JAS_ICC_TAG_CALTIME             0x63616c74 /* */
198
#define JAS_ICC_TAG_CHARTARGET          0x74617267 /* */
199
#define JAS_ICC_TAG_CPYRT               0x63707274 /* */
200
#define JAS_ICC_TAG_CRDINFO             0x63726469 /* */
201
#define JAS_ICC_TAG_DEVMAKERDESC        0x646d6e64 /* */
202
#define JAS_ICC_TAG_DEVMODELDESC        0x646d6464 /* */
203
#define JAS_ICC_TAG_DEVSET              0x64657673 /* */
204
#define JAS_ICC_TAG_GAMUT               0x67616d74 /* */
205
#define JAS_ICC_TAG_GRYTRC              0x6b545243 /* */
206
#define JAS_ICC_TAG_GRNMATCOL           0x6758595a /* */
207
#define JAS_ICC_TAG_GRNTRC              0x67545243 /* */
208
#define JAS_ICC_TAG_LUM                 0x6c756d69 /* */
209
#define JAS_ICC_TAG_MEASURE             0x6d656173 /* */
210
#define JAS_ICC_TAG_MEDIABLKPT          0x626b7074 /* */
211
#define JAS_ICC_TAG_MEDIAWHIPT          0x77747074 /* */
212
#define JAS_ICC_TAG_NAMCOLR             0x6e636f6c /* */
213
#define JAS_ICC_TAG_NAMCOLR2            0x6e636c32 /* */
214
#define JAS_ICC_TAG_OUTRESP             0x72657370 /* */
215
#define JAS_ICC_TAG_PREVIEW0            0x70726530 /* */
216
#define JAS_ICC_TAG_PREVIEW1            0x70726531 /* */
217
#define JAS_ICC_TAG_PREVIEW2            0x70726532 /* */
218
#define JAS_ICC_TAG_PROFDESC            0x64657363 /* */
219
#define JAS_ICC_TAG_PROFSEQDESC         0x70736571 /* */
220
#define JAS_ICC_TAG_PSDCRD0             0x70736430 /* */
221
#define JAS_ICC_TAG_PSCRDD1             0x70736431 /* */
222
#define JAS_ICC_TAG_PSCRDD2             0x70736432 /* */
223
#define JAS_ICC_TAG_PSCRDD3             0x70736433 /* */
224
#define JAS_ICC_TAG_PS2CSA              0x70733273 /* */
225
#define JAS_ICC_TAG_PS2RENINTENT        0x70733269 /* */
226
#define JAS_ICC_TAG_REDMATCOL           0x7258595a /* */
227
#define JAS_ICC_TAG_REDTRC              0x72545243 /* */
228
#define JAS_ICC_TAG_SCRNGDES            0x73637264 /* */
229
#define JAS_ICC_TAG_SCRNG               0x7363726e /* */
230
#define JAS_ICC_TAG_TECH                0x74656368 /* */
231
#define JAS_ICC_TAG_UCRBG               0x62666420 /* */
232
#define JAS_ICC_TAG_VIEWCONDDESC        0x76756564 /* */
233
#define JAS_ICC_TAG_VIEWCOND            0x76696577 /* */
234
 
235
/* Type signatures. */
236
#define JAS_ICC_TYPE_CRDINFO            0x63726469 /* CRD information */
237
#define JAS_ICC_TYPE_CURV               0x63757276 /* curve */
238
#define JAS_ICC_TYPE_DATA               0x64617461 /* data */
239
#define JAS_ICC_TYPE_TIME               0x6474696d /* date/time */
240
#define JAS_ICC_TYPE_DEVSET             0x64657673 /* device settings */
241
#define JAS_ICC_TYPE_LUT16              0x6d667432 /* */
242
#define JAS_ICC_TYPE_LUT8               0x6d667431 /* */
243
#define JAS_ICC_TYPE_MEASURE            0x6d656173 /* */
244
#define JAS_ICC_TYPE_NAMCOLR            0x6e636f6c /* */
245
#define JAS_ICC_TYPE_NAMCOLR2           0x6e636c32 /* */
246
#define JAS_ICC_TYPE_PROFSEQDESC        0x70736571 /* profile sequence description */
247
#define JAS_ICC_TYPE_RESPCURVSET16      0x72637332 /* response curve set 16 */
248
#define JAS_ICC_TYPE_SF32               0x73663332 /* signed 32-bit fixed-point */
249
#define JAS_ICC_TYPE_SCRNG              0x7363726e /* screening */
250
#define JAS_ICC_TYPE_SIG                0x73696720 /* signature */
251
#define JAS_ICC_TYPE_TXTDESC            0x64657363 /* text description */
252
#define JAS_ICC_TYPE_TXT                0x74657874 /* text */
253
#define JAS_ICC_TYPE_UF32               0x75663332 /* unsigned 32-bit fixed-point */
254
#define JAS_ICC_TYPE_UCRBG              0x62666420 /* */
255
#define JAS_ICC_TYPE_UI16               0x75693136 /* */
256
#define JAS_ICC_TYPE_UI32               0x75693332 /* */
257
#define JAS_ICC_TYPE_UI8                0x75693038 /* */
258
#define JAS_ICC_TYPE_UI64               0x75693634 /* */
259
#define JAS_ICC_TYPE_VIEWCOND           0x76696577 /* */
260
#define JAS_ICC_TYPE_XYZ                0x58595a20 /* XYZ */
261
 
262
typedef uint_fast8_t jas_iccuint8_t;
263
typedef uint_fast16_t jas_iccuint16_t;
264
typedef uint_fast32_t jas_iccuint32_t;
265
typedef int_fast32_t jas_iccsint32_t;
266
typedef int_fast32_t jas_iccs15fixed16_t;
267
typedef uint_fast32_t jas_iccu16fixed16_t;
268
typedef uint_fast64_t jas_iccuint64_t;
269
typedef uint_fast32_t jas_iccsig_t;
270
 
271
typedef jas_iccsig_t jas_icctagsig_t;
272
typedef jas_iccsig_t jas_icctagtype_t;
273
typedef jas_iccsig_t jas_iccattrname_t;
274
 
275
/* Date/time type. */
276
typedef struct {
277
        jas_iccuint16_t year;
278
        jas_iccuint16_t month;
279
        jas_iccuint16_t day;
280
        jas_iccuint16_t hour;
281
        jas_iccuint16_t min;
282
        jas_iccuint16_t sec;
283
} jas_icctime_t;
284
 
285
/* XYZ type. */
286
typedef struct {
287
        jas_iccs15fixed16_t x;
288
        jas_iccs15fixed16_t y;
289
        jas_iccs15fixed16_t z;
290
} jas_iccxyz_t;
291
 
292
/* Curve type. */
293
typedef struct {
294
        jas_iccuint32_t numents;
295
        jas_iccuint16_t *ents;
296
} jas_icccurv_t;
297
 
298
/* Text description type. */
299
typedef struct {
300
        jas_iccuint32_t asclen;
301
        char *ascdata; /* ASCII invariant description */
302
        jas_iccuint32_t uclangcode; /* Unicode language code */
303
        jas_iccuint32_t uclen; /* Unicode localizable description count */
304
        uchar *ucdata; /* Unicode localizable description */
305
        jas_iccuint16_t sccode; /* ScriptCode code */
306
        jas_iccuint8_t maclen; /* Localizable Macintosh description count */
307
        uchar macdata[69]; /* Localizable Macintosh description */
308
} jas_icctxtdesc_t;
309
 
310
/* Text type. */
311
typedef struct {
312
        char *string;   /* ASCII character string */
313
} jas_icctxt_t;
314
 
315
typedef struct {
316
        jas_iccuint8_t numinchans;
317
        jas_iccuint8_t numoutchans;
318
        jas_iccsint32_t e[3][3];
319
        jas_iccuint8_t clutlen;
320
        jas_iccuint8_t *clut;
321
        jas_iccuint16_t numintabents;
322
        jas_iccuint8_t **intabs;
323
        jas_iccuint8_t *intabsbuf;
324
        jas_iccuint16_t numouttabents;
325
        jas_iccuint8_t **outtabs;
326
        jas_iccuint8_t *outtabsbuf;
327
} jas_icclut8_t;
328
 
329
typedef struct {
330
        jas_iccuint8_t numinchans;
331
        jas_iccuint8_t numoutchans;
332
        jas_iccsint32_t e[3][3];
333
        jas_iccuint8_t clutlen;
334
        jas_iccuint16_t *clut;
335
        jas_iccuint16_t numintabents;
336
        jas_iccuint16_t **intabs;
337
        jas_iccuint16_t *intabsbuf;
338
        jas_iccuint16_t numouttabents;
339
        jas_iccuint16_t **outtabs;
340
        jas_iccuint16_t *outtabsbuf;
341
} jas_icclut16_t;
342
 
343
struct jas_iccattrval_s;
344
 
345
typedef struct {
346
        void (*destroy)(struct jas_iccattrval_s *);
347
        int (*copy)(struct jas_iccattrval_s *, struct jas_iccattrval_s *);
348
        int (*input)(struct jas_iccattrval_s *, jas_stream_t *, int);
349
        int (*output)(struct jas_iccattrval_s *, jas_stream_t *);
350
        int (*getsize)(struct jas_iccattrval_s *);
351
        void (*dump)(struct jas_iccattrval_s *, FILE *);
352
} jas_iccattrvalops_t;
353
 
354
/* Attribute value type (type and value information). */
355
typedef struct jas_iccattrval_s {
356
        int refcnt; /* reference count */
357
        jas_iccsig_t type; /* type */
358
        jas_iccattrvalops_t *ops; /* type-dependent operations */
359
        union {
360
                jas_iccxyz_t xyz;
361
                jas_icccurv_t curv;
362
                jas_icctxtdesc_t txtdesc;
363
                jas_icctxt_t txt;
364
                jas_icclut8_t lut8;
365
                jas_icclut16_t lut16;
366
        } data; /* value */
367
} jas_iccattrval_t;
368
 
369
/* Header type. */
370
typedef struct {
371
        jas_iccuint32_t size; /* profile size */
372
        jas_iccsig_t cmmtype; /* CMM type signature */
373
        jas_iccuint32_t version; /* profile version */
374
        jas_iccsig_t clas; /* profile/device class signature */
375
        jas_iccsig_t colorspc; /* color space of data */
376
        jas_iccsig_t refcolorspc; /* profile connection space */
377
        jas_icctime_t ctime; /* creation time */
378
        jas_iccsig_t magic; /* profile file signature */
379
        jas_iccsig_t platform; /* primary platform */
380
        jas_iccuint32_t flags; /* profile flags */
381
        jas_iccsig_t maker; /* device manufacturer signature */
382
        jas_iccsig_t model; /* device model signature */
383
        jas_iccuint64_t attr; /* device setup attributes */
384
        jas_iccsig_t intent; /* rendering intent */
385
        jas_iccxyz_t illum; /* illuminant */
386
        jas_iccsig_t creator; /* profile creator signature */
387
} jas_icchdr_t;
388
 
389
typedef struct {
390
        jas_iccsig_t name;
391
        jas_iccattrval_t *val;
392
} jas_iccattr_t;
393
 
394
typedef struct {
395
        int numattrs;
396
        int maxattrs;
397
        jas_iccattr_t *attrs;
398
} jas_iccattrtab_t;
399
 
400
typedef struct jas_icctagtabent_s {
401
        jas_iccuint32_t tag;
402
        jas_iccuint32_t off;
403
        jas_iccuint32_t len;
404
        void *data;
405
        struct jas_icctagtabent_s *first;
406
} jas_icctagtabent_t;
407
 
408
typedef struct {
409
        jas_iccuint32_t numents;
410
        jas_icctagtabent_t *ents;
411
} jas_icctagtab_t;
412
 
413
/* ICC profile type. */
414
typedef struct {
415
        jas_icchdr_t hdr;
416
        jas_icctagtab_t tagtab;
417
        jas_iccattrtab_t *attrtab;
418
} jas_iccprof_t;
419
 
420
typedef struct {
421
        jas_iccuint32_t type;
422
        jas_iccattrvalops_t ops;
423
} jas_iccattrvalinfo_t;
424
 
425
jas_iccprof_t *jas_iccprof_load(jas_stream_t *in);
426
int jas_iccprof_save(jas_iccprof_t *prof, jas_stream_t *out);
427
void jas_iccprof_destroy(jas_iccprof_t *prof);
428
jas_iccattrval_t *jas_iccprof_getattr(jas_iccprof_t *prof,
429
  jas_iccattrname_t name);
430
int jas_iccprof_setattr(jas_iccprof_t *prof, jas_iccattrname_t name,
431
  jas_iccattrval_t *val);
432
void jas_iccprof_dump(jas_iccprof_t *prof, FILE *out);
433
jas_iccprof_t *jas_iccprof_copy(jas_iccprof_t *prof);
434
int jas_iccprof_gethdr(jas_iccprof_t *prof, jas_icchdr_t *hdr);
435
int jas_iccprof_sethdr(jas_iccprof_t *prof, jas_icchdr_t *hdr);
436
 
437
void jas_iccattrval_destroy(jas_iccattrval_t *attrval);
438
void jas_iccattrval_dump(jas_iccattrval_t *attrval, FILE *out);
439
int jas_iccattrval_allowmodify(jas_iccattrval_t **attrval);
440
jas_iccattrval_t *jas_iccattrval_clone(jas_iccattrval_t *attrval);
441
jas_iccattrval_t *jas_iccattrval_create(jas_iccuint32_t type);
442
 
443
void jas_iccattrtab_dump(jas_iccattrtab_t *attrtab, FILE *out);
444
 
445
extern uchar jas_iccprofdata_srgb[];
446
extern int jas_iccprofdata_srgblen;
447
extern uchar jas_iccprofdata_sgray[];
448
extern int jas_iccprofdata_sgraylen;
449
jas_iccprof_t *jas_iccprof_createfrombuf(uchar *buf, int len);
450
jas_iccprof_t *jas_iccprof_createfromclrspc(int clrspc);
451
 
452
#ifdef __cplusplus
453
}
454
#endif
455
 
456
#endif