CkImage Class Reference

This class describes an image, represented as a flat byte array. More...

#include <ckimage.h>

Inheritance diagram for CkImage:

Inheritance graph
[legend]
Collaboration diagram for CkImage:

Collaboration graph
[legend]

Public Types

enum  { channel_max = 255 }
 This is the maximum value of a color channel. More...
enum  layout_t { layout_default = 0, layout_reversed = 1 }
 This describes the various data layouts used by image pixels:. More...
typedef unsigned char channel_t

Public Member Functions

 CkImage ()
 CkImage (int w_, int h_, int colors_, channel_t *data_)
channel_tgetData (void)
 Get/set the whole image's data.
void setData (channel_t *d)
CkRect getRect (void) const
int getRow (void) const
 Return the number of channel_t's per row of the image.
int getColors (void) const
 Return the number of colors (channel_t's) per pixel.
layout_t getLayout (void) const
 Get/set the pixel format.
void setLayout (layout_t a)
int getWidth (void) const
 Return the number of pixels per row of the image.
int getHeight (void) const
 Return the number of pixels per column of the image.
void copyPixel (const channel_t *src, channel_t *dest)
void setPixel (const channel_t src, channel_t *dest)
void addPixel (const channel_t *src, channel_t *dest)
void addPixelClip (const channel_t *src, channel_t *dest, const channel_t *clip)
channel_tgetPixel (int x, int y)
const channel_tgetPixel (int x, int y) const
void window (const CkRect &src)
void clear (void)
void put (int sx, int sy, const CkImage &src)
void add (int sx, int sy, const CkImage &src)
void addClip (int sx, int sy, const CkImage &src, const channel_t *clip)
void pup (PUP::er &p)

Static Public Member Functions

static channel_tnewClip (void)

Private Member Functions

 CkImage (const CkImage &im)
 DO NOT USE.
void operator= (const CkImage &im)

Private Attributes

int row
int colors
 channel_ts per line, channel_ts per pixel
int layout
 Image pixel format.
int wid
int ht
 Image size: cols and rows.
channel_tdata
 Image pixel data.

Detailed Description

This class describes an image, represented as a flat byte array.

Pixels are stored first by color (e.g., r,g,b), then by row in the usual raster order.

Definition at line 71 of file ckimage.h.


Member Typedef Documentation

typedef unsigned char CkImage::channel_t

Definition at line 74 of file ckimage.h.


Member Enumeration Documentation

anonymous enum

This is the maximum value of a color channel.

Enumerator:
channel_max 

Definition at line 76 of file ckimage.h.

enum CkImage::layout_t

This describes the various data layouts used by image pixels:.

Enumerator:
layout_default  The default layout: ARGB.

With one color, pure luminance. With 3 colors, [0]=R, [1]=G, [2]=B. With 4 colors, [0]=A, [1]=R, [2]=G, [3]=B.

layout_reversed  The "reversed" layout: BGRA.

With one color, pure luminance. With 3 colors, [0]=B, [1]=G, [2]=R. With 4 colors, [0]=B, [1]=G, [2]=R, [3]=A.

Definition at line 79 of file ckimage.h.


Constructor & Destructor Documentation

CkImage::CkImage ( const CkImage im  )  [private]

DO NOT USE.

CkImage::CkImage (  )  [inline]

Definition at line 104 of file ckimage.h.

References colors, data, ht, layout_default, row, setLayout(), and wid.

CkImage::CkImage ( int  w_,
int  h_,
int  colors_,
channel_t data_ 
) [inline]

Definition at line 105 of file ckimage.h.

References layout_default, and setLayout().


Member Function Documentation

void CkImage::operator= ( const CkImage im  )  [private]

channel_t* CkImage::getData ( void   )  [inline]

Get/set the whole image's data.

Definition at line 110 of file ckimage.h.

References data.

Referenced by CkAllocImage::CkAllocImage().

void CkImage::setData ( channel_t d  )  [inline]

Definition at line 111 of file ckimage.h.

References data.

Referenced by CkAllocImage::allocate(), and CkAllocImage::deallocate().

CkRect CkImage::getRect ( void   )  const [inline]

Definition at line 113 of file ckimage.h.

References ht, and wid.

Referenced by CkAllocImage::allocate(), and CkAllocImage::pup().

int CkImage::getRow ( void   )  const [inline]

Return the number of channel_t's per row of the image.

Definition at line 115 of file ckimage.h.

References row.

int CkImage::getColors ( void   )  const [inline]

Return the number of colors (channel_t's) per pixel.

Definition at line 117 of file ckimage.h.

References colors.

Referenced by CkAllocImage::allocate(), and CkAllocImage::pup().

layout_t CkImage::getLayout ( void   )  const [inline]

Get/set the pixel format.

Definition at line 120 of file ckimage.h.

References layout.

Referenced by impl_LV3D_Array::LV3D_FlatRender().

void CkImage::setLayout ( layout_t  a  )  [inline]

Definition at line 121 of file ckimage.h.

References layout.

Referenced by CkImage().

int CkImage::getWidth ( void   )  const [inline]

Return the number of pixels per row of the image.

Definition at line 124 of file ckimage.h.

References wid.

Referenced by impl_LV3D_Array::LV3D_FlatRender().

int CkImage::getHeight ( void   )  const [inline]

Return the number of pixels per column of the image.

Definition at line 126 of file ckimage.h.

References ht.

Referenced by impl_LV3D_Array::LV3D_FlatRender().

void CkImage::copyPixel ( const channel_t src,
channel_t dest 
) [inline]

Definition at line 129 of file ckimage.h.

References colors.

Referenced by put().

void CkImage::setPixel ( const channel_t  src,
channel_t dest 
) [inline]

Definition at line 134 of file ckimage.h.

References colors.

void CkImage::addPixel ( const channel_t src,
channel_t dest 
) [inline]

Definition at line 139 of file ckimage.h.

References colors.

Referenced by add().

void CkImage::addPixelClip ( const channel_t src,
channel_t dest,
const channel_t clip 
) [inline]

Definition at line 144 of file ckimage.h.

References colors.

Referenced by addClip().

channel_t* CkImage::getPixel ( int  x,
int  y 
) [inline]

Definition at line 153 of file ckimage.h.

References colors, data, and row.

Referenced by add(), addClip(), impl_LV3D_Array::LV3D_FlatRender(), and put().

const channel_t* CkImage::getPixel ( int  x,
int  y 
) const [inline]

Definition at line 154 of file ckimage.h.

References colors, data, and row.

void CkImage::window ( const CkRect src  )  [inline]

Definition at line 160 of file ckimage.h.

References colors, data, CkRect::ht(), ht, CkRect::l, row, CkRect::t, CkRect::wid(), and wid.

void CkImage::clear ( void   ) 

Definition at line 14 of file ckimage.C.

References colors, data, ht, row, and wid.

void CkImage::put ( int  sx,
int  sy,
const CkImage src 
)

Definition at line 22 of file ckimage.C.

References copyPixel(), getPixel(), ht, and wid.

void CkImage::add ( int  sx,
int  sy,
const CkImage src 
)

Definition at line 31 of file ckimage.C.

References addPixel(), getPixel(), ht, and wid.

void CkImage::addClip ( int  sx,
int  sy,
const CkImage src,
const channel_t clip 
)

Definition at line 41 of file ckimage.C.

References addPixelClip(), getPixel(), ht, and wid.

CkImage::channel_t * CkImage::newClip ( void   )  [static]

Definition at line 53 of file ckimage.C.

References channel_max.

void CkImage::pup ( PUP::er p  )  [inline]

Reimplemented in CkAllocImage.

Definition at line 189 of file ckimage.h.

References colors, ht, layout, p, row, and wid.

Referenced by CkAllocImage::pup().


Field Documentation

int CkImage::row [private]

Definition at line 96 of file ckimage.h.

Referenced by CkImage(), clear(), getPixel(), getRow(), pup(), and window().

int CkImage::colors [private]

channel_ts per line, channel_ts per pixel

Definition at line 96 of file ckimage.h.

Referenced by addPixel(), addPixelClip(), CkImage(), clear(), copyPixel(), getColors(), getPixel(), pup(), setPixel(), and window().

int CkImage::layout [private]

Image pixel format.

Definition at line 97 of file ckimage.h.

Referenced by getLayout(), pup(), and setLayout().

int CkImage::wid [private]

Definition at line 98 of file ckimage.h.

Referenced by add(), addClip(), CkImage(), clear(), getRect(), getWidth(), pup(), put(), and window().

int CkImage::ht [private]

Image size: cols and rows.

Definition at line 98 of file ckimage.h.

Referenced by add(), addClip(), CkImage(), clear(), getHeight(), getRect(), pup(), put(), and window().

channel_t* CkImage::data [private]

Image pixel data.

Definition at line 99 of file ckimage.h.

Referenced by CkImage(), clear(), getData(), getPixel(), setData(), and window().


The documentation for this class was generated from the following files:
Generated on Sun Jun 29 13:30:42 2008 for Charm++ by  doxygen 1.5.1