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
11
class
CImageInfo
12
{
13
public
:
17
enum
EImageFormat
18
{
19
FORMAT_UNDEFINED
= -1,
20
FORMAT_RGB
= 0,
21
FORMAT_RGBA
= 1,
22
FORMAT_R
= 2,
23
FORMAT_RA
= 3,
24
};
25
29
size_t
m_Width
= 0;
30
34
size_t
m_Height
= 0;
35
41
EImageFormat
m_Format
=
FORMAT_UNDEFINED
;
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
CImageInfo
Definition:
image.h:12
CImageInfo::Free
void Free()
Definition:
image.cpp:5
CImageInfo::m_Height
size_t m_Height
Definition:
image.h:34
CImageInfo::m_Format
EImageFormat m_Format
Definition:
image.h:41
CImageInfo::m_pData
uint8_t * m_pData
Definition:
image.h:46
CImageInfo::CopyRectFrom
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
CImageInfo::DataEquals
bool DataEquals(const CImageInfo &Other) const
Definition:
image.cpp:42
CImageInfo::EImageFormat
EImageFormat
Definition:
image.h:18
CImageInfo::FORMAT_R
@ FORMAT_R
Definition:
image.h:22
CImageInfo::FORMAT_RGB
@ FORMAT_RGB
Definition:
image.h:20
CImageInfo::FORMAT_RA
@ FORMAT_RA
Definition:
image.h:23
CImageInfo::FORMAT_RGBA
@ FORMAT_RGBA
Definition:
image.h:21
CImageInfo::FORMAT_UNDEFINED
@ FORMAT_UNDEFINED
Definition:
image.h:19
CImageInfo::DataSize
size_t DataSize() const
Definition:
image.cpp:37
CImageInfo::FormatName
const char * FormatName() const
Definition:
image.cpp:32
CImageInfo::PixelSize
size_t PixelSize() const
Definition:
image.cpp:27
CImageInfo::m_Width
size_t m_Width
Definition:
image.h:29
CImageInfo::PixelColor
ColorRGBA PixelColor(size_t x, size_t y) const
Definition:
image.cpp:53
CImageInfo::SetPixelColor
void SetPixelColor(size_t x, size_t y, ColorRGBA Color) const
Definition:
image.cpp:85
ColorRGBA
Definition:
color.h:210
color.h
src
engine
image.h
Generated by
1.9.4