![]() |
DDraceNetwork Documentation
|
#include <image.h>
Public Types | |
| enum | EImageFormat { FORMAT_UNDEFINED = -1 , FORMAT_RGB = 0 , FORMAT_RGBA = 1 , FORMAT_R = 2 , FORMAT_RA = 3 } |
Public Member Functions | |
| CImageInfo ()=default | |
| CImageInfo & | operator= (CImageInfo &&Other) |
| CImageInfo (CImageInfo &&Other) | |
| void | Free () |
| size_t | PixelSize () const |
| const char * | FormatName () const |
| size_t | DataSize () const |
| bool | DataEquals (const CImageInfo &Other) const |
| ColorRGBA | PixelColor (size_t x, size_t y) const |
| void | SetPixelColor (size_t x, size_t y, ColorRGBA Color) const |
| void | CopyRectFrom (const CImageInfo &SrcImage, size_t SrcX, size_t SrcY, size_t Width, size_t Height, size_t DestX, size_t DestY) const |
| CImageInfo | DeepCopy () const |
Static Public Member Functions | |
| static size_t | PixelSize (EImageFormat Format) |
| static const char * | FormatName (EImageFormat Format) |
Public Attributes | |
| size_t | m_Width = 0 |
| size_t | m_Height = 0 |
| EImageFormat | m_Format = FORMAT_UNDEFINED |
| uint8_t * | m_pData = nullptr |
Represents an image that has been loaded into main memory.
|
default |
| CImageInfo::CImageInfo | ( | CImageInfo && | Other | ) |
Move constructor.
| void CImageInfo::CopyRectFrom | ( | const CImageInfo & | SrcImage, |
| size_t | SrcX, | ||
| size_t | SrcY, | ||
| size_t | Width, | ||
| size_t | Height, | ||
| size_t | DestX, | ||
| size_t | DestY | ||
| ) | const |
Copies a rectangle of image data from the given image to this image.
| SrcImage | The image to copy data from. |
| SrcX | The x-offset in the source image. |
| SrcY | The y-offset in the source image. |
| Width | The width of the rectangle to copy. |
| Height | The height of the rectangle to copy. |
| DestX | The x-offset in the destination image (this). |
| DestY | The y-offset in the destination image (this). |
| bool CImageInfo::DataEquals | ( | const CImageInfo & | Other | ) | const |
Returns whether this image is equal to the given image in width, height, format and data.
| Other | The image to compare with. |
true if the images are identical, false otherwise. | size_t CImageInfo::DataSize | ( | ) | const |
Returns the size of the data, as derived from the width, height and pixel size.
| CImageInfo CImageInfo::DeepCopy | ( | ) | const |
Creates a complete, independent copy of this image and its data.
Returns a readable name for the format of this image.
|
static |
Returns a readable name for the given image format.
| Format | Image format. |
| void CImageInfo::Free | ( | ) |
Frees the image data and clears all info.
| CImageInfo & CImageInfo::operator= | ( | CImageInfo && | Other | ) |
Move assignment.
Returns the color of the pixel at the specified position.
| x | The x-coordinate to read from. |
| y | The y-coordinate to read from. |
| size_t CImageInfo::PixelSize | ( | ) | const |
Returns the pixel size in bytes for the format of this image.
FORMAT_UNDEFINED.
|
static |
Returns the pixel size in bytes for the given image format.
| Format | Image format, must not be FORMAT_UNDEFINED. |
Sets the color of the pixel at the specified position.
| x | The x-coordinate to write to. |
| y | The y-coordinate to write to. |
| Color | The normalized RGBA color to write. |
| EImageFormat CImageInfo::m_Format = FORMAT_UNDEFINED |
Format of the image.
| size_t CImageInfo::m_Height = 0 |
Height of the image.
| size_t CImageInfo::m_Width = 0 |
Width of the image.