resonance 1.0.1
Loading...
Searching...
No Matches
acanvas.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "rndartt/abitmap.h"
6#include "rndartt/arect.h"
8
9class APalette;
10struct AFont;
11struct APoint;
12class APolygon;
13struct Color;
14
16constexpr int kACanvasFractionBits = 8;
17
30
74class ACanvas {
75public:
88
102 static unsigned char tempBuff[];
103
104 struct ARowInfo;
105 struct AScaledRowInfo;
106 struct Rle8Clip;
107
119 explicit ACanvas(const ABitmap &bitmap);
120
140 static ACanvas *NewCompatibleCanvas(const ABitmap &bitmap, bool bAllocatePixels);
141
154
172 static ACanvas *SubCanvas(const ABitmap &source, int nX, int nY, int nWidth, int nHeight);
173
193 void QuantizeToRamps(ACanvas &dest, const std::vector<const Color *> &colors) const;
194
209 void DrawBitmap(const ABitmap &source, int nX, int nY);
210
225 virtual ~ACanvas();
226
232 virtual void SetColor8(int nIndex) = 0;
233
239 virtual void SetColor15(unsigned short nColor) = 0;
240
248 virtual void SetColor24(const unsigned char *pRGB) = 0;
249
255 virtual void SetColor32(unsigned int nColor) = 0;
256
262 virtual void SetColorNative(unsigned int nColor) = 0;
263
269 virtual int GetColor8() = 0;
270
276 virtual unsigned short GetColor15() = 0;
277
283 virtual void GetColor24(unsigned char *pRGB) = 0;
284
290 virtual unsigned int GetColor32() = 0;
291
297 virtual unsigned int GetColorNative() = 0;
298
307 virtual void SetAlphaValues(unsigned int nColorKey) = 0;
308
315 virtual void DrawPixelU(int nX, int nY) = 0;
316
327 virtual void DrawPixel(int nX, int nY);
328
336 virtual void DrawPixel8U(int nX, int nY, int nIndex) = 0;
337
347 virtual void DrawPixel8(int nX, int nY, int nIndex);
348
356 virtual void DrawPixel15U(int nX, int nY, unsigned short nColor) = 0;
357
367 virtual void DrawPixel15(int nX, int nY, unsigned short nColor);
368
376 virtual void DrawPixel24U(int nX, int nY, const unsigned char *pRGB) = 0;
377
387 virtual void DrawPixel24(int nX, int nY, const unsigned char *pRGB);
388
396 virtual void DrawPixel32U(int nX, int nY, unsigned int nColor) = 0;
397
407 virtual void DrawPixel32(int nX, int nY, unsigned int nColor);
408
416 virtual void DrawPixelNativeU(int nX, int nY, unsigned int nColor) = 0;
417
427 virtual void DrawPixelNative(int nX, int nY, unsigned int nColor);
428
436 virtual int GetPixel8U(int nX, int nY) = 0;
437
447 virtual int GetPixel8(int nX, int nY);
448
456 virtual unsigned short GetPixel15U(int nX, int nY) = 0;
457
467 virtual unsigned short GetPixel15(int nX, int nY);
468
476 virtual void GetPixel24U(int nX, int nY, unsigned char *pRGB) = 0;
477
489 virtual void GetPixel24(int nX, int nY, unsigned char *pRGB);
490
502 virtual unsigned int GetPixel32U(int nX, int nY) = 0;
503
513 virtual unsigned int GetPixel32(int nX, int nY);
514
522 virtual unsigned int GetPixelNativeU(int nX, int nY) = 0;
523
533 virtual unsigned int GetPixelNative(int nX, int nY);
534
544 virtual void DrawHorzLineU(int nY, int nLeft, int nRight);
545
557 virtual void DrawHorzLine(int nY, int nLeft, int nRight);
558
568 virtual void DrawVertLineU(int nX, int nTop, int nBottom);
569
579 virtual void DrawVertLine(int nX, int nTop, int nBottom);
580
588 virtual void DrawRectU(ARect rect);
589
599 virtual void DrawRect(ARect rect);
600
608 virtual void DrawBoxU(ARect rect);
609
617 virtual void DrawBox(ARect rect);
618
627 virtual void DrawClutRectU(ARect rect, const unsigned char *pRemap);
628
642 virtual void DrawLineU(int nX0, int nY0, int nX1, int nY1);
643
657 virtual void DrawLine(int nX0, int nY0, int nX1, int nY1);
658
675 virtual void DrawTmapRow8U(int nY,
676 int nLeft,
677 int nRight,
678 const ABitmap *pSource,
679 APoint *pSourcePosition,
680 const APoint *pSourceStep);
681
698 virtual void DrawBitmapLin4U(const ABitmap &source, int nX, int nY);
699
709 virtual void DrawBitmapLin4(const ABitmap &source, int nX, int nY);
710
720 virtual void DrawBitmapLin8U(const ABitmap &source, int nX, int nY);
721
731 virtual void DrawBitmapLin8(const ABitmap &source, int nX, int nY);
732
742 virtual void DrawBitmapLin15U(const ABitmap &source, int nX, int nY);
743
753 virtual void DrawBitmapLin15(const ABitmap &source, int nX, int nY);
754
764 virtual void DrawBitmapLin24U(const ABitmap &source, int nX, int nY);
765
775 virtual void DrawBitmapLin24(const ABitmap &source, int nX, int nY);
776
786 virtual void DrawBitmapLin32U(const ABitmap &source, int nX, int nY);
787
797 virtual void DrawBitmapLin32(const ABitmap &source, int nX, int nY);
798
811 virtual void DrawBitmapRle8U(const ABitmap &source, int nX, int nY);
812
825 virtual void DrawBitmapRle8(const ABitmap &source, int nX, int nY);
826
836 virtual void GetBitmapLin4(const ABitmap &dest, int nX, int nY);
837
847 virtual void GetBitmapLin4U(const ABitmap &dest, int nX, int nY);
848
858 virtual void GetBitmapLin8(const ABitmap &dest, int nX, int nY);
859
869 virtual void GetBitmapLin8U(const ABitmap &dest, int nX, int nY);
870
880 virtual void GetBitmapLin15(const ABitmap &dest, int nX, int nY);
881
891 virtual void GetBitmapLin15U(const ABitmap &dest, int nX, int nY);
892
902 virtual void GetBitmapLin24(const ABitmap &dest, int nX, int nY);
903
913 virtual void GetBitmapLin24U(const ABitmap &dest, int nX, int nY);
914
924 virtual void GetBitmapLin32(const ABitmap &dest, int nX, int nY);
925
935 virtual void GetBitmapLin32U(const ABitmap &dest, int nX, int nY);
936
952 virtual void DrawCharU(int nCharCode, const AFont *pFont, int nX, int nY);
953
966 virtual void DrawChar(int nCharCode, const AFont *pFont, int nX, int nY);
967
981 virtual void DrawTextU(const char *pText, const AFont *pFont, int nX, int nY);
982
993 virtual void DrawText(const char *pText, const AFont *pFont, int nX, int nY);
994
1007 virtual void
1008 DrawClutBitmapLin4U(const ABitmap &source, int nX, int nY, const unsigned char *pRemap);
1009
1020 virtual void
1021 DrawClutBitmapLin8U(const ABitmap &source, int nX, int nY, const unsigned char *pRemap);
1022
1033 virtual void DrawClutBitmapRowLin8U(const ARowInfo &span, const unsigned char *pRemap);
1034
1045 virtual void DrawBlendBitmapLin4U(const ABitmap &source,
1046 int nX,
1047 int nY,
1048 const unsigned char *const *ppBlend);
1049
1060 virtual void DrawBlendBitmapLin8U(const ABitmap &source,
1061 int nX,
1062 int nY,
1063 const unsigned char *const *ppBlend);
1064
1077 virtual void DrawBlendBitmapRowLin8U(const ARowInfo &span, const unsigned char *const *ppBlend);
1078
1086 virtual void DrawScaledBitmapRowLin8U(const AScaledRowInfo &span);
1087
1096
1105
1114
1124 const unsigned char *pRemap);
1125
1136 const unsigned char *const *ppBlend);
1137
1140
1141protected:
1142 // Every member below is reached only from this class and its subclasses, so protected is the
1143 // narrowest specifier the image supports. No access from outside the hierarchy was located.
1144
1157 unsigned char ClipCode(int nX, int nY) const;
1158
1181 const ABitmap &source, int *pnX, int *pnY, ARle8Reader *pReader, Rle8Clip *pSpan) const;
1182
1202 int ClipLine(int *pnX0, int *pnY0, int *pnX1, int *pnY1) const;
1203
1222 int ClipBitmap(ABitmap *pBitmap, int *pnX, int *pnY) const;
1223
1234 int ClipRect(ARect *pRect) const;
1235
1247 void DrawClutRect(ARect rect, const unsigned char *pRemap);
1248
1261 void DrawBitmapU(const ABitmap &source, int nX, int nY);
1262
1275 void DrawClutBitmapLin4(const ABitmap &source, int nX, int nY, const unsigned char *pRemap);
1276
1289 void DrawClutBitmapLin8(const ABitmap &source, int nX, int nY, const unsigned char *pRemap);
1290
1303 void
1304 DrawBlendBitmapLin4(const ABitmap &source, int nX, int nY, const unsigned char *const *ppBlend);
1305
1318 void
1319 DrawBlendBitmapLin8(const ABitmap &source, int nX, int nY, const unsigned char *const *ppBlend);
1320
1336 void DrawFlatConvexPolygon(const APolygon &polygon);
1337
1353
1369 void DrawClutBitmapU(const ABitmap &source, int nX, int nY, const unsigned char *pRemap);
1370
1385 void DrawClutBitmap(const ABitmap &source, int nX, int nY, const unsigned char *pRemap);
1386
1405 void DrawClutBitmapRle8U(const ABitmap &source, int nX, int nY, const unsigned char *pRemap);
1406
1422 void DrawClutBitmapRle8(const ABitmap &source, int nX, int nY, const unsigned char *pRemap);
1423
1438 void
1439 DrawBlendBitmapU(const ABitmap &source, int nX, int nY, const unsigned char *const *ppBlend);
1440
1451 void
1452 DrawBlendBitmap(const ABitmap &source, int nX, int nY, const unsigned char *const *ppBlend);
1453
1468 void DrawBlendBitmapRle8U(const ABitmap &source,
1469 int nX,
1470 int nY,
1471 const unsigned char *const *ppBlend);
1472
1486 void
1487 DrawBlendBitmapRle8(const ABitmap &source, int nX, int nY, const unsigned char *const *ppBlend);
1488
1502 void GetBitmapU(const ABitmap &dest, int nX, int nY);
1503
1517 void GetBitmap(const ABitmap &dest, int nX, int nY);
1518
1531 void ReadRectRle8(const ABitmap &dest, int nX, int nY);
1532
1551 int
1552 ClipAndSetupScaledBitmap(const ABitmap &source, const ARect &rect, AScaledRowInfo *pBlit) const;
1553
1566 void DrawScaledBitmap(const ABitmap &source, const ARect &rect);
1567
1581 void DrawScaledBitmapLin4(const ABitmap &source, const ARect &rect);
1582
1592 void DrawScaledBitmapLin8(const ABitmap &source, const ARect &rect);
1593
1603 void DrawScaledBitmapLin15(const ABitmap &source, const ARect &rect);
1604
1614 void DrawScaledBitmapLin24(const ABitmap &source, const ARect &rect);
1615
1625 void DrawScaledBitmapLin32(const ABitmap &source, const ARect &rect);
1626
1638 void DrawScaledBitmapRle8(const ABitmap &source, const ARect &rect);
1639
1653 void
1654 DrawScaledClutBitmap(const ABitmap &source, const ARect &rect, const unsigned char *pRemap);
1655
1665 void
1666 DrawScaledClutBitmapLin4(const ABitmap &source, const ARect &rect, const unsigned char *pRemap);
1667
1677 void
1678 DrawScaledClutBitmapLin8(const ABitmap &source, const ARect &rect, const unsigned char *pRemap);
1679
1692 void
1693 DrawScaledClutBitmapRle8(const ABitmap &source, const ARect &rect, const unsigned char *pRemap);
1694
1709 void DrawScaledBlendBitmap(const ABitmap &source,
1710 const ARect &rect,
1711 const unsigned char *const *ppBlend);
1712
1723 const ARect &rect,
1724 const unsigned char *const *ppBlend);
1725
1738 const ARect &rect,
1739 const unsigned char *const *ppBlend);
1740
1754 const ARect &rect,
1755 const unsigned char *const *ppBlend);
1756
1773 static int SetupLine(int nX0, int nY0, int nX1, int nY1, int *pnStepX, int *pnStepY);
1774
1785 static int FindTopmostPolyVertex(const APolygon &polygon);
1786
1799 static void
1800 Unpack4(const unsigned char *pSource, unsigned char *pDest, int nCount, int bStartHighNibble);
1801};
1802
1816unsigned short APackRgb1555From8888(unsigned int nColor);
unsigned short APackRgb1555From8888(unsigned int nColor)
Pack an 8888 colour into 1555.
ACanvasClipCode
Bits ACanvas::ClipCode() returns.
Definition acanvas.h:24
@ kACanvasClipAbove
Definition acanvas.h:27
@ kACanvasClipBelow
Definition acanvas.h:28
@ kACanvasClipLeft
Definition acanvas.h:25
@ kACanvasClipRight
Definition acanvas.h:26
constexpr int kACanvasFractionBits
Fractional bits in the coordinates DrawLine() and DrawTmapRow8U() take.
Definition acanvas.h:16
Description of a pixel rectangle, its layout, and its palette.
Definition abitmap.h:95
virtual void DrawBitmapLin15U(const ABitmap &source, int nX, int nY)
Copy a 1555 source bitmap, with no clip test.
static int SetupLine(int nX0, int nY0, int nX1, int nY1, int *pnStepX, int *pnStepY)
Derive the per pixel step of a line and return the pixel count.
ACanvas(const ABitmap &bitmap)
Adopt a pixel description.
void DrawClutBitmapLin8(const ABitmap &source, int nX, int nY, const unsigned char *pRemap)
Clip against the clip rectangle and then copy an eight bit source through a remap table.
virtual void SetColor15(unsigned short nColor)=0
Set the pen colour from a 1555 halfword.
virtual void GetBitmapLin32U(const ABitmap &dest, int nX, int nY)
Read a rectangle of the canvas into a 32 bit bitmap, with no clip test.
virtual void DrawLineU(int nX0, int nY0, int nX1, int nY1)
Draw a line in the pen colour, with no clip test.
void DrawScaledBitmapLin15(const ABitmap &source, const ARect &rect)
Stretch a 1555 source bitmap into a destination rectangle, through DrawScaledBitmapRowLin15U().
virtual void DrawScaledBitmapRowLin24U(const AScaledRowInfo &span)
Store one row of red, green, blue triples sampled along a fixed step.
virtual void GetBitmapLin24U(const ABitmap &dest, int nX, int nY)
Read a rectangle of the canvas into a 24 bit bitmap, with no clip test.
virtual void DrawClutBitmapRowLin8U(const ARowInfo &span, const unsigned char *pRemap)
Store one row of palette indices through a remap table.
void DrawScaledBlendBitmap(const ABitmap &source, const ARect &rect, const unsigned char *const *ppBlend)
Stretch an indexed source blended against the destination, choosing the arm by source format.
void DrawBlendBitmapLin8(const ABitmap &source, int nX, int nY, const unsigned char *const *ppBlend)
Clip against the clip rectangle and then copy an eight bit source through a blend table.
virtual int GetPixel8U(int nX, int nY)=0
Read one point as a palette index, with no clip test.
virtual void DrawPixelU(int nX, int nY)=0
Store the pen colour at one point, with no clip test.
void DrawScaledClutBitmapLin8(const ABitmap &source, const ARect &rect, const unsigned char *pRemap)
Stretch an eight bit source through a remap table, through DrawScaledClutBitmapRowLin8U().
virtual void DrawScaledBlendBitmapRowLin8U(const AScaledRowInfo &span, const unsigned char *const *ppBlend)
Store one row of palette indices sampled along a fixed step, blended against the destination.
virtual void DrawPixelNative(int nX, int nY, unsigned int nColor)
Store one value in the canvas storage width at one point, clipped.
virtual void DrawPixel32U(int nX, int nY, unsigned int nColor)=0
Store one 8888 colour at one point, with no clip test.
virtual void DrawPixel24U(int nX, int nY, const unsigned char *pRGB)=0
Store one red, green, blue triple at one point, with no clip test.
virtual void GetPixel24U(int nX, int nY, unsigned char *pRGB)=0
Read one point into three bytes in red, green, blue order, with no clip test.
virtual void SetAlphaValues(unsigned int nColorKey)=0
Rewrite every alpha byte of the pixel rectangle from a colour key.
virtual void DrawBitmapLin15(const ABitmap &source, int nX, int nY)
Copy a 1555 source bitmap, clipped.
virtual unsigned int GetColor32()=0
Return the pen colour as an 8888 word.
void DrawScaledBlendBitmapLin8(const ABitmap &source, const ARect &rect, const unsigned char *const *ppBlend)
Stretch an eight bit source blended against the destination.
void DrawClutBitmapU(const ABitmap &source, int nX, int nY, const unsigned char *pRemap)
Copy a source bitmap through a remap table, choosing the arm by source format.
virtual void DrawScaledBitmapRowLin15U(const AScaledRowInfo &span)
Store one row of 1555 colours sampled along a fixed step.
virtual void GetBitmapLin4(const ABitmap &dest, int nX, int nY)
Read a rectangle of the canvas into a four bit bitmap, clipped.
virtual void SetColor8(int nIndex)=0
Set the pen colour from a palette index.
virtual void SetColor24(const unsigned char *pRGB)=0
Set the pen colour from three bytes in red, green, blue order.
virtual void DrawBitmapLin8U(const ABitmap &source, int nX, int nY)
Copy an eight bit source bitmap, with no clip test.
virtual void DrawPixel24(int nX, int nY, const unsigned char *pRGB)
Store one red, green, blue triple at one point, clipped.
void DrawScaledBitmapRle8(const ABitmap &source, const ARect &rect)
Stretch a run length encoded source into a destination rectangle.
static ACanvas * NewCompatibleCanvas(const ABitmap &bitmap, bool bAllocatePixels)
Construct the linear canvas subclass that draws a bitmap's format.
virtual void DrawBitmapLin32U(const ABitmap &source, int nX, int nY)
Copy a 32 bit source bitmap, with no clip test.
void DrawBlendBitmap(const ABitmap &source, int nX, int nY, const unsigned char *const *ppBlend)
Clip against the clip rectangle and then copy through a table of blend tables.
virtual int GetPixel8(int nX, int nY)
Read one point as a palette index, clipped.
void DrawClutBitmapLin4(const ABitmap &source, int nX, int nY, const unsigned char *pRemap)
Clip against the clip rectangle and then copy a four bit source through a remap table.
void DrawScaledBitmap(const ABitmap &source, const ARect &rect)
Stretch a source bitmap into a destination rectangle, choosing the arm by source format.
virtual void DrawVertLineU(int nX, int nTop, int nBottom)
Fill part of one column with the pen colour, with no clip test.
virtual void DrawBlendBitmapRowLin8U(const ARowInfo &span, const unsigned char *const *ppBlend)
Store one row of palette indices blended against the destination.
void DrawBlendBitmapRle8(const ABitmap &source, int nX, int nY, const unsigned char *const *ppBlend)
Clip and copy a run length encoded source through a table of blend tables.
void DrawScaledClutBitmapLin4(const ABitmap &source, const ARect &rect, const unsigned char *pRemap)
Stretch a four bit source through a remap table.
virtual void GetBitmapLin15(const ABitmap &dest, int nX, int nY)
Read a rectangle of the canvas into a 1555 bitmap, clipped.
virtual void GetBitmapLin8(const ABitmap &dest, int nX, int nY)
Read a rectangle of the canvas into an eight bit bitmap, clipped.
virtual void DrawChar(int nCharCode, const AFont *pFont, int nX, int nY)
Draw one glyph of a font, clipped.
void DrawScaledBitmapLin32(const ABitmap &source, const ARect &rect)
Stretch a 32 bit source bitmap into a destination rectangle, through DrawScaledBitmapRowLin32U().
virtual void DrawClutBitmapLin4U(const ABitmap &source, int nX, int nY, const unsigned char *pRemap)
Copy a four bit source bitmap through a remap table.
virtual void DrawPixel(int nX, int nY)
Store the pen colour at one point.
virtual void DrawBox(ARect rect)
Draw the four edges of a rectangle in the pen colour, through the clipped fills.
void DrawBitmapU(const ABitmap &source, int nX, int nY)
Copy a source bitmap, with no clip test, choosing the slot by source format.
virtual void GetBitmapLin32(const ABitmap &dest, int nX, int nY)
Read a rectangle of the canvas into a 32 bit bitmap, clipped.
void DrawBlendBitmapLin4(const ABitmap &source, int nX, int nY, const unsigned char *const *ppBlend)
Clip against the clip rectangle and then copy a four bit source through a blend table.
void QuantizeToRamps(ACanvas &dest, const std::vector< const Color * > &colors) const
Reduce this canvas's 32 bit pixels to palette indices over ramps of the given colours.
static ACanvas * SubCanvas(const ABitmap &source, int nX, int nY, int nWidth, int nHeight)
Construct a canvas over a rectangle of a bitmap's pixels, sharing them.
virtual void DrawCharU(int nCharCode, const AFont *pFont, int nX, int nY)
Draw one glyph of a font, with no clip test.
virtual void DrawBitmapLin32(const ABitmap &source, int nX, int nY)
Copy a 32 bit source bitmap, clipped.
void DrawScaledBitmapLin8(const ABitmap &source, const ARect &rect)
Stretch an eight bit source bitmap into a destination rectangle, through DrawScaledBitmapRowLin8U().
virtual void DrawClutRectU(ARect rect, const unsigned char *pRemap)
Rewrite every palette index inside a rectangle through a remap table.
void DrawScaledBlendBitmapRle8(const ABitmap &source, const ARect &rect, const unsigned char *const *ppBlend)
Stretch a run length encoded source blended against the destination.
virtual void DrawBitmapRle8(const ABitmap &source, int nX, int nY)
Copy a run length encoded eight bit source bitmap, clipped.
unsigned char ClipCode(int nX, int nY) const
Classify a point against the clip rectangle.
virtual void DrawPixelNativeU(int nX, int nY, unsigned int nColor)=0
Store one value in the canvas storage width at one point, with no clip test.
virtual void DrawRect(ARect rect)
Fill a rectangle with the pen colour.
virtual void DrawTextU(const char *pText, const AFont *pFont, int nX, int nY)
Draw a null terminated string, with no clip test.
virtual void DrawScaledBitmapRowLin32U(const AScaledRowInfo &span)
Store one row of 8888 colours sampled along a fixed step.
void DrawFlatConvexPolygon(const APolygon &polygon)
Fill a convex polygon with its colour.
virtual void DrawLine(int nX0, int nY0, int nX1, int nY1)
Draw a line in the pen colour, clipped.
int ClipBitmap(ABitmap *pBitmap, int *pnX, int *pnY) const
Clip a source bitmap and a destination position against the clip rectangle.
void DrawScaledClutBitmapRle8(const ABitmap &source, const ARect &rect, const unsigned char *pRemap)
Stretch a run length encoded source through a remap table.
void DrawBlendBitmapRle8U(const ABitmap &source, int nX, int nY, const unsigned char *const *ppBlend)
Copy a run length encoded source through a table of blend tables.
virtual void GetBitmapLin24(const ABitmap &dest, int nX, int nY)
Read a rectangle of the canvas into a 24 bit bitmap, clipped.
int ClipRect(ARect *pRect) const
Intersect a rectangle with the clip rectangle in place.
virtual void DrawBitmapLin4(const ABitmap &source, int nX, int nY)
Copy a four bit source bitmap, clipped.
virtual int GetColor8()=0
Return the palette index nearest the pen colour.
void ReadRectRle8(const ABitmap &dest, int nX, int nY)
Read a rectangle of the canvas into a run length encoded bitmap.
void DrawBlendBitmapU(const ABitmap &source, int nX, int nY, const unsigned char *const *ppBlend)
Copy a source bitmap through a table of blend tables, choosing the arm by source format.
int ClipAndSetupScaledBitmap(const ABitmap &source, const ARect &rect, AScaledRowInfo *pBlit) const
Prepare a stretched copy of a source bitmap into a destination rectangle.
static unsigned char tempBuff[]
One row of indices, shared by every block copy that has to expand a row before writing it.
Definition acanvas.h:102
virtual unsigned int GetColorNative()=0
Return the pen colour in the canvas storage width.
void DrawTmappedConvexPolygon(const APolygon &polygon)
Fill a convex polygon by sampling its texture.
virtual void DrawBitmapRle8U(const ABitmap &source, int nX, int nY)
Copy a run length encoded eight bit source bitmap, with no clip test.
virtual void SetColorNative(unsigned int nColor)=0
Set the pen colour from a value already in the canvas storage width.
virtual void GetBitmapLin8U(const ABitmap &dest, int nX, int nY)
Read a rectangle of the canvas into an eight bit bitmap, with no clip test.
void DrawScaledClutBitmap(const ABitmap &source, const ARect &rect, const unsigned char *pRemap)
Stretch an indexed source through a remap table, choosing the arm by source format.
virtual void GetBitmapLin15U(const ABitmap &dest, int nX, int nY)
Read a rectangle of the canvas into a 1555 bitmap, with no clip test.
virtual void DrawPixel8U(int nX, int nY, int nIndex)=0
Store one palette index at one point, with no clip test.
virtual void DrawScaledClutBitmapRowLin8U(const AScaledRowInfo &span, const unsigned char *pRemap)
Store one row of palette indices sampled along a fixed step, through a remap table.
virtual unsigned short GetColor15()=0
Return the pen colour packed to 1555.
virtual void DrawBoxU(ARect rect)
Draw the four edges of a rectangle in the pen colour, with no clip test.
int ClipRle8Bitmap(const ABitmap &source, int *pnX, int *pnY, ARle8Reader *pReader, Rle8Clip *pSpan) const
Clip a run length encoded copy against the clip rectangle.
ARect mClip
Definition acanvas.h:1139
virtual unsigned short GetPixel15(int nX, int nY)
Read one point as a 1555 colour, clipped.
void GetBitmapU(const ABitmap &dest, int nX, int nY)
Read a rectangle of the canvas into a bitmap, choosing the slot by destination format.
virtual unsigned int GetPixelNativeU(int nX, int nY)=0
Read one point in the canvas storage width, with no clip test.
virtual void GetBitmapLin4U(const ABitmap &dest, int nX, int nY)
Read a rectangle of the canvas into a four bit bitmap, with no clip test.
virtual ~ACanvas()
Release the canvas.
virtual unsigned int GetPixel32U(int nX, int nY)=0
Read one point as an 8888 colour, with no clip test.
ABitmap mBitmap
Definition acanvas.h:1138
static ACanvas * NewCompatibleLinearCanvas(const ABitmap &bitmap)
Construct a canvas over a fresh pixel rectangle shaped like a bitmap.
virtual void DrawBlendBitmapLin4U(const ABitmap &source, int nX, int nY, const unsigned char *const *ppBlend)
Copy a four bit source bitmap through a blend table.
virtual unsigned short GetPixel15U(int nX, int nY)=0
Read one point as a 1555 colour, with no clip test.
void DrawBitmap(const ABitmap &source, int nX, int nY)
Copy a source bitmap, clipped, choosing the slot by source format.
virtual void DrawClutBitmapLin8U(const ABitmap &source, int nX, int nY, const unsigned char *pRemap)
Copy an eight bit source bitmap through a remap table, one row at a time.
virtual void DrawRectU(ARect rect)
Fill a rectangle with the pen colour, with no clip test.
virtual void GetPixel24(int nX, int nY, unsigned char *pRGB)
Read one point into three bytes in red, green, blue order, clipped.
void DrawClutBitmap(const ABitmap &source, int nX, int nY, const unsigned char *pRemap)
Clip against the clip rectangle and then copy through a remap table.
virtual void DrawPixel15U(int nX, int nY, unsigned short nColor)=0
Store one 1555 colour at one point, with no clip test.
virtual void DrawPixel8(int nX, int nY, int nIndex)
Store one palette index at one point, clipped.
void DrawScaledBitmapLin4(const ABitmap &source, const ARect &rect)
Stretch a four bit source bitmap into a destination rectangle.
virtual void DrawBitmapLin24(const ABitmap &source, int nX, int nY)
Copy a 24 bit source bitmap, clipped.
static APalette * palDefault
Palette every canvas falls back to when neither its bitmap nor its source supplies one.
Definition acanvas.h:87
virtual void DrawBitmapLin4U(const ABitmap &source, int nX, int nY)
Copy a four bit source bitmap, with no clip test.
virtual void GetColor24(unsigned char *pRGB)=0
Store the pen colour as three bytes in red, green, blue order.
void DrawScaledBlendBitmapLin4(const ABitmap &source, const ARect &rect, const unsigned char *const *ppBlend)
Stretch a four bit source blended against the destination.
virtual void DrawVertLine(int nX, int nTop, int nBottom)
Fill part of one column with the pen colour, clamped to the clip rectangle.
virtual void DrawTmapRow8U(int nY, int nLeft, int nRight, const ABitmap *pSource, APoint *pSourcePosition, const APoint *pSourceStep)
Fill part of one row by sampling an indexed source bitmap along a fixed step.
virtual unsigned int GetPixel32(int nX, int nY)
Read one point as an 8888 colour, clipped.
static int FindTopmostPolyVertex(const APolygon &polygon)
Return the position in APolygon::mIndices of the vertex with the smallest row.
virtual void DrawText(const char *pText, const AFont *pFont, int nX, int nY)
Draw a null terminated string, clipped.
virtual void DrawPixel32(int nX, int nY, unsigned int nColor)
Store one 8888 colour at one point, clipped.
int ClipLine(int *pnX0, int *pnY0, int *pnX1, int *pnY1) const
Clip a line against the clip rectangle, rewriting both endpoints in place.
virtual void DrawHorzLineU(int nY, int nLeft, int nRight)
Fill part of one row with the pen colour, with no clip test.
virtual void DrawBlendBitmapLin8U(const ABitmap &source, int nX, int nY, const unsigned char *const *ppBlend)
Copy an eight bit source bitmap through a blend table.
virtual void SetColor32(unsigned int nColor)=0
Set the pen colour from an 8888 word.
virtual void DrawPixel15(int nX, int nY, unsigned short nColor)
Store one 1555 colour at one point, clipped.
void DrawScaledBitmapLin24(const ABitmap &source, const ARect &rect)
Stretch a 24 bit source bitmap into a destination rectangle, through DrawScaledBitmapRowLin24U().
virtual void DrawBitmapLin8(const ABitmap &source, int nX, int nY)
Copy an eight bit source bitmap, clipped.
void DrawClutRect(ARect rect, const unsigned char *pRemap)
Rewrite the palette indices inside a rectangle through a remap table, clipped.
virtual void DrawBitmapLin24U(const ABitmap &source, int nX, int nY)
Copy a 24 bit source bitmap, with no clip test.
virtual void DrawScaledBitmapRowLin8U(const AScaledRowInfo &span)
Store one row of palette indices sampled along a fixed step.
virtual void DrawHorzLine(int nY, int nLeft, int nRight)
Fill part of one row with the pen colour.
void DrawClutBitmapRle8U(const ABitmap &source, int nX, int nY, const unsigned char *pRemap)
Copy a run length encoded source through a remap table.
void GetBitmap(const ABitmap &dest, int nX, int nY)
Read a rectangle of the canvas into a bitmap, clipped, choosing the slot by destination format.
static void Unpack4(const unsigned char *pSource, unsigned char *pDest, int nCount, int bStartHighNibble)
Unpack one row of four bit pixels into one byte each.
void DrawClutBitmapRle8(const ABitmap &source, int nX, int nY, const unsigned char *pRemap)
Clip and copy a run length encoded source through a remap table.
virtual unsigned int GetPixelNative(int nX, int nY)
Read one point in the canvas storage width, clipped.
A 256 entry colour table an ABitmap points at.
Definition apalette.h:31
Convex polygon for the ACanvas polygon fills, as vertex indices into a shared point array.
Definition apolygon.h:29
Half open rectangle of pixel coordinates.
Definition arect.h:25
Cursor over a run length encoded eight bit pixel stream.
Definition arle8reader.h:28
One row of source pixels addressed to one destination row of a canvas.
Definition arowspan.h:21
One stretched copy of a source bitmap into a destination rectangle, walked a row at a time.
Definition astretchblit.h:30
Columns and rows of a run length encoded copy that remain inside a clip rectangle.
Definition aclipspan.h:14
Bitmap font of one glyph image per character code.
Definition afont.h:20
Pair of fixed point coordinates.
Definition apoint.h:16
Linear colour with four float components.
Definition color.h:10