Main Page   Class Hierarchy   Compound List   File List   Compound Members  

GfxImage Class Reference

Class to hold an image. More...

#include <freecloth/gfx/gfxImage.h>

Inheritance diagram for GfxImage:

Inheritance graph
[legend]
Collaboration diagram for GfxImage:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::vector< UInt8 > RawData
typedef RCProxyShdPtr< RawData > RawDataPtr
enum  Format { GREY8, RGB24 }
enum  Component { RED = 0, GREEN = 1, BLUE = 2 }

Public Member Functions

 GfxImage (const RawDataPtr &dataPtr, UInt32 width, UInt32 height, Format format)
 GfxImage (UInt32 width, UInt32 height, Format format)
 GfxImage (const GfxImage &)
UInt32 getWidth () const
UInt32 getHeight () const
Float getAspectRatio () const
Format getFormat () const
UInt32 getBitsPerPixel () const
UInt32 getBytesPerPixel () const
UInt32 getBytesPerRow () const
UInt32 getNbComponents () const
UInt32 getBitsPerComponent () const
UInt8 * getRawData ()
const UInt8 * getRawData () const
UInt32 getRawSize () const
UInt8 getData (UInt32 x, UInt32 y, UInt32 component=0) const
UInt8 & getData (UInt32 x, UInt32 y, UInt32 component=0)
RCShdPtr< GfxImage > pad (UInt32 padX, UInt32 padY, UInt8 r, UInt8 g, UInt8 b) const
 Create a new image with padding around the borders.

RCShdPtr< GfxImage > pad (UInt32 padX, UInt32 padY, UInt8 value) const

Static Public Member Functions

UInt32 getBitsPerComponent (Format format)
UInt32 getNbComponents (Format format)

Private Member Functions

GfxImage & operator= (const GfxImage &)

Private Attributes

const RawDataPtr _dataPtr
UInt32 _width
UInt32 _height
Format _format

Detailed Description

Class to hold an image.

Image data is stored in row major format, starting with the top-left corner. Rows are not guaranteed to be aligned to 4-byte boundaries. Not very user-friendly yet, especially when dealing with 24-bit data.

Definition at line 55 of file gfxImage.h.


The documentation for this class was generated from the following files:
Generated on Wed Apr 23 15:58:58 2003 for Freecloth by doxygen1.3-rc3