Go to the documentation of this file.
71 #include <jasper/jas_config.h>
79 typedef unsigned jas_clrspc_t;
83 JAS_CMXFORM_OP_FWD = 0,
84 JAS_CMXFORM_OP_REV = 1,
85 JAS_CMXFORM_OP_PROOF = 2,
86 JAS_CMXFORM_OP_GAMUT = 3,
91 JAS_CMXFORM_INTENT_PER = 0,
92 JAS_CMXFORM_INTENT_RELCLR = 1,
93 JAS_CMXFORM_INTENT_ABSCLR = 2,
94 JAS_CMXFORM_INTENT_SAT = 3,
95 } jas_cmxform_intent_t;
97 #define JAS_CMXFORM_NUMINTENTS 4
100 JAS_CMXFORM_OPTM_SPEED = 0,
101 JAS_CMXFORM_OPTM_SIZE = 1,
102 JAS_CMXFORM_OPTM_ACC = 2,
103 } jas_cmxform_optm_t;
106 #define jas_clrspc_create(fam, mbr) (((fam) << 8) | (mbr))
107 #define jas_clrspc_fam(clrspc) ((clrspc) >> 8)
108 #define jas_clrspc_mbr(clrspc) ((clrspc) & 0xff)
109 #define jas_clrspc_isgeneric(clrspc) (!jas_clrspc_mbr(clrspc))
110 #define jas_clrspc_isunknown(clrspc) ((clrspc) & JAS_CLRSPC_UNKNOWNMASK)
112 #define JAS_CLRSPC_UNKNOWNMASK 0x4000
115 #define JAS_CLRSPC_FAM_UNKNOWN 0
116 #define JAS_CLRSPC_FAM_XYZ 1
117 #define JAS_CLRSPC_FAM_LAB 2
118 #define JAS_CLRSPC_FAM_GRAY 3
119 #define JAS_CLRSPC_FAM_RGB 4
120 #define JAS_CLRSPC_FAM_YCBCR 5
123 #define JAS_CLRSPC_UNKNOWN JAS_CLRSPC_UNKNOWNMASK
124 #define JAS_CLRSPC_CIEXYZ jas_clrspc_create(JAS_CLRSPC_FAM_XYZ, 1)
125 #define JAS_CLRSPC_CIELAB jas_clrspc_create(JAS_CLRSPC_FAM_LAB, 1)
126 #define JAS_CLRSPC_SGRAY jas_clrspc_create(JAS_CLRSPC_FAM_GRAY, 1)
127 #define JAS_CLRSPC_SRGB jas_clrspc_create(JAS_CLRSPC_FAM_RGB, 1)
128 #define JAS_CLRSPC_SYCBCR jas_clrspc_create(JAS_CLRSPC_FAM_YCBCR, 1)
131 #define JAS_CLRSPC_GENRGB jas_clrspc_create(JAS_CLRSPC_FAM_RGB, 0)
132 #define JAS_CLRSPC_GENGRAY jas_clrspc_create(JAS_CLRSPC_FAM_GRAY, 0)
133 #define JAS_CLRSPC_GENYCBCR jas_clrspc_create(JAS_CLRSPC_FAM_YCBCR, 0)
135 #define JAS_CLRSPC_CHANIND_YCBCR_Y 0
136 #define JAS_CLRSPC_CHANIND_YCBCR_CB 1
137 #define JAS_CLRSPC_CHANIND_YCBCR_CR 2
139 #define JAS_CLRSPC_CHANIND_RGB_R 0
140 #define JAS_CLRSPC_CHANIND_RGB_G 1
141 #define JAS_CLRSPC_CHANIND_RGB_B 2
143 #define JAS_CLRSPC_CHANIND_GRAY_Y 0
145 typedef double jas_cmreal_t;
147 struct jas_cmpxform_s;
159 jas_cmcmptfmt_t *cmptfmts;
163 void (*destroy)(
struct jas_cmpxform_s *pxform);
164 int (*apply)(
const struct jas_cmpxform_s *pxform,
const jas_cmreal_t *in, jas_cmreal_t *out,
unsigned cnt);
165 void (*dump)(
struct jas_cmpxform_s *pxform);
171 } jas_cmshapmatlut_t;
178 jas_cmshapmatlut_t luts[3];
179 jas_cmreal_t mat[3][4];
189 } jas_cmclrspcconv_t;
191 #define jas_align_t double
193 typedef struct jas_cmpxform_s {
195 const jas_cmpxformops_t *ops;
197 unsigned numoutchans;
200 jas_cmshapmat_t shapmat;
201 jas_cmshaplut_t shaplut;
202 jas_cmclrspcconv_t clrspcconv;
209 jas_cmpxform_t **pxforms;
214 unsigned numoutchans;
215 jas_cmpxformseq_t *pxformseq;
218 #define JAS_CMPROF_TYPE_DEV 1
219 #define JAS_CMPROF_TYPE_CLRSPC 2
221 #define JAS_CMPROF_NUMPXFORMSEQS 13
227 unsigned numrefchans;
228 jas_iccprof_t *iccprof;
229 jas_cmpxformseq_t *pxformseqs[JAS_CMPROF_NUMPXFORMSEQS];
233 typedef int_fast32_t jas_cmattrname_t;
234 typedef int_fast32_t jas_cmattrval_t;
235 typedef int_fast32_t jas_cmattrtype_t;
237 int jas_cmprof_load(jas_cmprof_t *prof, jas_stream_t *in,
unsigned fmt);
239 int jas_cmprof_save(jas_cmprof_t *prof, jas_stream_t *out,
unsigned fmt);
241 int jas_cm_prof_setattr(jas_cm_prof_t *prof, jas_cm_attrname_t name,
void *val);
243 void *jas_cm_prof_getattr(jas_cm_prof_t *prof, jas_cm_attrname_t name);
246 JAS_DLLEXPORT jas_cmxform_t *jas_cmxform_create(
const jas_cmprof_t *inprof,
const jas_cmprof_t *outprof,
247 const jas_cmprof_t *proofprof, jas_cmxform_op_t op, jas_cmxform_intent_t intent, jas_cmxform_optm_t optimize);
249 JAS_DLLEXPORT
void jas_cmxform_destroy(jas_cmxform_t *xform);
252 JAS_DLLEXPORT
int jas_cmxform_apply(
const jas_cmxform_t *xform,
const jas_cmpixmap_t *in,
253 jas_cmpixmap_t *out);
256 JAS_DLLEXPORT jas_cmprof_t *jas_cmprof_createfromiccprof(
const jas_iccprof_t *iccprof);
257 JAS_DLLEXPORT jas_cmprof_t *jas_cmprof_createfromclrspc(jas_clrspc_t clrspc);
260 JAS_DLLEXPORT
void jas_cmprof_destroy(jas_cmprof_t *prof);
262 unsigned jas_clrspc_numchans(jas_clrspc_t clrspc);
263 JAS_DLLEXPORT jas_iccprof_t *jas_iccprof_createfromcmprof(
const jas_cmprof_t *prof);
265 #define jas_cmprof_clrspc(prof) ((prof)->clrspc)
266 JAS_DLLEXPORT jas_cmprof_t *jas_cmprof_copy(
const jas_cmprof_t *prof);
void jas_image_destroy(jas_image_t *image)
Deallocate any resources associated with an image.
Definition: jas_image.c:303
#define jas_image_cmptprec(image, cmptno)
Get the precision of the sample data for a component.
Definition: jas_image.h:427
jas_stream_t * jas_stream_fopen(const char *filename, const char *mode)
Open a file as a stream.
Definition: jas_stream.c:301
#define jas_image_numcmpts(image)
Get the number of image components.
Definition: jas_image.h:386
int jas_stream_close(jas_stream_t *stream)
Close a stream.
Definition: jas_stream.c:610
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:470
jas_stream_t * jas_stream_fdopen(int fd, const char *mode)
Open a file descriptor as a stream.
Definition: jas_stream.c:540
int jas_image_getfmt(jas_stream_t *in)
Get the format of image data in a stream.
Definition: jas_image.c:753
#define jas_image_cmptheight(image, cmptno)
Get the height of a component.
Definition: jas_image.h:415
int jas_image_strtofmt(const char *name)
Get the ID for the image format with the specified name.
Definition: jas_image.c:735
JAS_DLLEXPORT int jas_init()
Initialize the JasPer library.
Definition: jas_init.c:77
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:570
jas_stream_t * jas_stream_memopen(char *buf, int bufsize)
Open a memory buffer as a stream.
Definition: jas_stream.c:276
const char * jas_image_fmttostr(int fmt)
Get the name of the image format with the specified ID.
Definition: jas_image.c:744
JasPer Debugging-Related Functionality.
#define jas_image_cmptwidth(image, cmptno)
Get the width of a component.
Definition: jas_image.h:409
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:816
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:127
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:454
void jas_image_clearfmts()
Clear the table of image formats.
Definition: jas_image.c:666
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:416
Image class.
Definition: jas_image.h:202
Component parameters class.
Definition: jas_image.h:243