|
#include <CATImage.h>
All images are 32-bit R,G,B,A. This interface provides the basics needed for working with the images.
Note: Alpha channels are stored where 255 means opaque, and 0 is totally translucent. Make sure to set this when loading / building images.
Definition at line 33 of file CATImage.h.
Public Types | |
| enum | CATIMAGEFORMAT { CATIMAGE_PNG_RGBA32 } |
Public Member Functions | |
| CATResult | CopyOver (const CATImage *srcImg, CATInt32 dstOffsetX, CATInt32 dstOffsetY, CATInt32 srcOffsetX, CATInt32 srcOffsetY, CATInt32 width=0, CATInt32 height=0) |
| CATResult | CopyOutBGR (CATUInt8 *rgbBuf, CATInt32 offsetX, CATInt32 offsetY, CATInt32 width, CATInt32 height, CATInt32 widthBytes) |
| CATResult | Overlay (const CATImage *srcImg, CATInt32 dstOffsetX, CATInt32 dstOffsetY, CATInt32 srcOffsetX, CATInt32 srcOffsetY, CATInt32 width=0, CATInt32 height=0) |
| CATResult | GetPixel (CATInt32 x, CATInt32 y, unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a) const |
| CATResult | GetPixel (CATInt32 x, CATInt32 y, CATColor &color) const |
| CATResult | SetPixel (CATInt32 x, CATInt32 y, unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) |
| CATResult | SetPixel (CATInt32 x, CATInt32 y, const CATColor &color) |
| CATResult | Clear (bool transparent=true) |
| CATResult | FillRect (const CATRect &rect, const CATColor &color) |
| CATResult | SetSubPosition (CATInt32 newXOffset, CATInt32 newYOffset, CATInt32 newWidth, CATInt32 newHeight) |
| unsigned char * | GetRawDataPtr () const |
| CATInt32 | XOffsetRel () const |
| CATInt32 | YOffsetRel () const |
| CATInt32 | XOffsetAbs () const |
| CATInt32 | YOffsetAbs () const |
| CATInt32 | AbsWidth () const |
| CATInt32 | AbsHeight () const |
| CATInt32 | Width () const |
| CATInt32 | Height () const |
| CATInt32 | Size () const |
| CATInt32 | AbsSize () const |
| bool | IsImageRoot () const |
| unsigned long | AddRef () |
| unsigned long | DecRef () |
| unsigned long | GetRefCount () |
| CATResult | DbgSave (const CATWChar *filename) |
Static Public Member Functions | |
| static CATResult | Load (CATStream *stream, CATImage *&image) |
| static CATResult | Save (CATStream *stream, CATImage *image, CATIMAGEFORMAT imageFormat=CATIMAGE_PNG_RGBA32) |
| static CATResult | Save (const CATWChar *filename, CATImage *image) |
| static CATResult | CreateImage (CATImage *&image, CATInt32 width, CATInt32 height, bool init=true, bool transparent=true) |
| static CATResult | CreateImageFromDIB (CATImage *&image, HBITMAP dibSection) |
| static CATResult | ReleaseImage (CATImage *&image) |
| static CATResult | CreateSub (const CATImage *orgImg, CATImage *&dstImg, CATInt32 xOffset, CATInt32 yOffset, CATInt32 width, CATInt32 height) |
| static CATResult | CopyImage (const CATImage *srcImg, CATImage *&dstImg) |
| static CATResult | CopyImage (const CATImage *srcImg, CATImage *&dstImg, CATInt32 xOffset, CATInt32 yOffset, CATInt32 width, CATInt32 height) |
Protected Member Functions | |
| CATImage () | |
| virtual | ~CATImage () |
| Destructor for CATImage - use CATImage::ReleaseImage(). | |
| CATImage & | operator= (const CATImage &img) |
| CATResult | Create (CATInt32 width, CATInt32 height, bool init, bool transparent) |
Static Protected Member Functions | |
| static void | PNGRead (png_structp png_ptr, png_bytep data, png_size_t length) |
| static void | PNGWrite (png_structp png_ptr, png_bytep data, png_size_t length) |
| static void | PNGFlush (png_structp png_ptr) |
| static void | PNGError (png_structp png_ptr, png_const_charp error_msg) |
| static void | PNGWarning (png_structp png_ptr, png_const_charp warning_msg) |
Private Attributes | |
| CATInt32 | fWidth |
| Width in pixels. | |
| CATInt32 | fHeight |
| Height in pixels. | |
| CATUInt8 * | fData |
| CATInt32 | fXOffset |
| CATInt32 | fYOffset |
| bool | fOwnData |
| CATUInt32 | fRefCount |
| Ref count - inc for each sub image. | |
| CATImage * | fParentImage |
1.5.4