#include <Images.h>
Inheritance diagram for TGraphicSurface:
Public Member Functions | |
TGraphicSurface (void) | |
Constructor. | |
~TGraphicSurface (void) | |
Destructor. | |
TGraphicSurface (const TGraphicSurface &orig) | |
fake copy constructor | |
void | operator= (const TGraphicSurface &orig) |
fake assignment operator | |
BOOL | Create (DWORD width, DWORD height, EnumGraphicFormat format) |
Creates new image. | |
BOOL | Create (const TSurfaceDesc &desc) |
Creates surface. | |
void | Unload (void) |
Unload image. | |
void | Clone (TGraphicSurface **dest) const |
Copy this image to new one. | |
void | Set (const TGraphicSurface &orig) |
Set(copy) image in parameter to this image. | |
BOOL | IsLoaded (void) const |
Determines whether any image is loaded inside object. | |
BOOL | IsCompressed (void) const |
Determines whether image has compressed device format (e.g. | |
BOOL | IsRGB (void) const |
Determines whether image has RGB-type device format (e.g. | |
TSurfaceDesc | GetSurfDesc (void) const |
Return surface description. | |
DWORD | GetWidth (void) const |
Returns width of image in pixels. | |
DWORD | GetHeight (void) const |
Returns height of image in pixels. | |
EnumGraphicFormat | GetPixelFormat (void) const |
Returns pixel format of image. | |
DWORD | GetPixelSize (void) const |
Returns size of one pixel in bytes. | |
DWORD | GetSize (void) const |
Returns image size in bytes (size of image data - see GetImageData() method). | |
DWORD | GetRowSize (void) const |
Returns size of one row in bytes (also known as pitch). | |
const TBuffer * | GetImageData (void) const |
Returns pointer to image data. | |
TBuffer * | GetImageData (void) |
Returns pointer to image data. | |
BOOL | SetImageData (const TBuffer &data) |
Sets data to image (data are copied). |
This is software equivalent for TRendererSurface.
Image must be loaded before you use it - see TGraphicSurface::IsLoaded() method. You may load image only by creating it. (Or load it from file if TGraphicSurface is part of TGraphicTexture object)
Actually it supports only these formats: GRAPH_FMT_X8R8G8B8 GRAPH_FMT_A8R8G8B8 GRAPH_FMT_L8 GRAPH_FMT_A8 GRAPH_FMT_R5G6B5 GRAPH_FMT_X1R5G5B5
GRAPH_FMT_DXT1 GRAPH_FMT_DXT2 GRAPH_FMT_DXT3 GRAPH_FMT_DXT4 GRAPH_FMT_DXT5
Definition at line 49 of file Images.h.
|
Constructor. Creates empty (unloaded) image - see IsLoaded() method. Before using you must create surface with method Create !!!. Definition at line 24 of file Images.cpp. References FALSE, GRAPH_FMT_UNKNOWN, TSurfaceDesc::m_height, TSurfaceDesc::m_pixelFormat, and TSurfaceDesc::m_width. |
|
Destructor. Destroy image. Definition at line 42 of file Images.cpp. References Unload(). Here is the call graph for this function: ![]() |
|
fake copy constructor
|
|
Copy this image to new one. Before calling memory allocated via pointer should be deallocated, because this method sets to pointer new memory adress!!!
Definition at line 230 of file Images.cpp. References DBGASSERT, and Set(). Here is the call graph for this function: ![]() |
|
Creates surface.
Definition at line 78 of file Images.h. References Create(), TSurfaceDesc::m_height, TSurfaceDesc::m_pixelFormat, and TSurfaceDesc::m_width. Here is the call graph for this function: ![]() |
|
Creates new image.
Old image is always destroyed. This method can enlarge surface size for compressed formats if size is smaller than block size. For example for 2x2 DXT1 format method creates 4x4 DXT1 surface. But always original size is stored!!!!
Definition at line 64 of file Images.cpp. References DBGTEXTF, FALSE, GRAPH_FMT_A8, GRAPH_FMT_A8R8G8B8, GRAPH_FMT_DXT1, GRAPH_FMT_DXT2, GRAPH_FMT_DXT3, GRAPH_FMT_DXT4, GRAPH_FMT_DXT5, GRAPH_FMT_L8, GRAPH_FMT_R5G6B5, GRAPH_FMT_X1R5G5B5, GRAPH_FMT_X8R8G8B8, TSurfaceDesc::m_height, TSurfaceDesc::m_pixelFormat, TSurfaceDesc::m_width, TRUE, and Unload(). Referenced by Create(), and TGraphicTexture::Create(). Here is the call graph for this function: ![]() |
|
Returns height of image in pixels.
Definition at line 105 of file Images.h. References TSurfaceDesc::m_height. |
|
Returns pointer to image data. For getting size of this data call GetSize(void). If image contains no data NULL is returned, also GetSize() returns 0. |
|
Returns pointer to image data. For getting size of this data call GetSize(void). If image contains no data NULL is returned, also GetSize() returns 0. |
|
Returns pixel format of image.
Definition at line 109 of file Images.h. References TSurfaceDesc::m_pixelFormat. |
|
Returns size of one pixel in bytes. For compressed formats returns size of one block or format-specified value. |
|
Returns size of one row in bytes (also known as pitch). This is important only for RGB-type images. (See IsRGB(void)). For compressed images pitch is also valid, but has different mean!!! For DXTn formats pitch value is defined as size of 4 rows of surface in bytes, thus in DXTn formats are no additional bits (data are stored continuously) |
|
Returns image size in bytes (size of image data - see GetImageData() method).
|
|
Return surface description.
|
|
Returns width of image in pixels.
Definition at line 101 of file Images.h. References TSurfaceDesc::m_width. |
|
Determines whether image has compressed device format (e.g. DXTn) |
|
Determines whether any image is loaded inside object.
Definition at line 85 of file Images.h. Referenced by Set(). |
|
Determines whether image has RGB-type device format (e.g. X8R8G8B8) |
|
fake assignment operator
|
|
Set(copy) image in parameter to this image.
Definition at line 243 of file Images.cpp. References IsLoaded(), and Unload(). Referenced by Clone(). Here is the call graph for this function: ![]() |
|
Sets data to image (data are copied). Data in buffer must have the same size as data in image.
Definition at line 270 of file Images.cpp. References DBGTEXTF, FALSE, and TBuffer::GetSize(). Here is the call graph for this function: ![]() |
|
Unload image.
Definition at line 207 of file Images.cpp. References FALSE, GRAPH_FMT_UNKNOWN, TSurfaceDesc::m_height, TSurfaceDesc::m_pixelFormat, and TSurfaceDesc::m_width. Referenced by Create(), Set(), and ~TGraphicSurface(). |