JasPer  3.0.6
jas_cm.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_CM_H
68 #define JAS_CM_H
69 
70 /******************************************************************************\
71 *
72 \******************************************************************************/
73 
74 /* The configuration header file should be included first. */
75 #include <jasper/jas_config.h>
76 
77 #include <jasper/jas_types.h>
78 #include <jasper/jas_icc.h>
79 
80 #ifdef __cplusplus
81 extern "C" {
82 #endif
83 
89 /******************************************************************************\
90 * Types and Macros.
91 \******************************************************************************/
92 
97 typedef unsigned jas_clrspc_t;
98 
103 typedef enum {
104  JAS_CMXFORM_OP_FWD = 0,
105  JAS_CMXFORM_OP_REV = 1,
106  JAS_CMXFORM_OP_PROOF = 2,
107  JAS_CMXFORM_OP_GAMUT = 3,
109 
114 typedef enum {
115  JAS_CMXFORM_INTENT_PER = 0,
116  JAS_CMXFORM_INTENT_RELCLR = 1,
117  JAS_CMXFORM_INTENT_ABSCLR = 2,
118  JAS_CMXFORM_INTENT_SAT = 3,
120 
125 #define JAS_CMXFORM_NUMINTENTS 4
126 
131 typedef enum {
132  JAS_CMXFORM_OPTM_SPEED = 0,
133  JAS_CMXFORM_OPTM_SIZE = 1,
134  JAS_CMXFORM_OPTM_ACC = 2,
136 
141 #define jas_clrspc_create(fam, mbr) (((fam) << 8) | (mbr))
142 
148 #define jas_clrspc_fam(clrspc) ((clrspc) >> 8)
149 
154 #define jas_clrspc_mbr(clrspc) ((clrspc) & 0xff)
155 
160 #define jas_clrspc_isgeneric(clrspc) (!jas_clrspc_mbr(clrspc))
161 
166 #define jas_clrspc_isunknown(clrspc) ((clrspc) & JAS_CLRSPC_UNKNOWNMASK)
167 
168 #define JAS_CLRSPC_UNKNOWNMASK 0x4000
169 
173 #define JAS_CLRSPC_FAM_UNKNOWN 0
174 #define JAS_CLRSPC_FAM_XYZ 1
175 #define JAS_CLRSPC_FAM_LAB 2
176 #define JAS_CLRSPC_FAM_GRAY 3
177 #define JAS_CLRSPC_FAM_RGB 4
178 #define JAS_CLRSPC_FAM_YCBCR 5
179 
183 #define JAS_CLRSPC_UNKNOWN JAS_CLRSPC_UNKNOWNMASK
184 #define JAS_CLRSPC_CIEXYZ jas_clrspc_create(JAS_CLRSPC_FAM_XYZ, 1)
185 #define JAS_CLRSPC_CIELAB jas_clrspc_create(JAS_CLRSPC_FAM_LAB, 1)
186 #define JAS_CLRSPC_SGRAY jas_clrspc_create(JAS_CLRSPC_FAM_GRAY, 1)
187 #define JAS_CLRSPC_SRGB jas_clrspc_create(JAS_CLRSPC_FAM_RGB, 1)
188 #define JAS_CLRSPC_SYCBCR jas_clrspc_create(JAS_CLRSPC_FAM_YCBCR, 1)
189 
193 #define JAS_CLRSPC_GENRGB jas_clrspc_create(JAS_CLRSPC_FAM_RGB, 0)
194 #define JAS_CLRSPC_GENGRAY jas_clrspc_create(JAS_CLRSPC_FAM_GRAY, 0)
195 #define JAS_CLRSPC_GENYCBCR jas_clrspc_create(JAS_CLRSPC_FAM_YCBCR, 0)
196 
197 #define JAS_CLRSPC_CHANIND_YCBCR_Y 0
198 #define JAS_CLRSPC_CHANIND_YCBCR_CB 1
199 #define JAS_CLRSPC_CHANIND_YCBCR_CR 2
200 
201 #define JAS_CLRSPC_CHANIND_RGB_R 0
202 #define JAS_CLRSPC_CHANIND_RGB_G 1
203 #define JAS_CLRSPC_CHANIND_RGB_B 2
204 
205 #define JAS_CLRSPC_CHANIND_GRAY_Y 0
206 
210 typedef double jas_cmreal_t;
211 
212 struct jas_cmpxform_s;
213 
218 typedef struct {
219  long *buf;
220  unsigned prec;
221  int sgnd;
222  unsigned width;
223  unsigned height;
225 
230 typedef struct {
231  unsigned numcmpts;
232  jas_cmcmptfmt_t *cmptfmts;
234 
239 typedef struct {
240  void (*destroy)(struct jas_cmpxform_s *pxform);
241  int (*apply)(const struct jas_cmpxform_s *pxform, const jas_cmreal_t *in, jas_cmreal_t *out, unsigned cnt);
242  void (*dump)(struct jas_cmpxform_s *pxform);
244 
249 typedef struct {
250  jas_cmreal_t *data;
251  unsigned size;
253 
258 typedef struct {
259  int mono;
260  int order;
261  int useluts;
262  int usemat;
263  jas_cmshapmatlut_t luts[3];
264  jas_cmreal_t mat[3][4];
266 
271 typedef struct {
272  int order;
274 
279 typedef struct {
280  unsigned inclrspc;
281  unsigned outclrspc;
283 
288 typedef struct jas_cmpxform_s {
289  unsigned refcnt;
290  const jas_cmpxformops_t *ops;
291  unsigned numinchans;
292  unsigned numoutchans;
293  union {
294  max_align_t dummy;
295  jas_cmshapmat_t shapmat;
296  jas_cmshaplut_t shaplut;
297  jas_cmclrspcconv_t clrspcconv;
298  } data;
300 
305 typedef struct {
306  unsigned numpxforms;
307  unsigned maxpxforms;
308  jas_cmpxform_t **pxforms;
310 
315 typedef struct {
316  unsigned numinchans;
317  unsigned numoutchans;
318  jas_cmpxformseq_t *pxformseq;
319 } jas_cmxform_t;
320 
321 #define JAS_CMPROF_TYPE_DEV 1
322 #define JAS_CMPROF_TYPE_CLRSPC 2
323 
324 #define JAS_CMPROF_NUMPXFORMSEQS 13
325 
329 typedef struct {
330  jas_clrspc_t clrspc;
331  unsigned numchans;
332  unsigned refclrspc;
333  unsigned numrefchans;
334  jas_iccprof_t *iccprof;
335  jas_cmpxformseq_t *pxformseqs[JAS_CMPROF_NUMPXFORMSEQS];
336 } jas_cmprof_t;
337 
338 /******************************************************************************\
339 *
340 \******************************************************************************/
341 
342 #if 0
343 typedef int_fast32_t jas_cmattrname_t;
344 typedef int_fast32_t jas_cmattrval_t;
345 typedef int_fast32_t jas_cmattrtype_t;
346 /* Load a profile. */
347 int jas_cmprof_load(jas_cmprof_t *prof, jas_stream_t *in, unsigned fmt);
348 /* Save a profile. */
349 int jas_cmprof_save(jas_cmprof_t *prof, jas_stream_t *out, unsigned fmt);
350 /* Set an attribute of a profile. */
351 int jas_cm_prof_setattr(jas_cm_prof_t *prof, jas_cm_attrname_t name, void *val);
352 /* Get an attribute of a profile. */
353 void *jas_cm_prof_getattr(jas_cm_prof_t *prof, jas_cm_attrname_t name);
354 #endif
355 
356 /******************************************************************************\
357 * Color-management (CM) profile class.
358 \******************************************************************************/
359 
371 JAS_EXPORT
372 jas_cmprof_t *jas_cmprof_createfromiccprof(const jas_iccprof_t *iccprof);
373 
385 JAS_EXPORT
387 
393 JAS_EXPORT
394 void jas_cmprof_destroy(jas_cmprof_t *prof);
395 
407 JAS_EXPORT
409 
421 JAS_EXPORT
422 jas_iccprof_t *jas_iccprof_createfromcmprof(const jas_cmprof_t *prof);
423 
424 /******************************************************************************\
425 * Color-Management (CM) Transform.
426 \******************************************************************************/
427 
438 JAS_EXPORT
440  const jas_cmprof_t *outprof, const jas_cmprof_t *proofprof,
442  jas_cmxform_optm_t optimize);
443 
450 JAS_EXPORT
452 
463 JAS_EXPORT
464 int jas_cmxform_apply(const jas_cmxform_t *xform, const jas_cmpixmap_t *in,
465  jas_cmpixmap_t *out);
466 
467 /******************************************************************************\
468 * Miscellany.
469 \******************************************************************************/
470 
479 unsigned jas_clrspc_numchans(jas_clrspc_t clrspc);
480 
489 #define jas_cmprof_clrspc(prof) ((prof)->clrspc)
490 
495 #ifdef __cplusplus
496 }
497 #endif
498 
499 #endif
jas_init.h
JasPer Initialization/Cleanup Code.
jas_tvparser_t
Tag-value parser type.
Definition: jas_tvp.h:108
jas_tvparser_gettag
const char * jas_tvparser_gettag(const jas_tvparser_t *tvp)
Get the tag name for the current tag-value pair.
Definition: jas_tvp.c:198
jas_conf_set_allocator
JAS_EXPORT void jas_conf_set_allocator(jas_allocator_t *allocator)
Set the memory allocator to be used by the library.
Definition: jas_init.c:425
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_cmxform_optm_t
jas_cmxform_optm_t
Transform optimization.
Definition: jas_cm.h:131
JAS_OPT_HASARG
#define JAS_OPT_HASARG
Definition: jas_getopt.h:94
jas_cmxform_op_t
jas_cmxform_op_t
Transform operations.
Definition: jas_cm.h:103
jas_malloc.h
JasPer Memory Allocator.
JAS_CMXFORM_NUMINTENTS
#define JAS_CMXFORM_NUMINTENTS
Number of rendering intents.
Definition: jas_cm.h:125
jas_cleanup
JAS_EXPORT void jas_cleanup()
Perform any clean up for the JasPer library.
Definition: jas_init.c:822
jas_std_allocator_init
JAS_EXPORT void jas_std_allocator_init(jas_std_allocator_t *allocator)
Initialize a memory allocator that uses malloc and related functions for managing memory.
Definition: jas_malloc.c:262
jas_stream_fdopen
jas_stream_t * jas_stream_fdopen(int fd, const char *mode)
Open a file descriptor as a stream.
Definition: jas_stream.c:521
jasper.h
JasPer Main Header.
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_conf_set_max_mem_usage
JAS_EXPORT void jas_conf_set_max_mem_usage(size_t max_mem)
Set the maximum amount of memory that can be used by the library (assuming the allocator wrapper is n...
Definition: jas_init.c:445
jas_conf_clear
JAS_EXPORT void jas_conf_clear()
Configure the JasPer library with the default configuration settings.
Definition: jas_init.c:397
jas_cmprof_createfromclrspc
jas_cmprof_t * jas_cmprof_createfromclrspc(jas_clrspc_t clrspc)
Create a color-management profile from a color space.
Definition: jas_cm.c:169
jas_stream_copy
int jas_stream_copy(jas_stream_t *out, jas_stream_t *in, ssize_t n)
Copy data from one stream to another.
Definition: jas_stream.c:1101
jas_clrspc_numchans
unsigned jas_clrspc_numchans(jas_clrspc_t clrspc)
Get the number of channels associated with a particular color space.
Definition: jas_cm.c:1410
jas_get_dec_default_max_samples
static size_t jas_get_dec_default_max_samples(void)
Get the default maximum number of samples that a decoder is permitted to process.
Definition: jas_init.h:456
jas_std_allocator_t
The standard library allocator (i.e., a wrapper for malloc and friends).
Definition: jas_malloc.h:143
jas_image_strtofmt
int jas_image_strtofmt(const char *name)
Get the ID for the image format with the specified name.
Definition: jas_image.c:835
jas_cmxform_t
Primitive transform class.
Definition: jas_cm.h:315
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_cmshapmatlut_t
Shaper matrix look-up table (LUT).
Definition: jas_cm.h:249
jas_image_rawsize
uint_fast32_t jas_image_rawsize(const jas_image_t *image)
Get the raw size of an image (i.e., the nominal size of the image without any compression.
Definition: jas_image.c:918
jas_cleanup_library
JAS_EXPORT int jas_cleanup_library()
Perform clean up for the JasPer library.
Definition: jas_init.c:636
jas_cleanup_thread
JAS_EXPORT int jas_cleanup_thread()
Perform per-thread cleanup for the JasPer library.
Definition: jas_init.c:757
jas_tvp.h
Tag/Value Pair Parser.
jas_image_readcmpt
int jas_image_readcmpt(jas_image_t *image, unsigned cmptno, jas_image_coord_t x, jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height, jas_matrix_t *data)
Read a rectangular region of an image component.
Definition: jas_image.c:485
jas_taginfo_t
Tag information type.
Definition: jas_tvp.h:94
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_cmshapmat_t
Shaper matrix.
Definition: jas_cm.h:258
jas_get_total_mem_size
size_t jas_get_total_mem_size()
Get the total amount of memory available on the system.
Definition: jas_malloc.c:627
jas_cmxform_apply
int jas_cmxform_apply(const jas_cmxform_t *xform, const jas_cmpixmap_t *in, jas_cmpixmap_t *out)
Apply a transform to data.
Definition: jas_cm.c:552
jas_opt_t
Command line option type.
Definition: jas_getopt.h:104
jas_stream_t
I/O stream object.
Definition: jas_stream.h:206
jas_tvparser_next
int jas_tvparser_next(jas_tvparser_t *tvp)
Get the next tag-value pair.
Definition: jas_tvp.c:122
jas_taginfos_lookup
const jas_taginfo_t * jas_taginfos_lookup(const jas_taginfo_t *taginfos, const char *name)
Lookup a tag by name.
Definition: jas_tvp.c:214
jas_alloc2
void * jas_alloc2(size_t num_elements, size_t element_size)
Allocate array (with overflow checking).
Definition: jas_malloc.c:212
jas_clrspc_isgeneric
#define jas_clrspc_isgeneric(clrspc)
Test if a color space is generic.
Definition: jas_cm.h:160
jas_matrix_numcols
static JAS_ATTRIBUTE_PURE jas_matind_t jas_matrix_numcols(const jas_matrix_t *matrix)
Get the number of columns in a matrix.
Definition: jas_seq.h:196
jas_set_max_mem_usage
void jas_set_max_mem_usage(size_t max_mem)
Set the maximum memory usage allowed by the allocator wrapper.
Definition: jas_malloc.c:355
jas_cmprof_copy
jas_cmprof_t * jas_cmprof_copy(const jas_cmprof_t *prof)
Copy a color-management profile.
Definition: jas_cm.c:407
jas_cmcmptfmt_t
Component format.
Definition: jas_cm.h:218
jas_conf_set_debug_level
JAS_EXPORT void jas_conf_set_debug_level(int debug_level)
Set the initial debug level for the library.
Definition: jas_init.c:439
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_init
JAS_EXPORT int jas_init()
Configure and initialize the JasPer library using the default configuration settings.
Definition: jas_init.c:807
jas_cmpxform_t
struct jas_cmpxform_s jas_cmpxform_t
Transform class.
jas_matrix_numrows
static JAS_ATTRIBUTE_PURE jas_matind_t jas_matrix_numrows(const jas_matrix_t *matrix)
Get the number of rows in a matrix.
Definition: jas_seq.h:187
jas_image_create
jas_image_t * jas_image_create(unsigned numcmpts, const jas_image_cmptparm_t *cmptparms, jas_clrspc_t clrspc)
Create an image.
Definition: jas_image.c:126
jas_taginfo_nonull
const jas_taginfo_t * jas_taginfo_nonull(const jas_taginfo_t *taginfo)
Ensure a nonnull taginfo pointer.
Definition: jas_tvp.c:230
jas_matrix_create
jas_matrix_t * jas_matrix_create(jas_matind_t numrows, jas_matind_t numcols)
Create a matrix with the specified dimensions.
Definition: jas_seq.c:102
jas_stream_fopen
jas_stream_t * jas_stream_fopen(const char *filename, const char *mode)
Open a file as a stream.
Definition: jas_stream.c:283
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:720
jas_cmprof_destroy
void jas_cmprof_destroy(jas_cmprof_t *prof)
Destroy a color-management profile.
Definition: jas_cm.c:393
jas_image_cmptwidth
#define jas_image_cmptwidth(image, cmptno)
Get the width of a component.
Definition: jas_image.h:437
jas_cmpixmap_t
Pixmap (i.e., multicomponent) format.
Definition: jas_cm.h:230
jas_cmpxformseq_t
Primitive transform sequence class.
Definition: jas_cm.h:305
jas_stream_peek
unsigned jas_stream_peek(jas_stream_t *stream, void *buf, size_t cnt)
Attempt to retrieve one or more pending characters of input from a stream into a buffer without actua...
Definition: jas_stream.c:704
jas_image_fmttostr
const char * jas_image_fmttostr(int fmt)
Get the name of the image format with the specified ID.
Definition: jas_image.c:844
jas_image_setclrspc
#define jas_image_setclrspc(image, clrspc)
Set the color model for an image.
Definition: jas_image.h:426
jas_image_width
#define jas_image_width(image)
Get the width of the image in units of the image reference grid.
Definition: jas_image.h:374
jas_image_getnumfmts
JAS_EXPORT int jas_image_getnumfmts(void)
Get the number of image format table entries.
Definition: jas_image.c:730
jas_image_create0
jas_image_t * jas_image_create0()
Create an "empty" image.
Definition: jas_image.c:201
jas_debug.h
JasPer Debugging-Related Functionality.
jas_cmpxformops_t
Transform operations.
Definition: jas_cm.h:239
jas_init_thread
JAS_EXPORT int jas_init_thread()
Perform per-thread initialization for the JasPer library.
Definition: jas_init.c:696
jas_cmreal_t
double jas_cmreal_t
Definition: jas_cm.h:210
jas_clrspc_fam
#define jas_clrspc_fam(clrspc)
Get the family of a color space.
Definition: jas_cm.h:148
jas_image_getfmt
int jas_image_getfmt(jas_stream_t *in)
Get the format of image data in a stream.
Definition: jas_image.c:853
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_getopt
int jas_getopt(int argc, char **argv, const jas_opt_t *opts)
Get the next option.
Definition: jas_getopt.c:107
jas_image_writecmpt
int jas_image_writecmpt(jas_image_t *image, unsigned cmptno, jas_image_coord_t x, jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height, const jas_matrix_t *data)
Write a rectangular region of an image component.
Definition: jas_image.c:588
jas_image_numcmpts
#define jas_image_numcmpts(image)
Get the number of image components.
Definition: jas_image.h:414
jas_image_addcmpt
int jas_image_addcmpt(jas_image_t *image, int cmptno, const jas_image_cmptparm_t *cmptparm)
Add a component to an image.
Definition: jas_image.c:947
jas_free
JAS_EXPORT void jas_free(void *ptr)
Free memory.
Definition: jas_malloc.c:186
jas_image_getfmtbyind
const JAS_EXPORT jas_image_fmtinfo_t * jas_image_getfmtbyind(int index)
Get a image format entry by its table index.
Definition: jas_image.c:722
JAS_CLRSPC_GENRGB
#define JAS_CLRSPC_GENRGB
Generic color spaces.
Definition: jas_cm.h:193
jas_image_fmtinfo_t::enabled
int enabled
Definition: jas_image.h:332
jas_types.h
Primitive Types.
jas_cmxform_intent_t
jas_cmxform_intent_t
Rendering intents.
Definition: jas_cm.h:114
jas_stream.h
I/O Stream Class.
jas_matrix_get
static JAS_ATTRIBUTE_PURE jas_seqent_t jas_matrix_get(const jas_matrix_t *matrix, jas_matind_t i, jas_matind_t j)
Get a matrix element.
Definition: jas_seq.h:226
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_image_encode
int jas_image_encode(jas_image_t *image, jas_stream_t *out, int fmt, const char *optstr)
Write an image to a stream in a specified format.
Definition: jas_image.c:469
jas_stream_flush
int jas_stream_flush(jas_stream_t *stream)
Flush any pending output to a stream.
Definition: jas_stream.c:974
jas_tvparser_create
jas_tvparser_t * jas_tvparser_create(const char *s)
Create a tag-value parser for the specified string.
Definition: jas_tvp.c:93
jas_cm.h
JasPer Color Management.
jas_iccprof_createfromcmprof
jas_iccprof_t * jas_iccprof_createfromcmprof(const jas_cmprof_t *prof)
Create a ICC profile from a CM profile.
Definition: jas_cm.c:1425
jas_cmprof_t
Definition: jas_cm.h:329
jas_init_library
JAS_EXPORT int jas_init_library()
Initialize the JasPer library with the current configuration settings.
Definition: jas_init.c:475
jas_image_clearfmts
void jas_image_clearfmts()
Clear the table of image formats.
Definition: jas_image.c:755
jas_image_readcmptsample
int jas_image_readcmptsample(jas_image_t *image, unsigned cmptno, unsigned x, unsigned y)
Read a component sample for an image.
Definition: jas_image.c:1175
jas_image_t
Image class.
Definition: jas_image.h:215
jas_math.h
Math-Related Code.
jas_cmxform_create
jas_cmxform_t * jas_cmxform_create(const jas_cmprof_t *inprof, const jas_cmprof_t *outprof, const jas_cmprof_t *prfprof, jas_cmxform_op_t op, jas_cmxform_intent_t intent, jas_cmxform_optm_t optimize)
Create a transform from a CM profile.
Definition: jas_cm.c:437
jas_image_destroy
void jas_image_destroy(jas_image_t *image)
Deallocate any resources associated with an image.
Definition: jas_image.c:304
jas_image_cmptprec
#define jas_image_cmptprec(image, cmptno)
Get the precision of the sample data for a component.
Definition: jas_image.h:455
jas_tvparser_getval
const char * jas_tvparser_getval(const jas_tvparser_t *tvp)
Get the value for the current tag-value pair.
Definition: jas_tvp.c:204
jas_image_height
#define jas_image_height(image)
Get the height of the image in units of the image reference grid.
Definition: jas_image.h:380
jas_optarg
const char * jas_optarg
The current option argument.
Definition: jas_getopt.c:89
jas_image_fmtinfo_t
Image format information.
Definition: jas_image.h:314
jas_image_setfmtenable
JAS_EXPORT int jas_image_setfmtenable(int index, int enabled)
Get the number of image format table entries.
Definition: jas_image.c:737
jas_matrix_set
static void jas_matrix_set(jas_matrix_t *matrix, jas_matind_t i, jas_matind_t j, jas_seqent_t v)
Set a matrix element.
Definition: jas_seq.h:236
jas_clrspc_t
unsigned jas_clrspc_t
Color space.
Definition: jas_cm.h:97
jas_cmclrspcconv_t
Color space conversion.
Definition: jas_cm.h:279
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_matrix_destroy
void jas_matrix_destroy(jas_matrix_t *matrix)
Destroy a matrix.
Definition: jas_seq.c:162
jas_cmprof_createfromiccprof
jas_cmprof_t * jas_cmprof_createfromiccprof(const jas_iccprof_t *iccprof)
Create a color-management profile from an ICC profile.
Definition: jas_cm.c:291
jas_cmshaplut_t
Shaper look-up table (LUT).
Definition: jas_cm.h:271
jas_image.h
JasPer Image Class.
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_image_cmptparm_t
Component parameters class.
Definition: jas_image.h:258
jas_setdbglevel
JAS_EXPORT int jas_setdbglevel(int dbglevel)
Set the library debug level.
Definition: jas_debug.c:83
jas_matrix_t
Matrix type.
Definition: jas_seq.h:129
jas_tvparser_destroy
void jas_tvparser_destroy(jas_tvparser_t *tvp)
Destroy a tag-value parser.
Definition: jas_tvp.c:109
jas_conf_set_vlogmsgf
JAS_EXPORT void jas_conf_set_vlogmsgf(jas_vlogmsgf_t *func)
Set the function used by the library to output error, warning, and informational messages.
jas_cmpxform_s
Transform class.
Definition: jas_cm.h:288
jas_cmxform_destroy
void jas_cmxform_destroy(jas_cmxform_t *xform)
Destroy a transform.
Definition: jas_cm.c:661
jas_image_fmtinfo_t::name
char * name
Definition: jas_image.h:320
jas_image_decode
jas_image_t * jas_image_decode(jas_stream_t *in, int fmt, const char *optstr)
Create an image from a stream in some specified format.
Definition: jas_image.c:420
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_image_cmptheight
#define jas_image_cmptheight(image, cmptno)
Get the height of a component.
Definition: jas_image.h:443
jas_vlogmsgf_discard
JAS_EXPORT int jas_vlogmsgf_discard(jas_logtype_t type, const char *fmt, va_list ap)
Output a log message to nowhere (i.e., discard the message).
Definition: jas_debug.c:218