DDraceNetwork Docs
image.h
Go to the documentation of this file.
1#ifndef ENGINE_IMAGE_H
2#define ENGINE_IMAGE_H
3
4#include <cstdint>
5
6#include <base/color.h>
7
12{
13public:
18 {
24 };
25
29 size_t m_Width = 0;
30
34 size_t m_Height = 0;
35
42
46 uint8_t *m_pData = nullptr;
47
51 void Free();
52
60 static size_t PixelSize(EImageFormat Format);
61
69 static const char *FormatName(EImageFormat Format);
70
78 size_t PixelSize() const;
79
85 const char *FormatName() const;
86
92 size_t DataSize() const;
93
102 bool DataEquals(const CImageInfo &Other) const;
103
112 ColorRGBA PixelColor(size_t x, size_t y) const;
113
121 void SetPixelColor(size_t x, size_t y, ColorRGBA Color) const;
122
134 void CopyRectFrom(const CImageInfo &SrcImage, size_t SrcX, size_t SrcY, size_t Width, size_t Height, size_t DestX, size_t DestY) const;
135};
136
137#endif
Definition: image.h:12
void Free()
Definition: image.cpp:5
size_t m_Height
Definition: image.h:34
EImageFormat m_Format
Definition: image.h:41
uint8_t * m_pData
Definition: image.h:46
void CopyRectFrom(const CImageInfo &SrcImage, size_t SrcX, size_t SrcY, size_t Width, size_t Height, size_t DestX, size_t DestY) const
Definition: image.cpp:110
bool DataEquals(const CImageInfo &Other) const
Definition: image.cpp:42
EImageFormat
Definition: image.h:18
@ FORMAT_R
Definition: image.h:22
@ FORMAT_RGB
Definition: image.h:20
@ FORMAT_RA
Definition: image.h:23
@ FORMAT_RGBA
Definition: image.h:21
@ FORMAT_UNDEFINED
Definition: image.h:19
size_t DataSize() const
Definition: image.cpp:37
const char * FormatName() const
Definition: image.cpp:32
size_t PixelSize() const
Definition: image.cpp:27
size_t m_Width
Definition: image.h:29
ColorRGBA PixelColor(size_t x, size_t y) const
Definition: image.cpp:53
void SetPixelColor(size_t x, size_t y, ColorRGBA Color) const
Definition: image.cpp:85
Definition: color.h:210