JasPer  3.0.1
Image Representation

Image Representation. More...

Classes

struct  jas_image_cmpt_t
 Image component class. More...
 
struct  jas_image_t
 Image class. More...
 
struct  jas_image_cmptparm_t
 Component parameters class. More...
 
struct  jas_image_fmtops_t
 Image format-dependent operations. More...
 
struct  jas_image_fmtinfo_t
 Image format information. More...
 

Macros

#define JAS_IMAGE_MAXFMTS   32
 The maximum number of image data formats supported. More...
 
#define jas_image_width(image)   ((image)->brx_ - (image)->tlx_)
 Get the width of the image in units of the image reference grid. More...
 
#define jas_image_height(image)   ((image)->bry_ - (image)->tly_)
 Get the height of the image in units of the image reference grid. More...
 
#define jas_image_tlx(image)   ((image)->tlx_)
 Get the x-coordinate of the top-left corner of the image bounding box on the reference grid. More...
 
#define jas_image_tly(image)   ((image)->tly_)
 Get the y-coordinate of the top-left corner of the image bounding box on the reference grid. More...
 
#define jas_image_brx(image)   ((image)->brx_)
 Get the x-coordinate of the bottom-right corner of the image bounding box on the reference grid (plus one). More...
 
#define jas_image_bry(image)   ((image)->bry_)
 Get the y-coordinate of the bottom-right corner of the image bounding box on the reference grid (plus one). More...
 
#define jas_image_numcmpts(image)   ((image)->numcmpts_)
 Get the number of image components. More...
 
#define jas_image_clrspc(image)   ((image)->clrspc_)
 Get the color model used by the image. More...
 
#define jas_image_setclrspc(image, clrspc)   ((image)->clrspc_ = (clrspc))
 Set the color model for an image. More...
 
#define jas_image_cmptwidth(image, cmptno)   ((image)->cmpts_[cmptno]->width_)
 Get the width of a component. More...
 
#define jas_image_cmptheight(image, cmptno)   ((image)->cmpts_[cmptno]->height_)
 Get the height of a component. More...
 
#define jas_image_cmptsgnd(image, cmptno)   ((image)->cmpts_[cmptno]->sgnd_)
 Get the signedness of the sample data for a component. More...
 
#define jas_image_cmptprec(image, cmptno)   ((image)->cmpts_[cmptno]->prec_)
 Get the precision of the sample data for a component. More...
 
#define jas_image_cmpthstep(image, cmptno)   ((image)->cmpts_[cmptno]->hstep_)
 Get the horizontal subsampling factor for a component. More...
 
#define jas_image_cmptvstep(image, cmptno)   ((image)->cmpts_[cmptno]->vstep_)
 Get the vertical subsampling factor for a component. More...
 
#define jas_image_cmpttlx(image, cmptno)   ((image)->cmpts_[cmptno]->tlx_)
 Get the x-coordinate of the top-left corner of a component. More...
 
#define jas_image_cmpttly(image, cmptno)   ((image)->cmpts_[cmptno]->tly_)
 Get the y-coordinate of the top-left corner of a component. More...
 
#define jas_image_cmptbrx(image, cmptno)
 Get the x-coordinate of the bottom-right corner of a component (plus "one"). More...
 
#define jas_image_cmptbry(image, cmptno)
 Get the y-coordinate of the bottom-right corner of a component (plus "one"). More...
 
#define jas_image_cmprof(image)   ((image)->cmprof_)
 Get the color management profile of an image. More...
 
#define jas_image_setcmprof(image, cmprof)   ((image)->cmprof_ = cmprof)
 Set the color management profile for an image. More...
 

Typedefs

typedef int_fast32_t jas_image_coord_t
 Image coordinate. More...
 
typedef int_fast16_t jas_image_colorspc_t
 Color space (e.g., RGB, YCbCr). More...
 
typedef int_fast32_t jas_image_cmpttype_t
 Component type (e.g., color, opacity). More...
 
typedef int_fast16_t jas_image_smpltype_t
 Component sample data format (e.g., real/integer, signedness, precision). More...
 

Functions

JAS_EXPORT jas_image_tjas_image_create (unsigned numcmpts, const jas_image_cmptparm_t *cmptparms, jas_clrspc_t clrspc)
 Create an image. More...
 
JAS_EXPORT jas_image_tjas_image_create0 (void)
 Create an "empty" image. More...
 
JAS_EXPORT jas_image_tjas_image_copy (jas_image_t *image)
 Clone an image. More...
 
JAS_EXPORT void jas_image_destroy (jas_image_t *image)
 Deallocate any resources associated with an image. More...
 
JAS_ATTRIBUTE_PURE JAS_EXPORT bool jas_image_cmpt_domains_same (const jas_image_t *image)
 Test if all components are specified at the same positions in space. More...
 
JAS_ATTRIBUTE_PURE JAS_EXPORT 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. More...
 
JAS_EXPORT jas_image_tjas_image_decode (jas_stream_t *in, int fmt, const char *optstr)
 Create an image from a stream in some specified format. More...
 
JAS_EXPORT 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. More...
 
JAS_EXPORT 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. More...
 
JAS_EXPORT 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. More...
 
JAS_EXPORT void jas_image_delcmpt (jas_image_t *image, unsigned cmptno)
 Delete a component from an image. More...
 
JAS_EXPORT int jas_image_addcmpt (jas_image_t *image, int cmptno, const jas_image_cmptparm_t *cmptparm)
 Add a component to an image. More...
 
JAS_EXPORT int jas_image_copycmpt (jas_image_t *dstimage, unsigned dstcmptno, jas_image_t *srcimage, unsigned srccmptno)
 Copy a component from one image to another. More...
 
JAS_EXPORT int jas_image_depalettize (jas_image_t *image, unsigned cmptno, unsigned numlutents, const int_fast32_t *lutents, unsigned dtype, unsigned newcmptno)
 Depalettize an image. More...
 
JAS_EXPORT int jas_image_readcmptsample (jas_image_t *image, unsigned cmptno, unsigned x, unsigned y)
 Read a component sample for an image. More...
 
JAS_EXPORT void jas_image_writecmptsample (jas_image_t *image, unsigned cmptno, unsigned x, unsigned y, int_fast32_t v)
 Write a component sample for an image. More...
 
JAS_ATTRIBUTE_PURE JAS_EXPORT int jas_image_getcmptbytype (const jas_image_t *image, jas_image_cmpttype_t ctype)
 Get an image component by its type. More...
 
JAS_EXPORT void jas_image_clearfmts (void)
 Clear the table of image formats. More...
 
const JAS_EXPORT jas_image_fmtinfo_tjas_image_getfmtbyind (int index)
 Get a image format entry by its table index. More...
 
JAS_EXPORT int jas_image_getnumfmts (void)
 Get the number of image format table entries. More...
 
JAS_EXPORT int jas_image_setfmtenable (int index, int enabled)
 Get the number of image format table entries. More...
 
JAS_EXPORT int jas_image_addfmt (int id, const char *name, const char *ext, const char *desc, const jas_image_fmtops_t *ops)
 Add entry to table of image formats. More...
 
JAS_ATTRIBUTE_PURE JAS_EXPORT int jas_image_strtofmt (const char *s)
 Get the ID for the image format with the specified name. More...
 
JAS_ATTRIBUTE_CONST const JAS_EXPORT char * jas_image_fmttostr (int fmt)
 Get the name of the image format with the specified ID. More...
 
JAS_ATTRIBUTE_CONST const JAS_EXPORT jas_image_fmtinfo_tjas_image_lookupfmtbyid (int id)
 Lookup image format information by the format ID. More...
 
JAS_ATTRIBUTE_PURE const JAS_EXPORT jas_image_fmtinfo_tjas_image_lookupfmtbyname (const char *name)
 Lookup image format information by the format name. More...
 
JAS_ATTRIBUTE_PURE JAS_EXPORT int jas_image_fmtfromname (const char *filename)
 Guess the format of an image file based on its name. More...
 
JAS_ATTRIBUTE_PURE JAS_EXPORT int jas_image_getfmt (jas_stream_t *in)
 Get the format of image data in a stream. More...
 
JAS_ATTRIBUTE_PURE JAS_EXPORT int jas_image_ishomosamp (const jas_image_t *image)
 Test if the sampling of the image is homogeneous. More...
 
JAS_EXPORT int jas_image_sampcmpt (jas_image_t *image, unsigned cmptno, unsigned newcmptno, jas_image_coord_t ho, jas_image_coord_t vo, jas_image_coord_t hs, jas_image_coord_t vs, int sgnd, unsigned prec)
 ??? More...
 
JAS_EXPORT int jas_image_writecmpt2 (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 long *buf)
 Write sample data in a component of an image. More...
 
JAS_EXPORT int jas_image_readcmpt2 (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, long *buf)
 Read sample data in a component of an image. More...
 
JAS_EXPORT jas_image_tjas_image_chclrspc (jas_image_t *image, const jas_cmprof_t *outprof, jas_cmxform_intent_t intent)
 Change the color space for an image. More...
 
JAS_EXPORT int jas_image_dump (jas_image_t *image, FILE *out)
 Dump the information for an image (for debugging). More...
 

Detailed Description

Image Representation.

General information can be found here.

Macro Definition Documentation

◆ jas_image_brx

#define jas_image_brx (   image)    ((image)->brx_)

Get the x-coordinate of the bottom-right corner of the image bounding box on the reference grid (plus one).

◆ jas_image_bry

#define jas_image_bry (   image)    ((image)->bry_)

Get the y-coordinate of the bottom-right corner of the image bounding box on the reference grid (plus one).

◆ jas_image_clrspc

#define jas_image_clrspc (   image)    ((image)->clrspc_)

Get the color model used by the image.

◆ jas_image_cmprof

#define jas_image_cmprof (   image)    ((image)->cmprof_)

Get the color management profile of an image.

◆ jas_image_cmptbrx

#define jas_image_cmptbrx (   image,
  cmptno 
)
Value:
((image)->cmpts_[cmptno]->tlx_ + (image)->cmpts_[cmptno]->width_ * \
(image)->cmpts_[cmptno]->hstep_)

Get the x-coordinate of the bottom-right corner of a component (plus "one").

◆ jas_image_cmptbry

#define jas_image_cmptbry (   image,
  cmptno 
)
Value:
((image)->cmpts_[cmptno]->tly_ + (image)->cmpts_[cmptno]->height_ * \
(image)->cmpts_[cmptno]->vstep_)

Get the y-coordinate of the bottom-right corner of a component (plus "one").

◆ jas_image_cmptheight

#define jas_image_cmptheight (   image,
  cmptno 
)    ((image)->cmpts_[cmptno]->height_)

Get the height of a component.

◆ jas_image_cmpthstep

#define jas_image_cmpthstep (   image,
  cmptno 
)    ((image)->cmpts_[cmptno]->hstep_)

Get the horizontal subsampling factor for a component.

◆ jas_image_cmptprec

#define jas_image_cmptprec (   image,
  cmptno 
)    ((image)->cmpts_[cmptno]->prec_)

Get the precision of the sample data for a component.

◆ jas_image_cmptsgnd

#define jas_image_cmptsgnd (   image,
  cmptno 
)    ((image)->cmpts_[cmptno]->sgnd_)

Get the signedness of the sample data for a component.

◆ jas_image_cmpttlx

#define jas_image_cmpttlx (   image,
  cmptno 
)    ((image)->cmpts_[cmptno]->tlx_)

Get the x-coordinate of the top-left corner of a component.

◆ jas_image_cmpttly

#define jas_image_cmpttly (   image,
  cmptno 
)    ((image)->cmpts_[cmptno]->tly_)

Get the y-coordinate of the top-left corner of a component.

◆ jas_image_cmptvstep

#define jas_image_cmptvstep (   image,
  cmptno 
)    ((image)->cmpts_[cmptno]->vstep_)

Get the vertical subsampling factor for a component.

◆ jas_image_cmptwidth

#define jas_image_cmptwidth (   image,
  cmptno 
)    ((image)->cmpts_[cmptno]->width_)

Get the width of a component.

◆ jas_image_height

#define jas_image_height (   image)    ((image)->bry_ - (image)->tly_)

Get the height of the image in units of the image reference grid.

◆ JAS_IMAGE_MAXFMTS

#define JAS_IMAGE_MAXFMTS   32

The maximum number of image data formats supported.

◆ jas_image_numcmpts

#define jas_image_numcmpts (   image)    ((image)->numcmpts_)

Get the number of image components.

◆ jas_image_setclrspc

#define jas_image_setclrspc (   image,
  clrspc 
)    ((image)->clrspc_ = (clrspc))

Set the color model for an image.

◆ jas_image_setcmprof

#define jas_image_setcmprof (   image,
  cmprof 
)    ((image)->cmprof_ = cmprof)

Set the color management profile for an image.

◆ jas_image_tlx

#define jas_image_tlx (   image)    ((image)->tlx_)

Get the x-coordinate of the top-left corner of the image bounding box on the reference grid.

◆ jas_image_tly

#define jas_image_tly (   image)    ((image)->tly_)

Get the y-coordinate of the top-left corner of the image bounding box on the reference grid.

◆ jas_image_width

#define jas_image_width (   image)    ((image)->brx_ - (image)->tlx_)

Get the width of the image in units of the image reference grid.

Typedef Documentation

◆ jas_image_cmpttype_t

typedef int_fast32_t jas_image_cmpttype_t

Component type (e.g., color, opacity).

◆ jas_image_colorspc_t

typedef int_fast16_t jas_image_colorspc_t

Color space (e.g., RGB, YCbCr).

◆ jas_image_coord_t

typedef int_fast32_t jas_image_coord_t

Image coordinate.

◆ jas_image_smpltype_t

typedef int_fast16_t jas_image_smpltype_t

Component sample data format (e.g., real/integer, signedness, precision).

Function Documentation

◆ jas_image_addcmpt()

JAS_EXPORT int jas_image_addcmpt ( jas_image_t image,
int  cmptno,
const jas_image_cmptparm_t cmptparm 
)

Add a component to an image.

◆ jas_image_addfmt()

JAS_EXPORT int jas_image_addfmt ( int  id,
const char *  name,
const char *  ext,
const char *  desc,
const jas_image_fmtops_t ops 
)

Add entry to table of image formats.

◆ jas_image_chclrspc()

JAS_EXPORT jas_image_t* jas_image_chclrspc ( jas_image_t image,
const jas_cmprof_t outprof,
jas_cmxform_intent_t  intent 
)

Change the color space for an image.

◆ jas_image_clearfmts()

JAS_EXPORT void jas_image_clearfmts ( void  )

Clear the table of image formats.

◆ jas_image_cmpt_domains_same()

JAS_ATTRIBUTE_PURE JAS_EXPORT bool jas_image_cmpt_domains_same ( const jas_image_t image)

Test if all components are specified at the same positions in space.

◆ jas_image_copy()

JAS_EXPORT jas_image_t* jas_image_copy ( jas_image_t image)

Clone an image.

◆ jas_image_copycmpt()

JAS_EXPORT int jas_image_copycmpt ( jas_image_t dstimage,
unsigned  dstcmptno,
jas_image_t srcimage,
unsigned  srccmptno 
)

Copy a component from one image to another.

◆ jas_image_create()

JAS_EXPORT jas_image_t* jas_image_create ( unsigned  numcmpts,
const jas_image_cmptparm_t cmptparms,
jas_clrspc_t  clrspc 
)

Create an image.

◆ jas_image_create0()

JAS_EXPORT jas_image_t* jas_image_create0 ( void  )

Create an "empty" image.

◆ jas_image_decode()

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

◆ jas_image_delcmpt()

JAS_EXPORT void jas_image_delcmpt ( jas_image_t image,
unsigned  cmptno 
)

Delete a component from an image.

◆ jas_image_depalettize()

JAS_EXPORT int jas_image_depalettize ( jas_image_t image,
unsigned  cmptno,
unsigned  numlutents,
const int_fast32_t *  lutents,
unsigned  dtype,
unsigned  newcmptno 
)

Depalettize an image.

◆ jas_image_destroy()

JAS_EXPORT void jas_image_destroy ( jas_image_t image)

Deallocate any resources associated with an image.

◆ jas_image_dump()

JAS_EXPORT int jas_image_dump ( jas_image_t image,
FILE *  out 
)

Dump the information for an image (for debugging).

◆ jas_image_encode()

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

◆ jas_image_fmtfromname()

JAS_ATTRIBUTE_PURE JAS_EXPORT int jas_image_fmtfromname ( const char *  filename)

Guess the format of an image file based on its name.

◆ jas_image_fmttostr()

JAS_ATTRIBUTE_CONST const JAS_EXPORT char* jas_image_fmttostr ( int  fmt)

Get the name of the image format with the specified ID.

◆ jas_image_getcmptbytype()

JAS_ATTRIBUTE_PURE JAS_EXPORT int jas_image_getcmptbytype ( const jas_image_t image,
jas_image_cmpttype_t  ctype 
)

Get an image component by its type.

◆ jas_image_getfmt()

JAS_ATTRIBUTE_PURE JAS_EXPORT int jas_image_getfmt ( jas_stream_t in)

Get the format of image data in a stream.

Note that only enabled codecs are used in determining the image format.

◆ jas_image_getfmtbyind()

const JAS_EXPORT jas_image_fmtinfo_t* jas_image_getfmtbyind ( int  index)

Get a image format entry by its table index.

◆ jas_image_getnumfmts()

JAS_EXPORT int jas_image_getnumfmts ( void  )

Get the number of image format table entries.

◆ jas_image_ishomosamp()

JAS_ATTRIBUTE_PURE JAS_EXPORT int jas_image_ishomosamp ( const jas_image_t image)

Test if the sampling of the image is homogeneous.

◆ jas_image_lookupfmtbyid()

JAS_ATTRIBUTE_CONST const JAS_EXPORT jas_image_fmtinfo_t* jas_image_lookupfmtbyid ( int  id)

Lookup image format information by the format ID.

◆ jas_image_lookupfmtbyname()

JAS_ATTRIBUTE_PURE const JAS_EXPORT jas_image_fmtinfo_t* jas_image_lookupfmtbyname ( const char *  name)

Lookup image format information by the format name.

◆ jas_image_rawsize()

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

◆ jas_image_readcmpt()

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

The position and size of the rectangular region to be read is specified relative to the component's coordinate system.

◆ jas_image_readcmpt2()

JAS_EXPORT int jas_image_readcmpt2 ( 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,
long *  buf 
)

Read sample data in a component of an image.

◆ jas_image_readcmptsample()

JAS_EXPORT int jas_image_readcmptsample ( jas_image_t image,
unsigned  cmptno,
unsigned  x,
unsigned  y 
)

Read a component sample for an image.

◆ jas_image_sampcmpt()

JAS_EXPORT int jas_image_sampcmpt ( jas_image_t image,
unsigned  cmptno,
unsigned  newcmptno,
jas_image_coord_t  ho,
jas_image_coord_t  vo,
jas_image_coord_t  hs,
jas_image_coord_t  vs,
int  sgnd,
unsigned  prec 
)

???

◆ jas_image_setfmtenable()

JAS_EXPORT int jas_image_setfmtenable ( int  index,
int  enabled 
)

Get the number of image format table entries.

Warning
This function may be removed in future versions of the library. Do not rely on it.

◆ jas_image_strtofmt()

JAS_ATTRIBUTE_PURE JAS_EXPORT int jas_image_strtofmt ( const char *  s)

Get the ID for the image format with the specified name.

◆ jas_image_writecmpt()

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

◆ jas_image_writecmpt2()

JAS_EXPORT int jas_image_writecmpt2 ( 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 long *  buf 
)

Write sample data in a component of an image.

◆ jas_image_writecmptsample()

JAS_EXPORT void jas_image_writecmptsample ( jas_image_t image,
unsigned  cmptno,
unsigned  x,
unsigned  y,
int_fast32_t  v 
)

Write a component sample for an image.