JasPer  3.0.3
jas_icc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002-2003 Michael David Adams.
3  * All rights reserved.
4  */
5 
6 /* __START_OF_JASPER_LICENSE__
7  *
8  * JasPer License Version 2.0
9  *
10  * Copyright (c) 2001-2006 Michael David Adams
11  * Copyright (c) 1999-2000 Image Power, Inc.
12  * Copyright (c) 1999-2000 The University of British Columbia
13  *
14  * All rights reserved.
15  *
16  * Permission is hereby granted, free of charge, to any person (the
17  * "User") obtaining a copy of this software and associated documentation
18  * files (the "Software"), to deal in the Software without restriction,
19  * including without limitation the rights to use, copy, modify, merge,
20  * publish, distribute, and/or sell copies of the Software, and to permit
21  * persons to whom the Software is furnished to do so, subject to the
22  * following conditions:
23  *
24  * 1. The above copyright notices and this permission notice (which
25  * includes the disclaimer below) shall be included in all copies or
26  * substantial portions of the Software.
27  *
28  * 2. The name of a copyright holder shall not be used to endorse or
29  * promote products derived from the Software without specific prior
30  * written permission.
31  *
32  * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
33  * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
34  * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
35  * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
36  * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
37  * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
38  * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
39  * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
40  * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
41  * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
42  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
43  * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
44  * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
45  * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
46  * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
47  * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
48  * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
49  * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
50  * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
51  * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
52  * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
53  * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
54  * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
55  * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
56  * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
57  * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
58  *
59  * __END_OF_JASPER_LICENSE__
60  */
61 
67 #ifndef JAS_ICC_H
68 #define JAS_ICC_H
69 
70 /* The configuration header file should be included first. */
71 #include <jasper/jas_config.h>
72 
73 #include <jasper/jas_types.h>
74 #include <jasper/jas_stream.h>
75 
76 #include <stdio.h>
77 
78 #ifdef __cplusplus
79 extern "C" {
80 #endif
81 
87 /* Profile file signature. */
88 #define JAS_ICC_MAGIC 0x61637370
89 
90 #define JAS_ICC_HDRLEN 128
91 
92 /* Profile/device class signatures. */
93 #define JAS_ICC_CLAS_IN 0x73636e72 /* input device */
94 #define JAS_ICC_CLAS_DPY 0x6d6e7472 /* display device */
95 #define JAS_ICC_CLAS_OUT 0x70727472 /* output device */
96 #define JAS_ICC_CLAS_LNK 0x6c696e6b /* device link */
97 #define JAS_ICC_CLAS_CNV 0x73706163 /* color space conversion */
98 #define JAS_ICC_CLAS_ABS 0x61627374 /* abstract */
99 #define JAS_ICC_CLAS_NAM 0x6e6d636c /* named color */
100 
101 /* Color space signatures. */
102 #define JAS_ICC_COLORSPC_XYZ 0x58595a20 /* XYZ */
103 #define JAS_ICC_COLORSPC_LAB 0x4c616220 /* LAB */
104 #define JAS_ICC_COLORSPC_LUV 0x4c757620 /* LUV */
105 #define JAS_ICC_COLORSPC_YCBCR 0x59436272 /* YCbCr */
106 #define JAS_ICC_COLORSPC_YXY 0x59787920 /* Yxy */
107 #define JAS_ICC_COLORSPC_RGB 0x52474220 /* RGB */
108 #define JAS_ICC_COLORSPC_GRAY 0x47524159 /* Gray */
109 #define JAS_ICC_COLORSPC_HSV 0x48535620 /* HSV */
110 #define JAS_ICC_COLORSPC_HLS 0x484c5320 /* HLS */
111 #define JAS_ICC_COLORSPC_CMYK 0x434d594b /* CMYK */
112 #define JAS_ICC_COLORSPC_CMY 0x434d5920 /* CMY */
113 #define JAS_ICC_COLORSPC_2 0x32434c52 /* 2 channel color */
114 #define JAS_ICC_COLORSPC_3 0x33434c52 /* 3 channel color */
115 #define JAS_ICC_COLORSPC_4 0x34434c52 /* 4 channel color */
116 #define JAS_ICC_COLORSPC_5 0x35434c52 /* 5 channel color */
117 #define JAS_ICC_COLORSPC_6 0x36434c52 /* 6 channel color */
118 #define JAS_ICC_COLORSPC_7 0x37434c52 /* 7 channel color */
119 #define JAS_ICC_COLORSPC_8 0x38434c52 /* 8 channel color */
120 #define JAS_ICC_COLORSPC_9 0x39434c52 /* 9 channel color */
121 #define JAS_ICC_COLORSPC_10 0x41434c52 /* 10 channel color */
122 #define JAS_ICC_COLORSPC_11 0x42434c52 /* 11 channel color */
123 #define JAS_ICC_COLORSPC_12 0x43434c52 /* 12 channel color */
124 #define JAS_ICC_COLORSPC_13 0x44434c52 /* 13 channel color */
125 #define JAS_ICC_COLORSPC_14 0x45434c52 /* 14 channel color */
126 #define JAS_ICC_COLORSPC_15 0x46434c52 /* 15 channel color */
127 
128 /* Profile connection color space (PCS) signatures. */
129 #define JAS_ICC_REFCOLORSPC_XYZ 0x58595a20 /* CIE XYZ */
130 #define JAS_ICC_REFCOLORSPC_LAB 0x4c616220 /* CIE Lab */
131 
132 /* Primary platform signatures. */
133 #define JAS_ICC_PLATFORM_APPL 0x4150504c /* Apple Computer */
134 #define JAS_ICC_PLATFORM_MSFT 0x4d534654 /* Microsoft */
135 #define JAS_ICC_PLATFORM_SGI 0x53474920 /* Silicon Graphics */
136 #define JAS_ICC_PLATFORM_SUNW 0x53554e57 /* Sun Microsystems */
137 #define JAS_ICC_PLATFORM_TGNT 0x54474e54 /* Taligent */
138 
139 /* Profile flags. */
140 #define JAS_ICC_FLAGS_EMBED 0x01 /* embedded */
141 #define JAS_ICC_FLAGS_NOSEP 0x02 /* no separate use */
142 
143 /* Attributes. */
144 #define JAS_ICC_ATTR_TRANS 0x01 /* transparent */
145 #define JAS_ICC_ATTR_MATTE 0x02 /* matte */
146 
147 /* Rendering intents. */
148 #define JAS_ICC_INTENT_PER 0 /* perceptual */
149 #define JAS_ICC_INTENT_REL 1 /* relative colorimetric */
150 #define JAS_ICC_INTENT_SAT 2 /* saturation */
151 #define JAS_ICC_INTENT_ABS 3 /* absolute colorimetric */
152 
153 /* Tag signatures. */
154 #define JAS_ICC_TAG_ATOB0 0x41324230 /* */
155 #define JAS_ICC_TAG_ATOB1 0x41324231 /* */
156 #define JAS_ICC_TAG_ATOB2 0x41324232 /* */
157 #define JAS_ICC_TAG_BLUMATCOL 0x6258595a /* */
158 #define JAS_ICC_TAG_BLUTRC 0x62545243 /* */
159 #define JAS_ICC_TAG_BTOA0 0x42324130 /* */
160 #define JAS_ICC_TAG_BTOA1 0x42324131 /* */
161 #define JAS_ICC_TAG_BTOA2 0x42324132 /* */
162 #define JAS_ICC_TAG_CALTIME 0x63616c74 /* */
163 #define JAS_ICC_TAG_CHARTARGET 0x74617267 /* */
164 #define JAS_ICC_TAG_CPYRT 0x63707274 /* */
165 #define JAS_ICC_TAG_CRDINFO 0x63726469 /* */
166 #define JAS_ICC_TAG_DEVMAKERDESC 0x646d6e64 /* */
167 #define JAS_ICC_TAG_DEVMODELDESC 0x646d6464 /* */
168 #define JAS_ICC_TAG_DEVSET 0x64657673 /* */
169 #define JAS_ICC_TAG_GAMUT 0x67616d74 /* */
170 #define JAS_ICC_TAG_GRYTRC 0x6b545243 /* */
171 #define JAS_ICC_TAG_GRNMATCOL 0x6758595a /* */
172 #define JAS_ICC_TAG_GRNTRC 0x67545243 /* */
173 #define JAS_ICC_TAG_LUM 0x6c756d69 /* */
174 #define JAS_ICC_TAG_MEASURE 0x6d656173 /* */
175 #define JAS_ICC_TAG_MEDIABLKPT 0x626b7074 /* */
176 #define JAS_ICC_TAG_MEDIAWHIPT 0x77747074 /* */
177 #define JAS_ICC_TAG_NAMCOLR 0x6e636f6c /* */
178 #define JAS_ICC_TAG_NAMCOLR2 0x6e636c32 /* */
179 #define JAS_ICC_TAG_OUTRESP 0x72657370 /* */
180 #define JAS_ICC_TAG_PREVIEW0 0x70726530 /* */
181 #define JAS_ICC_TAG_PREVIEW1 0x70726531 /* */
182 #define JAS_ICC_TAG_PREVIEW2 0x70726532 /* */
183 #define JAS_ICC_TAG_PROFDESC 0x64657363 /* */
184 #define JAS_ICC_TAG_PROFSEQDESC 0x70736571 /* */
185 #define JAS_ICC_TAG_PSDCRD0 0x70736430 /* */
186 #define JAS_ICC_TAG_PSCRDD1 0x70736431 /* */
187 #define JAS_ICC_TAG_PSCRDD2 0x70736432 /* */
188 #define JAS_ICC_TAG_PSCRDD3 0x70736433 /* */
189 #define JAS_ICC_TAG_PS2CSA 0x70733273 /* */
190 #define JAS_ICC_TAG_PS2RENINTENT 0x70733269 /* */
191 #define JAS_ICC_TAG_REDMATCOL 0x7258595a /* */
192 #define JAS_ICC_TAG_REDTRC 0x72545243 /* */
193 #define JAS_ICC_TAG_SCRNGDES 0x73637264 /* */
194 #define JAS_ICC_TAG_SCRNG 0x7363726e /* */
195 #define JAS_ICC_TAG_TECH 0x74656368 /* */
196 #define JAS_ICC_TAG_UCRBG 0x62666420 /* */
197 #define JAS_ICC_TAG_VIEWCONDDESC 0x76756564 /* */
198 #define JAS_ICC_TAG_VIEWCOND 0x76696577 /* */
199 
200 /* Type signatures. */
201 #define JAS_ICC_TYPE_CRDINFO 0x63726469 /* CRD information */
202 #define JAS_ICC_TYPE_CURV 0x63757276 /* curve */
203 #define JAS_ICC_TYPE_DATA 0x64617461 /* data */
204 #define JAS_ICC_TYPE_TIME 0x6474696d /* date/time */
205 #define JAS_ICC_TYPE_DEVSET 0x64657673 /* device settings */
206 #define JAS_ICC_TYPE_LUT16 0x6d667432 /* */
207 #define JAS_ICC_TYPE_LUT8 0x6d667431 /* */
208 #define JAS_ICC_TYPE_MEASURE 0x6d656173 /* */
209 #define JAS_ICC_TYPE_NAMCOLR 0x6e636f6c /* */
210 #define JAS_ICC_TYPE_NAMCOLR2 0x6e636c32 /* */
211 #define JAS_ICC_TYPE_PROFSEQDESC 0x70736571 /* profile sequence description */
212 #define JAS_ICC_TYPE_RESPCURVSET16 0x72637332 /* response curve set 16 */
213 #define JAS_ICC_TYPE_SF32 0x73663332 /* signed 32-bit fixed-point */
214 #define JAS_ICC_TYPE_SCRNG 0x7363726e /* screening */
215 #define JAS_ICC_TYPE_SIG 0x73696720 /* signature */
216 #define JAS_ICC_TYPE_TXTDESC 0x64657363 /* text description */
217 #define JAS_ICC_TYPE_TXT 0x74657874 /* text */
218 #define JAS_ICC_TYPE_UF32 0x75663332 /* unsigned 32-bit fixed-point */
219 #define JAS_ICC_TYPE_UCRBG 0x62666420 /* */
220 #define JAS_ICC_TYPE_UI16 0x75693136 /* */
221 #define JAS_ICC_TYPE_UI32 0x75693332 /* */
222 #define JAS_ICC_TYPE_UI8 0x75693038 /* */
223 #define JAS_ICC_TYPE_UI64 0x75693634 /* */
224 #define JAS_ICC_TYPE_VIEWCOND 0x76696577 /* */
225 #define JAS_ICC_TYPE_XYZ 0x58595a20 /* XYZ */
226 
227 typedef uint_fast8_t jas_iccuint8_t;
228 typedef uint_fast16_t jas_iccuint16_t;
229 typedef uint_fast32_t jas_iccuint32_t;
230 typedef int_fast32_t jas_iccsint32_t;
231 typedef int_fast32_t jas_iccs15fixed16_t;
232 typedef uint_fast32_t jas_iccu16fixed16_t;
233 typedef uint_fast64_t jas_iccuint64_t;
234 typedef uint_fast32_t jas_iccsig_t;
235 
236 typedef jas_iccsig_t jas_icctagsig_t;
237 typedef jas_iccsig_t jas_icctagtype_t;
238 typedef jas_iccsig_t jas_iccattrname_t;
239 
240 /* Date/time type. */
241 typedef struct {
242  jas_iccuint16_t year;
243  jas_iccuint16_t month;
244  jas_iccuint16_t day;
245  jas_iccuint16_t hour;
246  jas_iccuint16_t min;
247  jas_iccuint16_t sec;
248 } jas_icctime_t;
249 
250 /* XYZ type. */
251 typedef struct {
252  jas_iccs15fixed16_t x;
253  jas_iccs15fixed16_t y;
254  jas_iccs15fixed16_t z;
255 } jas_iccxyz_t;
256 
257 /* Curve type. */
258 typedef struct {
259  jas_iccuint32_t numents;
260  jas_iccuint16_t *ents;
261 } jas_icccurv_t;
262 
263 /* Text description type. */
264 typedef struct {
265  jas_iccuint32_t asclen;
266  char *ascdata; /* ASCII invariant description */
267  jas_iccuint32_t uclangcode; /* Unicode language code */
268  jas_iccuint32_t uclen; /* Unicode localizable description count */
269  jas_uchar *ucdata; /* Unicode localizable description */
270  jas_iccuint16_t sccode; /* ScriptCode code */
271  jas_iccuint8_t maclen; /* Localizable Macintosh description count */
272  jas_uchar macdata[69]; /* Localizable Macintosh description */
273 } jas_icctxtdesc_t;
274 
275 /* Text type. */
276 typedef struct {
277  char *string; /* ASCII character string */
278 } jas_icctxt_t;
279 
280 typedef struct {
281  jas_iccuint8_t numinchans;
282  jas_iccuint8_t numoutchans;
283  jas_iccsint32_t e[3][3];
284  jas_iccuint8_t clutlen;
285  jas_iccuint8_t *clut;
286  jas_iccuint16_t numintabents;
287  jas_iccuint8_t **intabs;
288  jas_iccuint8_t *intabsbuf;
289  jas_iccuint16_t numouttabents;
290  jas_iccuint8_t **outtabs;
291  jas_iccuint8_t *outtabsbuf;
292 } jas_icclut8_t;
293 
294 typedef struct {
295  jas_iccuint8_t numinchans;
296  jas_iccuint8_t numoutchans;
297  jas_iccsint32_t e[3][3];
298  jas_iccuint8_t clutlen;
299  jas_iccuint16_t *clut;
300  jas_iccuint16_t numintabents;
301  jas_iccuint16_t **intabs;
302  jas_iccuint16_t *intabsbuf;
303  jas_iccuint16_t numouttabents;
304  jas_iccuint16_t **outtabs;
305  jas_iccuint16_t *outtabsbuf;
306 } jas_icclut16_t;
307 
308 struct jas_iccattrval_s;
309 
310 typedef struct {
311  void (*destroy)(struct jas_iccattrval_s *);
312  int (*copy)(struct jas_iccattrval_s *, const struct jas_iccattrval_s *);
313  int (*input)(struct jas_iccattrval_s *, jas_stream_t *, unsigned);
314 //#ifdef JAS_ENABLE_ENCODER
315  int (*output)(struct jas_iccattrval_s *, jas_stream_t *);
316 //#endif
317  unsigned (*getsize)(const struct jas_iccattrval_s *);
318  void (*dump)(const struct jas_iccattrval_s *, FILE *);
319 } jas_iccattrvalops_t;
320 
321 /* Attribute value type (type and value information). */
322 typedef struct jas_iccattrval_s {
323  unsigned refcnt; /* reference count */
324  jas_iccsig_t type; /* type */
325  const jas_iccattrvalops_t *ops; /* type-dependent operations */
326  union {
327  jas_iccxyz_t xyz;
328  jas_icccurv_t curv;
329  jas_icctxtdesc_t txtdesc;
330  jas_icctxt_t txt;
331  jas_icclut8_t lut8;
332  jas_icclut16_t lut16;
333  } data; /* value */
334 } jas_iccattrval_t;
335 
336 /* Header type. */
337 typedef struct {
338  jas_iccuint32_t size; /* profile size */
339  jas_iccsig_t cmmtype; /* CMM type signature */
340  jas_iccuint32_t version; /* profile version */
341  jas_iccsig_t clas; /* profile/device class signature */
342  jas_iccsig_t colorspc; /* color space of data */
343  jas_iccsig_t refcolorspc; /* profile connection space */
344  jas_icctime_t ctime; /* creation time */
345  jas_iccsig_t magic; /* profile file signature */
346  jas_iccsig_t platform; /* primary platform */
347  jas_iccuint32_t flags; /* profile flags */
348  jas_iccsig_t maker; /* device manufacturer signature */
349  jas_iccsig_t model; /* device model signature */
350  jas_iccuint64_t attr; /* device setup attributes */
351  jas_iccsig_t intent; /* rendering intent */
352  jas_iccxyz_t illum; /* illuminant */
353  jas_iccsig_t creator; /* profile creator signature */
354 } jas_icchdr_t;
355 
356 typedef struct {
357  jas_iccsig_t name;
358  jas_iccattrval_t *val;
359 } jas_iccattr_t;
360 
361 typedef struct {
362  unsigned numattrs;
363  unsigned maxattrs;
364  jas_iccattr_t *attrs;
365 } jas_iccattrtab_t;
366 
367 typedef struct jas_icctagtabent_s {
368  jas_iccuint32_t tag;
369  jas_iccuint32_t off;
370  jas_iccuint32_t len;
371  void *data;
372  struct jas_icctagtabent_s *first;
373 } jas_icctagtabent_t;
374 
375 typedef struct {
376  jas_iccuint32_t numents;
377  jas_icctagtabent_t *ents;
378 } jas_icctagtab_t;
379 
380 /* ICC profile type. */
381 typedef struct {
382  jas_icchdr_t hdr;
383  jas_icctagtab_t tagtab;
384  jas_iccattrtab_t *attrtab;
385 } jas_iccprof_t;
386 
387 typedef struct {
388  jas_iccuint32_t type;
389  jas_iccattrvalops_t ops;
390 } jas_iccattrvalinfo_t;
391 
396 JAS_EXPORT
397 jas_iccprof_t *jas_iccprof_load(jas_stream_t *in);
398 
403 JAS_EXPORT
404 int jas_iccprof_save(jas_iccprof_t *prof, jas_stream_t *out);
405 
410 JAS_EXPORT
411 void jas_iccprof_destroy(jas_iccprof_t *prof);
412 
417 JAS_ATTRIBUTE_PURE
418 JAS_EXPORT
419 jas_iccattrval_t *jas_iccprof_getattr(const jas_iccprof_t *prof,
420  jas_iccattrname_t name);
421 
426 JAS_EXPORT
427 int jas_iccprof_setattr(jas_iccprof_t *prof, jas_iccattrname_t name,
428  jas_iccattrval_t *val);
429 
435 JAS_EXPORT
436 void jas_iccprof_dump(const jas_iccprof_t *prof, FILE *out);
437 
442 JAS_EXPORT
443 jas_iccprof_t *jas_iccprof_copy(const jas_iccprof_t *prof);
444 
449 JAS_EXPORT
450 int jas_iccprof_gethdr(const jas_iccprof_t *prof, jas_icchdr_t *hdr);
451 
456 JAS_EXPORT
457 int jas_iccprof_sethdr(jas_iccprof_t *prof, const jas_icchdr_t *hdr);
458 
463 JAS_EXPORT
464 void jas_iccattrval_destroy(jas_iccattrval_t *attrval);
465 
469 JAS_EXPORT
470 void jas_iccattrval_dump(const jas_iccattrval_t *attrval, FILE *out);
471 
477 JAS_EXPORT
478 int jas_iccattrval_allowmodify(jas_iccattrval_t **attrval);
479 
484 JAS_EXPORT
485 jas_iccattrval_t *jas_iccattrval_clone(jas_iccattrval_t *attrval);
486 
491 JAS_EXPORT
492 jas_iccattrval_t *jas_iccattrval_create(jas_iccuint32_t type);
493 
499 JAS_EXPORT
500 void jas_iccattrtab_dump(const jas_iccattrtab_t *attrtab, FILE *out);
501 
506 JAS_EXPORT
507 jas_iccprof_t *jas_iccprof_createfrombuf(const jas_uchar *buf, unsigned len);
508 
513 JAS_EXPORT
514 jas_iccprof_t *jas_iccprof_createfromclrspc(unsigned clrspc);
515 
516 JAS_EXPORT
517 extern const jas_uchar jas_iccprofdata_srgb[];
518 
519 JAS_EXPORT
520 extern const unsigned jas_iccprofdata_srgblen;
521 
522 JAS_EXPORT
523 extern const jas_uchar jas_iccprofdata_sgray[];
524 
525 JAS_EXPORT
526 extern const unsigned jas_iccprofdata_sgraylen;
527 
532 #ifdef __cplusplus
533 }
534 #endif
535 
536 #endif
jas_iccprof_copy
jas_iccprof_t * jas_iccprof_copy(const jas_iccprof_t *prof)
Create a copy of an ICC profile.
Definition: jas_icc.c:291
jas_logwarnf
JAS_EXPORT int jas_logwarnf(const char *fmt,...)
Generate a warning log message.
Definition: jas_debug.c:131
jas_iccattrval_clone
jas_iccattrval_t * jas_iccattrval_clone(jas_iccattrval_t *attrval)
Create a copy of an ICC profile attribute.
Definition: jas_icc.c:956
jas_malloc.h
JasPer Memory Allocator.
jas_alloc3
void * jas_alloc3(size_t num_arrays, size_t array_size, size_t element_size)
Allocate array of arrays (with overflow checking).
Definition: jas_malloc.c:221
jas_stream_putc
#define jas_stream_putc(stream, c)
jas_stream_putc Write a character to a stream.
Definition: jas_stream.h:575
jas_iccattrval_allowmodify
int jas_iccattrval_allowmodify(jas_iccattrval_t **attrvalx)
TODO/FIXME.
Definition: jas_icc.c:986
jas_logerrorf
JAS_EXPORT int jas_logerrorf(const char *fmt,...)
Generate an error log message.
Definition: jas_debug.c:119
jas_iccprof_destroy
void jas_iccprof_destroy(jas_iccprof_t *prof)
Destroy an ICC profile.
Definition: jas_icc.c:314
jas_iccprof_setattr
int jas_iccprof_setattr(jas_iccprof_t *prof, jas_iccattrname_t name, jas_iccattrval_t *val)
Set an attribute of an ICC profile.
Definition: jas_icc.c:639
jas_realloc2
void * jas_realloc2(void *ptr, size_t num_elements, size_t element_size)
Resize a block of allocated memory (with overflow checking).
Definition: jas_malloc.c:231
jas_eprintf
JAS_EXPORT int jas_eprintf(const char *fmt,...)
Print formatted text for the standard error stream (i.e., stderr).
Definition: jas_debug.c:96
jas_stream_t
I/O stream object.
Definition: jas_stream.h:206
jas_alloc2
void * jas_alloc2(size_t num_elements, size_t element_size)
Allocate array (with overflow checking).
Definition: jas_malloc.c:212
jas_iccprof_sethdr
int jas_iccprof_sethdr(jas_iccprof_t *prof, const jas_icchdr_t *hdr)
Set the header for an ICC profile.
Definition: jas_icc.c:671
jas_stream_gobble
ssize_t jas_stream_gobble(jas_stream_t *stream, size_t n)
Consume (i.e., discard) characters from stream.
Definition: jas_stream.c:816
jas_stream_memopen
jas_stream_t * jas_stream_memopen(char *buf, size_t bufsize)
Open a memory buffer as a stream.
Definition: jas_stream.c:203
jas_stream_pad
ssize_t jas_stream_pad(jas_stream_t *stream, size_t n, int c)
Write a fill character multiple times to a stream.
Definition: jas_stream.c:828
jas_iccattrval_create
jas_iccattrval_t * jas_iccattrval_create(jas_iccuint32_t type)
Create an ICC profile attribute.
Definition: jas_icc.c:936
jas_stream_read
size_t jas_stream_read(jas_stream_t *stream, void *buf, size_t cnt)
Read characters from a stream into a buffer.
Definition: jas_stream.c:650
jas_malloc
JAS_EXPORT void * jas_malloc(size_t size)
Allocate memory.
Definition: jas_malloc.c:136
jas_stream_write
size_t jas_stream_write(jas_stream_t *stream, const void *buf, size_t cnt)
Write characters from a buffer to a stream.
Definition: jas_stream.c:719
jas_iccattrtab_dump
void jas_iccattrtab_dump(const jas_iccattrtab_t *attrtab, FILE *out)
Dump an ICC profile attribute to a stream in human-readable format for debugging purposes.
Definition: jas_icc.c:808
jas_debug.h
JasPer Debugging-Related Functionality.
jas_stream_puts
int jas_stream_puts(jas_stream_t *stream, const char *s)
Write a string to a stream.
Definition: jas_stream.c:780
jas_iccprof_load
jas_iccprof_t * jas_iccprof_load(jas_stream_t *in)
Read an ICC profile from a stream.
Definition: jas_icc.c:330
jas_strdup
char * jas_strdup(const char *s)
Create a copy of a null-terminated string.
Definition: jas_string.c:89
jas_stream_close
int jas_stream_close(jas_stream_t *stream)
Close a stream.
Definition: jas_stream.c:591
jas_icc.h
ICC Profile.
jas_iccprof_createfrombuf
jas_iccprof_t * jas_iccprof_createfrombuf(const jas_uchar *buf, unsigned len)
Create an ICC profile from a buffer in memory.
Definition: jas_icc.c:1861
jas_iccprof_dump
void jas_iccprof_dump(const jas_iccprof_t *prof, FILE *out)
Dump an ICC profile to a stream in human-readable format for debugging purposes.
Definition: jas_icc.c:325
jas_free
JAS_EXPORT void jas_free(void *ptr)
Free memory.
Definition: jas_malloc.c:186
jas_types.h
Primitive Types.
jas_stream.h
I/O Stream Class.
JAS_UNUSED
#define JAS_UNUSED(x)
Indicate that a variable may be unused (in order to avoid a compiler warning).
Definition: jas_compiler.h:145
jas_string.h
String Library.
jas_stream_getc
#define jas_stream_getc(stream)
jas_stream_getc Read a character from a stream.
Definition: jas_stream.h:554
jas_cm.h
JasPer Color Management.
jas_iccprof_createfromclrspc
jas_iccprof_t * jas_iccprof_createfromclrspc(unsigned clrspc)
Create an ICC profile from a color space.
Definition: jas_icc.c:1882
jas_iccprof_gethdr
int jas_iccprof_gethdr(const jas_iccprof_t *prof, jas_icchdr_t *hdr)
Get the header for an ICC profile.
Definition: jas_icc.c:665
jas_iccprof_getattr
jas_iccattrval_t * jas_iccprof_getattr(const jas_iccprof_t *prof, jas_iccattrname_t name)
Get an attribute of an ICC profile.
Definition: jas_icc.c:623
jas_iccattrval_destroy
void jas_iccattrval_destroy(jas_iccattrval_t *attrval)
Destroy an ICC profile attribute.
Definition: jas_icc.c:962
jas_iccprof_save
int jas_iccprof_save(jas_iccprof_t *prof, jas_stream_t *out)
Write an ICC profile to a stream.
Definition: jas_icc.c:428