#include <gmlimage.h>
Inheritance diagram for Image:
Public Types | |
enum | FORMAT { F_L, F_RGB, F_RGBA, F_BGR } |
enum | REPRES { R_BYTE, R_WORD, R_DWORD, R_FLOAT, R_DOUBLE } |
enum | ORIENT { O_TOPLEFT, O_BOTTOMLEFT } |
line order in the image More... | |
Public Member Functions | |
Image () | |
virtual | ~Image () |
Empty destructor. | |
Image (Image &in_Image) | |
Image & | operator= (Image const &Orig) |
bool const | operator== (Image const &Other) |
virtual void | Create (int Width, int Height, FORMAT format, REPRES repres, ORIENT orient=O_BOTTOMLEFT) |
void | CreateCopy (const Image &rSrImage) |
Creates a copy of rSrImage, converting color depth if nessesary. | |
bool | CreateFromDIB (struct tagBITMAPINFO *in_pDIB, BYTE *in_pcData=NULL) |
Creates from a bitmap header. | |
void | CreateFilteredCopy (const Image &rSrImage, const ImageFilter &rFilter) |
void | CreateComposition (const std::vector< Image * > &src, const ImageComposer &comp) |
bool | Created () const |
void | Clear () |
void | ApplyFilter (const ImageFilter &filter) |
Applies a filter to the bitmap. | |
void | Decompose (const ImageDecomposer &decomposer, std::vector< Image * > &out_res) |
Applies a decompositor to the bitmap. | |
bool | ChangeOrientation (ORIENT new_orient) |
Change orientation of the image to new one. | |
bool | ChangeFormat (FORMAT new_format) |
Change image format. | |
bool | ChangeRepres (REPRES new_repres) |
Change image pixel representetion. | |
int | GetWidth () const |
int | GetHeight () const |
FORMAT | GetFormat () const |
REPRES | GetRepres () const |
ORIENT | GetOrient () const |
virtual long | GetMemUsed ()=0 |
int | GetElemSize () const |
virtual long | GetBytesPerLine () const =0 |
Returns number of bytes used per line. | |
BYTE ** | GetLineArray () const |
Returns pointer to an array containing the starting addresses of the bitmap lines. | |
virtual void | Lock (bool bReadable, bool bWriteable) |
virtual void | Unlock () |
Unlocks the Bitmap surface. | |
bool | IsLocked () const |
bool | AlmostEqual (const Image &Bmp, int epsilon) const |
void | PaintImage (CDC *in_pDC, CPoint dst_org, CSize dst_size, DWORD dwRop=SRCCOPY) |
virtual gml::DrawSurface * | GetDrawSurface ()=0 |
Static Public Member Functions | |
int | Format2Channels (FORMAT f) |
int | Repres2Size (REPRES r) |
int | ElemSize (FORMAT f, REPRES r) |
Protected Member Functions | |
virtual bool | InternalCreate (int Width, int Height, FORMAT format, REPRES repres, ORIENT orient=O_BOTTOMLEFT)=0 |
virtual void | FreeMembers ()=0 |
Delete memory allocated by member variables. | |
virtual void | InitLineArray ()=0 |
Initialize internal table of line addresses. | |
void | InternalCopy (const Image &rSrImage) |
void | InitLocals (int width, int height, FORMAT format, REPRES repres, ORIENT orient=O_BOTTOMLEFT) |
Can be called from internalCreate() to initialize object state. | |
virtual void | InternalChangeOrientation (ORIENT new_orient)=0 |
Protected Attributes | |
int | m_width |
int | m_height |
bool | m_created |
FORMAT | m_format |
REPRES | m_repres |
ORIENT | m_orient |
current orientation order | |
BYTE ** | m_line_array |
Table of the starting addresses of the lines. | |
int | m_lock_count |
Number of times the bitmap was locked. |
Some functionality should be defined in children
|
line order in the image
|
|
Empty constructor. Constructors in derived classes create a small empty bitmap to ensure that the object is always in a sane state. |
|
Test for equality. This function actually tests every pixel, so it's not fast. It's meant mainly for use in asserts and such. |
|
Creates a new empty bitmap. Memory for the bits is allocated but not initialized. Previous contents of the bitmap object are discarded |
|
Creates from a bitmap header.
|
|
Creates a copy of rSrImage, applying rFilter on the way. Depending on the filter called, this is often much faster than CreateCopy() followed by ApplyFilter(). |
|
Change orientation of the image to new one.
|
|
Change image format.
|
|
Change image pixel representetion.
|
|
Locks bitmap. GetLineArray() and other direct-access methods should only be called if the bitmap is locked. Lock and Unlock keep a lock count. |
|
Create a new bitmap with uninitialized bits. (Assume no memory is allocated yet.) Implemented in GDIImage, IntelImage, and SimpleImage. |
|
Creates a new Image as copy of rSrImage. Assumes there is no memory allocated yet. |
|
Change image orientation to given state
Implemented in GDIImage, IntelImage, and SimpleImage. |
|
Number of times the bitmap was locked. Default is m_LockCount always >= 1, so access to bits is always possible. |