resonance 1.0.1
Loading...
Searching...
No Matches
acanvas15.h
Go to the documentation of this file.
1#pragma once
2
3#include "rndartt/acanvas.h"
4
38class ACanvas15 : public ACanvas {
39public:
50 explicit ACanvas15(const ABitmap &bitmap);
51
62 void SetColor8(int nIndex);
63
71 void SetColor15(unsigned short nColor);
72
82 void SetColor24(const unsigned char *pRGB);
83
91 void SetColor32(unsigned int nColor);
92
102 void SetColorNative(unsigned int nColor);
103
116
124 unsigned short GetColor15();
125
136 void GetColor24(unsigned char *pRGB);
137
147 unsigned int GetColor32();
148
158 unsigned int GetColorNative();
159
171 void DrawPixel8U(int nX, int nY, int nIndex);
172
182 void DrawPixel24U(int nX, int nY, const unsigned char *pRGB);
183
193 void DrawPixel32U(int nX, int nY, unsigned int nColor);
194
204 void DrawPixelNativeU(int nX, int nY, unsigned int nColor);
205
215 int GetPixel8U(int nX, int nY);
216
226 void GetPixel24U(int nX, int nY, unsigned char *pRGB);
227
237 unsigned int GetPixel32U(int nX, int nY);
238
248 unsigned int GetPixelNativeU(int nX, int nY);
249
250protected:
251 // ACanvasLin15 stores and reads the pen colour in its own slots, so protected is the narrowest
252 // specifier the image supports, matching ACanvas32.
253 unsigned short mColor; // +0x24
254};
Description of a pixel rectangle, its layout, and its palette.
Definition abitmap.h:95
unsigned int GetColorNative()
Return the pen colour in the native width, which on this canvas is a 1555 halfword.
unsigned short mColor
Definition acanvas15.h:253
void SetColor15(unsigned short nColor)
Set the pen colour from a 1555 halfword, which on this canvas is stored verbatim.
int GetColor8()
Return the palette index nearest the pen colour.
void GetPixel24U(int nX, int nY, unsigned char *pRGB)
Read one point into three bytes in red, green, blue order, with no clip test.
void SetColor8(int nIndex)
Set the pen colour from a palette index.
void DrawPixel8U(int nX, int nY, int nIndex)
Store one palette index at one point, with no clip test.
void SetColor32(unsigned int nColor)
Set the pen colour from an 8888 word.
unsigned int GetPixelNativeU(int nX, int nY)
Read one point in the native width, with no clip test.
int GetPixel8U(int nX, int nY)
Read one point as a palette index, with no clip test.
unsigned short GetColor15()
Return the pen colour, which on this canvas is already 1555.
void SetColor24(const unsigned char *pRGB)
Set the pen colour from three bytes in red, green, blue order, with the alpha bit set.
void GetColor24(unsigned char *pRGB)
Store the pen colour as three bytes in red, green, blue order.
void SetColorNative(unsigned int nColor)
Set the pen colour from a native value, which on this canvas is a 1555 halfword.
unsigned int GetColor32()
Return the pen colour as an 8888 word.
void DrawPixel24U(int nX, int nY, const unsigned char *pRGB)
Store one red, green, blue triple at one point, with no clip test.
void DrawPixel32U(int nX, int nY, unsigned int nColor)
Store one 8888 colour at one point, with no clip test.
void DrawPixelNativeU(int nX, int nY, unsigned int nColor)
Store one native value at one point, with no clip test.
ACanvas15(const ABitmap &bitmap)
Adopt a pixel description.
unsigned int GetPixel32U(int nX, int nY)
Read one point as an 8888 colour, with no clip test.
ACanvas(const ABitmap &bitmap)
Adopt a pixel description.