JasPer  3.0.1
Color Management

Color Management. More...

Classes

struct  jas_cmcmptfmt_t
 Component format. More...
 
struct  jas_cmpixmap_t
 Pixmap (i.e., multicomponent) format. More...
 
struct  jas_cmpxformops_t
 Transform operations. More...
 
struct  jas_cmshapmatlut_t
 Shaper matrix look-up table (LUT). More...
 
struct  jas_cmshapmat_t
 Shaper matrix. More...
 
struct  jas_cmshaplut_t
 Shaper look-up table (LUT). More...
 
struct  jas_cmclrspcconv_t
 Color space conversion. More...
 
struct  jas_cmpxform_s
 Transform class. More...
 
struct  jas_cmpxformseq_t
 Primitive transform sequence class. More...
 
struct  jas_cmxform_t
 Primitive transform class. More...
 
struct  jas_cmprof_t
 

Macros

#define JAS_CMXFORM_NUMINTENTS   4
 Number of rendering intents. More...
 
#define jas_clrspc_create(fam, mbr)   (((fam) << 8) | (mbr))
 Create a color space. More...
 
#define jas_clrspc_fam(clrspc)   ((clrspc) >> 8)
 Get the family of a color space. More...
 
#define jas_clrspc_mbr(clrspc)   ((clrspc) & 0xff)
 Get the (family) member of a color space. More...
 
#define jas_clrspc_isgeneric(clrspc)   (!jas_clrspc_mbr(clrspc))
 Test if a color space is generic. More...
 
#define jas_clrspc_isunknown(clrspc)   ((clrspc) & JAS_CLRSPC_UNKNOWNMASK)
 Test if a color space is unknown. More...
 
#define JAS_CLRSPC_FAM_UNKNOWN   0
 Color space families. More...
 
#define JAS_CLRSPC_UNKNOWN   JAS_CLRSPC_UNKNOWNMASK
 Specific color spaces. More...
 
#define JAS_CLRSPC_GENRGB   jas_clrspc_create(JAS_CLRSPC_FAM_RGB, 0)
 Generic color spaces. More...
 
#define jas_cmprof_clrspc(prof)   ((prof)->clrspc)
 Get the color space associated with a color-management profile. More...
 

Typedefs

typedef unsigned jas_clrspc_t
 Color space. More...
 
typedef double jas_cmreal_t
 
typedef struct jas_cmpxform_s jas_cmpxform_t
 Transform class. More...
 

Enumerations

enum  jas_cmxform_op_t
 Transform operations. More...
 
enum  jas_cmxform_intent_t
 Rendering intents. More...
 
enum  jas_cmxform_optm_t
 Transform optimization. More...
 

Functions

JAS_EXPORT jas_cmprof_tjas_cmprof_createfromiccprof (const jas_iccprof_t *iccprof)
 Create a color-management profile from an ICC profile. More...
 
JAS_EXPORT jas_cmprof_tjas_cmprof_createfromclrspc (jas_clrspc_t clrspc)
 Create a color-management profile from a color space. More...
 
JAS_EXPORT void jas_cmprof_destroy (jas_cmprof_t *prof)
 Destroy a color-management profile. More...
 
JAS_EXPORT jas_cmprof_tjas_cmprof_copy (const jas_cmprof_t *prof)
 Copy a color-management profile. More...
 
JAS_EXPORT jas_iccprof_t * jas_iccprof_createfromcmprof (const jas_cmprof_t *prof)
 Create a ICC profile from a CM profile. More...
 
JAS_EXPORT jas_cmxform_tjas_cmxform_create (const jas_cmprof_t *inprof, const jas_cmprof_t *outprof, const jas_cmprof_t *proofprof, jas_cmxform_op_t op, jas_cmxform_intent_t intent, jas_cmxform_optm_t optimize)
 Create a transform from a CM profile. More...
 
JAS_EXPORT void jas_cmxform_destroy (jas_cmxform_t *xform)
 Destroy a transform. More...
 
JAS_EXPORT int jas_cmxform_apply (const jas_cmxform_t *xform, const jas_cmpixmap_t *in, jas_cmpixmap_t *out)
 Apply a transform to data. More...
 
unsigned jas_clrspc_numchans (jas_clrspc_t clrspc)
 Get the number of channels associated with a particular color space. More...
 
JAS_EXPORT jas_iccprof_t * jas_iccprof_load (jas_stream_t *in)
 Read an ICC profile from a stream. More...
 
JAS_EXPORT int jas_iccprof_save (jas_iccprof_t *prof, jas_stream_t *out)
 Write an ICC profile to a stream. More...
 
JAS_EXPORT void jas_iccprof_destroy (jas_iccprof_t *prof)
 Destroy an ICC profile. More...
 
JAS_ATTRIBUTE_PURE JAS_EXPORT jas_iccattrval_t * jas_iccprof_getattr (const jas_iccprof_t *prof, jas_iccattrname_t name)
 Get an attribute of an ICC profile. More...
 
JAS_EXPORT int jas_iccprof_setattr (jas_iccprof_t *prof, jas_iccattrname_t name, jas_iccattrval_t *val)
 Set an attribute of an ICC profile. More...
 
JAS_EXPORT 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. More...
 
JAS_EXPORT jas_iccprof_t * jas_iccprof_copy (const jas_iccprof_t *prof)
 Create a copy of an ICC profile. More...
 
JAS_EXPORT int jas_iccprof_gethdr (const jas_iccprof_t *prof, jas_icchdr_t *hdr)
 Get the header for an ICC profile. More...
 
JAS_EXPORT int jas_iccprof_sethdr (jas_iccprof_t *prof, const jas_icchdr_t *hdr)
 Set the header for an ICC profile. More...
 
JAS_EXPORT void jas_iccattrval_destroy (jas_iccattrval_t *attrval)
 Destroy an ICC profile attribute. More...
 
JAS_EXPORT int jas_iccattrval_allowmodify (jas_iccattrval_t **attrval)
 TODO/FIXME. More...
 
JAS_EXPORT jas_iccattrval_t * jas_iccattrval_clone (jas_iccattrval_t *attrval)
 Create a copy of an ICC profile attribute. More...
 
JAS_EXPORT jas_iccattrval_t * jas_iccattrval_create (jas_iccuint32_t type)
 Create an ICC profile attribute. More...
 
JAS_EXPORT 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. More...
 
JAS_EXPORT jas_iccprof_t * jas_iccprof_createfrombuf (const jas_uchar *buf, unsigned len)
 Create an ICC profile from a buffer in memory. More...
 
JAS_EXPORT jas_iccprof_t * jas_iccprof_createfromclrspc (unsigned clrspc)
 Create an ICC profile from a color space. More...
 

Detailed Description

Color Management.

General information can be found here.

Macro Definition Documentation

◆ jas_clrspc_create

#define jas_clrspc_create (   fam,
  mbr 
)    (((fam) << 8) | (mbr))

Create a color space.

◆ jas_clrspc_fam

#define jas_clrspc_fam (   clrspc)    ((clrspc) >> 8)

Get the family of a color space.

◆ JAS_CLRSPC_FAM_UNKNOWN

#define JAS_CLRSPC_FAM_UNKNOWN   0

Color space families.

◆ JAS_CLRSPC_GENRGB

#define JAS_CLRSPC_GENRGB   jas_clrspc_create(JAS_CLRSPC_FAM_RGB, 0)

Generic color spaces.

◆ jas_clrspc_isgeneric

#define jas_clrspc_isgeneric (   clrspc)    (!jas_clrspc_mbr(clrspc))

Test if a color space is generic.

◆ jas_clrspc_isunknown

#define jas_clrspc_isunknown (   clrspc)    ((clrspc) & JAS_CLRSPC_UNKNOWNMASK)

Test if a color space is unknown.

◆ jas_clrspc_mbr

#define jas_clrspc_mbr (   clrspc)    ((clrspc) & 0xff)

Get the (family) member of a color space.

◆ JAS_CLRSPC_UNKNOWN

#define JAS_CLRSPC_UNKNOWN   JAS_CLRSPC_UNKNOWNMASK

Specific color spaces.

◆ jas_cmprof_clrspc

#define jas_cmprof_clrspc (   prof)    ((prof)->clrspc)

Get the color space associated with a color-management profile.

Returns

◆ JAS_CMXFORM_NUMINTENTS

#define JAS_CMXFORM_NUMINTENTS   4

Number of rendering intents.

Typedef Documentation

◆ jas_clrspc_t

typedef unsigned jas_clrspc_t

Color space.

◆ jas_cmpxform_t

Transform class.

◆ jas_cmreal_t

typedef double jas_cmreal_t

Real-number type.

Enumeration Type Documentation

◆ jas_cmxform_intent_t

Rendering intents.

◆ jas_cmxform_op_t

Transform operations.

◆ jas_cmxform_optm_t

Transform optimization.

Function Documentation

◆ jas_clrspc_numchans()

unsigned jas_clrspc_numchans ( jas_clrspc_t  clrspc)

Get the number of channels associated with a particular color space.

Returns

◆ jas_cmprof_copy()

JAS_EXPORT jas_cmprof_t* jas_cmprof_copy ( const jas_cmprof_t prof)

Copy a color-management profile.

This function creates a clone (i.e., copy) of a CM profile.

Returns
If successful, a pointer to the newly created CM profile is returned. Otherwise, a null pointer is returned.

◆ jas_cmprof_createfromclrspc()

JAS_EXPORT jas_cmprof_t* jas_cmprof_createfromclrspc ( jas_clrspc_t  clrspc)

Create a color-management profile from a color space.

The function creates a CM profile from a color space.

Returns
If successful, a pointer to the created CM profile is returned. Otherwise, a null pointer is returned.

◆ jas_cmprof_createfromiccprof()

JAS_EXPORT jas_cmprof_t* jas_cmprof_createfromiccprof ( const jas_iccprof_t *  iccprof)

Create a color-management profile from an ICC profile.

This function creates a CM profile from an ICC profile.

Returns
If successful, a pointer to the created CM profile is returned. Otherwise, a null pointer is returned.

◆ jas_cmprof_destroy()

JAS_EXPORT void jas_cmprof_destroy ( jas_cmprof_t prof)

Destroy a color-management profile.

◆ jas_cmxform_apply()

JAS_EXPORT int jas_cmxform_apply ( const jas_cmxform_t xform,
const jas_cmpixmap_t in,
jas_cmpixmap_t out 
)

Apply a transform to data.

Returns
If successful, zero is returned. Otherwise, a nonzero value is returned.

◆ jas_cmxform_create()

JAS_EXPORT jas_cmxform_t* jas_cmxform_create ( const jas_cmprof_t inprof,
const jas_cmprof_t outprof,
const jas_cmprof_t proofprof,
jas_cmxform_op_t  op,
jas_cmxform_intent_t  intent,
jas_cmxform_optm_t  optimize 
)

Create a transform from a CM profile.

Returns
If successful, a pointer to the created transform is returned. Otherwise, a null pointer is returned.

◆ jas_cmxform_destroy()

JAS_EXPORT void jas_cmxform_destroy ( jas_cmxform_t xform)

Destroy a transform.

◆ jas_iccattrtab_dump()

JAS_EXPORT 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.

◆ jas_iccattrval_allowmodify()

JAS_EXPORT int jas_iccattrval_allowmodify ( jas_iccattrval_t **  attrval)

TODO/FIXME.

◆ jas_iccattrval_clone()

JAS_EXPORT jas_iccattrval_t* jas_iccattrval_clone ( jas_iccattrval_t *  attrval)

Create a copy of an ICC profile attribute.

◆ jas_iccattrval_create()

JAS_EXPORT jas_iccattrval_t* jas_iccattrval_create ( jas_iccuint32_t  type)

Create an ICC profile attribute.

◆ jas_iccattrval_destroy()

JAS_EXPORT void jas_iccattrval_destroy ( jas_iccattrval_t *  attrval)

Destroy an ICC profile attribute.

◆ jas_iccprof_copy()

JAS_EXPORT jas_iccprof_t* jas_iccprof_copy ( const jas_iccprof_t *  prof)

Create a copy of an ICC profile.

◆ jas_iccprof_createfrombuf()

JAS_EXPORT jas_iccprof_t* jas_iccprof_createfrombuf ( const jas_uchar *  buf,
unsigned  len 
)

Create an ICC profile from a buffer in memory.

◆ jas_iccprof_createfromclrspc()

JAS_EXPORT jas_iccprof_t* jas_iccprof_createfromclrspc ( unsigned  clrspc)

Create an ICC profile from a color space.

◆ jas_iccprof_createfromcmprof()

JAS_EXPORT jas_iccprof_t* jas_iccprof_createfromcmprof ( const jas_cmprof_t prof)

Create a ICC profile from a CM profile.

This function creates an ICC profile from a CM profile.

Returns
If successful, a pointer to the created ICC profile is returned. Otherwise, a null pointer is returned.

◆ jas_iccprof_destroy()

JAS_EXPORT void jas_iccprof_destroy ( jas_iccprof_t *  prof)

Destroy an ICC profile.

◆ jas_iccprof_dump()

JAS_EXPORT 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.

◆ jas_iccprof_getattr()

JAS_ATTRIBUTE_PURE JAS_EXPORT jas_iccattrval_t* jas_iccprof_getattr ( const jas_iccprof_t *  prof,
jas_iccattrname_t  name 
)

Get an attribute of an ICC profile.

◆ jas_iccprof_gethdr()

JAS_EXPORT int jas_iccprof_gethdr ( const jas_iccprof_t *  prof,
jas_icchdr_t *  hdr 
)

Get the header for an ICC profile.

◆ jas_iccprof_load()

JAS_EXPORT jas_iccprof_t* jas_iccprof_load ( jas_stream_t in)

Read an ICC profile from a stream.

◆ jas_iccprof_save()

JAS_EXPORT int jas_iccprof_save ( jas_iccprof_t *  prof,
jas_stream_t out 
)

Write an ICC profile to a stream.

◆ jas_iccprof_setattr()

JAS_EXPORT int jas_iccprof_setattr ( jas_iccprof_t *  prof,
jas_iccattrname_t  name,
jas_iccattrval_t *  val 
)

Set an attribute of an ICC profile.

◆ jas_iccprof_sethdr()

JAS_EXPORT int jas_iccprof_sethdr ( jas_iccprof_t *  prof,
const jas_icchdr_t *  hdr 
)

Set the header for an ICC profile.