|
resonance 1.0.1
|
Drawing surface over an ABitmap, with a clip rectangle. More...
#include <acanvas.h>


Classes | |
| struct | Rle8Clip |
| Columns and rows of a run length encoded copy that remain inside a clip rectangle. More... | |
| struct | ARowInfo |
| One row of source pixels addressed to one destination row of a canvas. More... | |
| struct | AScaledRowInfo |
| One stretched copy of a source bitmap into a destination rectangle, walked a row at a time. More... | |
Public Member Functions | |
| ACanvas (const ABitmap &bitmap) | |
| Adopt a pixel description. | |
| 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. | |
| void | DrawBitmap (const ABitmap &source, int nX, int nY) |
| Copy a source bitmap, clipped, choosing the slot by source format. | |
| virtual | ~ACanvas () |
| Release the canvas. | |
| virtual void | SetColor8 (int nIndex)=0 |
| Set the pen colour from a palette index. | |
| virtual void | SetColor15 (unsigned short nColor)=0 |
| Set the pen colour from a 1555 halfword. | |
| virtual void | SetColor24 (const unsigned char *pRGB)=0 |
| Set the pen colour from three bytes in red, green, blue order. | |
| virtual void | SetColor32 (unsigned int nColor)=0 |
| Set the pen colour from an 8888 word. | |
| virtual void | SetColorNative (unsigned int nColor)=0 |
| Set the pen colour from a value already in the canvas storage width. | |
| virtual int | GetColor8 ()=0 |
| Return the palette index nearest the pen colour. | |
| virtual unsigned short | GetColor15 ()=0 |
| Return the pen colour packed to 1555. | |
| virtual void | GetColor24 (unsigned char *pRGB)=0 |
| Store the pen colour as three bytes in red, green, blue order. | |
| virtual unsigned int | GetColor32 ()=0 |
| Return the pen colour as an 8888 word. | |
| virtual unsigned int | GetColorNative ()=0 |
| Return the pen colour in the canvas storage width. | |
| virtual void | SetAlphaValues (unsigned int nColorKey)=0 |
| Rewrite every alpha byte of the pixel rectangle from a colour key. | |
| virtual void | DrawPixelU (int nX, int nY)=0 |
| Store the pen colour at one point, with no clip test. | |
| virtual void | DrawPixel (int nX, int nY) |
| Store the pen colour at one point. | |
| virtual void | DrawPixel8U (int nX, int nY, int nIndex)=0 |
| Store one palette index at one point, with no clip test. | |
| virtual void | DrawPixel8 (int nX, int nY, int nIndex) |
| Store one palette index at one point, clipped. | |
| virtual void | DrawPixel15U (int nX, int nY, unsigned short nColor)=0 |
| Store one 1555 colour at one point, with no clip test. | |
| virtual void | DrawPixel15 (int nX, int nY, unsigned short nColor) |
| Store one 1555 colour at one point, clipped. | |
| 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 | DrawPixel24 (int nX, int nY, const unsigned char *pRGB) |
| Store one red, green, blue triple 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 | DrawPixel32 (int nX, int nY, unsigned int nColor) |
| Store one 8888 colour at one point, clipped. | |
| 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 | DrawPixelNative (int nX, int nY, unsigned int nColor) |
| Store one value in the canvas storage width at one point, clipped. | |
| virtual int | GetPixel8U (int nX, int nY)=0 |
| Read one point as a palette index, with no clip test. | |
| virtual int | GetPixel8 (int nX, int nY) |
| Read one point as a palette index, clipped. | |
| virtual unsigned short | GetPixel15U (int nX, int nY)=0 |
| Read one point as a 1555 colour, with no clip test. | |
| virtual unsigned short | GetPixel15 (int nX, int nY) |
| Read one point as a 1555 colour, clipped. | |
| 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 | GetPixel24 (int nX, int nY, unsigned char *pRGB) |
| Read one point into three bytes in red, green, blue order, clipped. | |
| virtual unsigned int | GetPixel32U (int nX, int nY)=0 |
| Read one point as an 8888 colour, with no clip test. | |
| virtual unsigned int | GetPixel32 (int nX, int nY) |
| Read one point as an 8888 colour, clipped. | |
| virtual unsigned int | GetPixelNativeU (int nX, int nY)=0 |
| Read one point in the canvas storage width, with no clip test. | |
| virtual unsigned int | GetPixelNative (int nX, int nY) |
| Read one point in the canvas storage width, clipped. | |
| virtual void | DrawHorzLineU (int nY, int nLeft, int nRight) |
| Fill part of one row with the pen colour, with no clip test. | |
| virtual void | DrawHorzLine (int nY, int nLeft, int nRight) |
| Fill part of one row with the pen colour. | |
| virtual void | DrawVertLineU (int nX, int nTop, int nBottom) |
| Fill part of one column with the pen colour, with no clip test. | |
| 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 | DrawRectU (ARect rect) |
| Fill a rectangle with the pen colour, with no clip test. | |
| virtual void | DrawRect (ARect rect) |
| Fill a rectangle with the pen colour. | |
| virtual void | DrawBoxU (ARect rect) |
| Draw the four edges of a rectangle in the pen colour, with no clip test. | |
| virtual void | DrawBox (ARect rect) |
| Draw the four edges of a rectangle in the pen colour, through the clipped fills. | |
| virtual void | DrawClutRectU (ARect rect, const unsigned char *pRemap) |
| Rewrite every palette index inside a rectangle through a remap table. | |
| virtual void | DrawLineU (int nX0, int nY0, int nX1, int nY1) |
| Draw a line in the pen colour, with no clip test. | |
| virtual void | DrawLine (int nX0, int nY0, int nX1, int nY1) |
| Draw a line in the pen colour, clipped. | |
| 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 void | DrawBitmapLin4U (const ABitmap &source, int nX, int nY) |
| Copy a four bit source bitmap, with no clip test. | |
| virtual void | DrawBitmapLin4 (const ABitmap &source, int nX, int nY) |
| Copy a four bit source bitmap, clipped. | |
| virtual void | DrawBitmapLin8U (const ABitmap &source, int nX, int nY) |
| Copy an eight bit source bitmap, with no clip test. | |
| virtual void | DrawBitmapLin8 (const ABitmap &source, int nX, int nY) |
| Copy an eight bit source bitmap, clipped. | |
| virtual void | DrawBitmapLin15U (const ABitmap &source, int nX, int nY) |
| Copy a 1555 source bitmap, with no clip test. | |
| virtual void | DrawBitmapLin15 (const ABitmap &source, int nX, int nY) |
| Copy a 1555 source bitmap, clipped. | |
| virtual void | DrawBitmapLin24U (const ABitmap &source, int nX, int nY) |
| Copy a 24 bit source bitmap, with no clip test. | |
| virtual void | DrawBitmapLin24 (const ABitmap &source, int nX, int nY) |
| Copy a 24 bit source bitmap, clipped. | |
| virtual void | DrawBitmapLin32U (const ABitmap &source, int nX, int nY) |
| Copy a 32 bit source bitmap, with no clip test. | |
| virtual void | DrawBitmapLin32 (const ABitmap &source, int nX, int nY) |
| Copy a 32 bit source bitmap, clipped. | |
| 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 | DrawBitmapRle8 (const ABitmap &source, int nX, int nY) |
| Copy a run length encoded eight bit source bitmap, clipped. | |
| virtual void | GetBitmapLin4 (const ABitmap &dest, int nX, int nY) |
| Read a rectangle of the canvas into a four bit bitmap, clipped. | |
| 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 void | GetBitmapLin8 (const ABitmap &dest, int nX, int nY) |
| Read a rectangle of the canvas into an eight bit bitmap, clipped. | |
| 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. | |
| virtual void | GetBitmapLin15 (const ABitmap &dest, int nX, int nY) |
| Read a rectangle of the canvas into a 1555 bitmap, clipped. | |
| 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 | GetBitmapLin24 (const ABitmap &dest, int nX, int nY) |
| Read a rectangle of the canvas into a 24 bit bitmap, clipped. | |
| 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 | GetBitmapLin32 (const ABitmap &dest, int nX, int nY) |
| Read a rectangle of the canvas into a 32 bit bitmap, clipped. | |
| 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 | DrawCharU (int nCharCode, const AFont *pFont, int nX, int nY) |
| Draw one glyph of a font, with no clip test. | |
| virtual void | DrawChar (int nCharCode, const AFont *pFont, int nX, int nY) |
| Draw one glyph of a font, clipped. | |
| virtual void | DrawTextU (const char *pText, const AFont *pFont, int nX, int nY) |
| Draw a null terminated string, with no clip test. | |
| virtual void | DrawText (const char *pText, const AFont *pFont, int nX, int nY) |
| Draw a null terminated string, clipped. | |
| 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 | 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 | DrawClutBitmapRowLin8U (const ARowInfo &span, const unsigned char *pRemap) |
| Store one row of palette indices through a remap table. | |
| 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 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 | DrawBlendBitmapRowLin8U (const ARowInfo &span, const unsigned char *const *ppBlend) |
| Store one row of palette indices blended against the destination. | |
| virtual void | DrawScaledBitmapRowLin8U (const AScaledRowInfo &span) |
| Store one row of palette indices sampled along a fixed step. | |
| virtual void | DrawScaledBitmapRowLin15U (const AScaledRowInfo &span) |
| Store one row of 1555 colours sampled along a fixed step. | |
| virtual void | DrawScaledBitmapRowLin24U (const AScaledRowInfo &span) |
| Store one row of red, green, blue triples sampled along a fixed step. | |
| virtual void | DrawScaledBitmapRowLin32U (const AScaledRowInfo &span) |
| Store one row of 8888 colours sampled along a fixed step. | |
| 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 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. | |
Static Public Member Functions | |
| static ACanvas * | NewCompatibleCanvas (const ABitmap &bitmap, bool bAllocatePixels) |
| Construct the linear canvas subclass that draws a bitmap's format. | |
| static ACanvas * | NewCompatibleLinearCanvas (const ABitmap &bitmap) |
| Construct a canvas over a fresh pixel rectangle shaped like a bitmap. | |
| 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. | |
Public Attributes | |
| ABitmap | mBitmap |
| ARect | mClip |
Static Public Attributes | |
| static APalette * | palDefault |
| Palette every canvas falls back to when neither its bitmap nor its source supplies one. | |
| static unsigned char | tempBuff [] |
| One row of indices, shared by every block copy that has to expand a row before writing it. | |
Protected Member Functions | |
| unsigned char | ClipCode (int nX, int nY) const |
| Classify a point against the clip rectangle. | |
| int | ClipRle8Bitmap (const ABitmap &source, int *pnX, int *pnY, ARle8Reader *pReader, Rle8Clip *pSpan) const |
| Clip a run length encoded copy against the clip rectangle. | |
| int | ClipLine (int *pnX0, int *pnY0, int *pnX1, int *pnY1) const |
| Clip a line against the clip rectangle, rewriting both endpoints in place. | |
| int | ClipBitmap (ABitmap *pBitmap, int *pnX, int *pnY) const |
| Clip a source bitmap and a destination position against the clip rectangle. | |
| int | ClipRect (ARect *pRect) const |
| Intersect a rectangle with the clip rectangle in place. | |
| void | DrawClutRect (ARect rect, const unsigned char *pRemap) |
| Rewrite the palette indices inside a rectangle through a remap table, clipped. | |
| void | DrawBitmapU (const ABitmap &source, int nX, int nY) |
| Copy a source bitmap, with no clip test, choosing the slot by source format. | |
| 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 | 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. | |
| 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 | 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. | |
| void | DrawFlatConvexPolygon (const APolygon &polygon) |
| Fill a convex polygon with its colour. | |
| void | DrawTmappedConvexPolygon (const APolygon &polygon) |
| Fill a convex polygon by sampling its texture. | |
| 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. | |
| 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. | |
| void | DrawClutBitmapRle8U (const ABitmap &source, int nX, int nY, const unsigned char *pRemap) |
| Copy a run length encoded source through a remap table. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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 | GetBitmapU (const ABitmap &dest, int nX, int nY) |
| Read a rectangle of the canvas into a bitmap, choosing the slot by destination format. | |
| 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. | |
| void | ReadRectRle8 (const ABitmap &dest, int nX, int nY) |
| Read a rectangle of the canvas into a run length encoded bitmap. | |
| int | ClipAndSetupScaledBitmap (const ABitmap &source, const ARect &rect, AScaledRowInfo *pBlit) const |
| Prepare a stretched copy of a source bitmap into a destination rectangle. | |
| void | DrawScaledBitmap (const ABitmap &source, const ARect &rect) |
| Stretch a source bitmap into a destination rectangle, choosing the arm by source format. | |
| void | DrawScaledBitmapLin4 (const ABitmap &source, const ARect &rect) |
| Stretch a four bit source bitmap into a destination rectangle. | |
| void | DrawScaledBitmapLin8 (const ABitmap &source, const ARect &rect) |
| Stretch an eight bit source bitmap into a destination rectangle, through DrawScaledBitmapRowLin8U(). | |
| void | DrawScaledBitmapLin15 (const ABitmap &source, const ARect &rect) |
| Stretch a 1555 source bitmap into a destination rectangle, through DrawScaledBitmapRowLin15U(). | |
| void | DrawScaledBitmapLin24 (const ABitmap &source, const ARect &rect) |
| Stretch a 24 bit source bitmap into a destination rectangle, through DrawScaledBitmapRowLin24U(). | |
| void | DrawScaledBitmapLin32 (const ABitmap &source, const ARect &rect) |
| Stretch a 32 bit source bitmap into a destination rectangle, through DrawScaledBitmapRowLin32U(). | |
| void | DrawScaledBitmapRle8 (const ABitmap &source, const ARect &rect) |
| Stretch a run length encoded source into a destination rectangle. | |
| 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. | |
| void | DrawScaledClutBitmapLin4 (const ABitmap &source, const ARect &rect, const unsigned char *pRemap) |
| Stretch a four bit source through a remap table. | |
| void | DrawScaledClutBitmapLin8 (const ABitmap &source, const ARect &rect, const unsigned char *pRemap) |
| Stretch an eight bit source through a remap table, through DrawScaledClutBitmapRowLin8U(). | |
| void | DrawScaledClutBitmapRle8 (const ABitmap &source, const ARect &rect, const unsigned char *pRemap) |
| Stretch a run length encoded source 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 | DrawScaledBlendBitmapLin8 (const ABitmap &source, const ARect &rect, const unsigned char *const *ppBlend) |
| Stretch an eight bit source blended against the destination. | |
| void | DrawScaledBlendBitmapLin4 (const ABitmap &source, const ARect &rect, const unsigned char *const *ppBlend) |
| Stretch a four bit source blended against the destination. | |
| void | DrawScaledBlendBitmapRle8 (const ABitmap &source, const ARect &rect, const unsigned char *const *ppBlend) |
| Stretch a run length encoded source blended against the destination. | |
Static Protected Member Functions | |
| 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. | |
| static int | FindTopmostPolyVertex (const APolygon &polygon) |
| Return the position in APolygon::mIndices of the vertex with the smallest row. | |
| 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. | |
Drawing surface over an ABitmap, with a clip rectangle.
Its RTTI descriptor is at 0x0086f660 and lacks a base class. The virtual function table pointer sits after the data members at offset 0x20, the position the toolchain uses for a class with no base.
The table at 0x00837dc8 has 85 slots and terminates on the all zero entry at 0x00838070. Slot 0 is the type function at 0x005ead28 and slot 1 is the destructor. 22 of the remaining slots point at the shared pure virtual stub at 0x005381a8. Every declaration below appears in slot order, which is the order the toolchain assigns, so the position of a member in this class reproduces its index.
Five subclasses implement the drawing operations, one per accepted ABitmapFormat code, and each derives through an intermediate width class: ACanvasLin4 through ACanvas8, ACanvasLin8 through ACanvas8, ACanvasLin15 through ACanvas15, ACanvasLin24 through ACanvas24, and ACanvasLin32 through ACanvas32. Every object in the family is 0x28 bytes, the subclass pen colour at offset 0x24 being one byte wide for the two indexed formats, two for the 15 bit format, and four for the 24 and 32 bit formats.
The division of labour between the two subclass levels is clean. The width class implements the five pen colour setters, the five pen colour getters, and the eight per format pixel accessors, all in terms of the two accessors that use its own storage width. The layout class implements those two, plus whichever bulk operation benefits from direct addressing.
Every operation appears twice, once with the clip test and once without. The unclipped form takes the U suffix. For the pixel accessors and the row, column, and rectangle fills the unclipped form is pure virtual here and the clipped form is implemented here in terms of it. For the copy and read slots both forms are implemented here, the clipped one calling ClipBitmap() and then the unclipped one.
Six colour formats arrive at a pixel. The pen colour form uses no argument. The indexed form takes a palette index, the 1555 form a halfword, the RGB form three bytes, the 8888 form a word, and the native form a value in the canvas storage width. On a 32 bit canvas the 8888 and native forms coincide, and ACanvas32 implements the native pair by forwarding to the 8888 pair.
Both data members are public. Rnd::Font::CharInfo::CharInfo() reads mBitmap.mWidth and mBitmap.mHeight from outside the hierarchy and the image supplies no accessor. The access rule therefore gives public. A friend declaration for Rnd::Font fits the image equally well. mClip has no reader outside the hierarchy and would otherwise be protected, and it shares the public section so that the recovered order of the two is preserved.
|
explicit |
Adopt a pixel description.
The description is copied whole and the clip rectangle is set to the full bitmap, from the origin to mWidth by mHeight. Every subclass constructor calls this first and then installs its own virtual function table.
| bitmap | The description to adopt. |
|
virtual |
Release the canvas.
The compiled body reinstalls this class's virtual function table before releasing. That is what the toolchain emits for a base destructor. The pixel rectangle is not released here.
Every subclass destructor compiles to the same body, which installs this class's table and releases the object when the deleting flag is set. ACanvas15, ACanvas32, and ACanvasLin32 leave theirs implicit (0x0062fb40, 0x0062f710, and 0x006141a0), and the other subclasses declare one.
Construct the linear canvas subclass that draws a bitmap's format.
Copies the description. When asked to allocate, the copy gains a row stride derived from its format, (mWidth + 2) / 2 for kABitmapFormatLinear4 and mWidth times the matching entry of ABitmap::bmPixelSize otherwise, and a pixel rectangle allocated with the source file and line as its tag. The copy's mByteCount is not updated. The format code then selects the subclass through the jump table at 0x00837d90.
The byte count passed to the allocator is a 64-bit product of the height and the stride, computed through the helper at 0x00600270 and truncated to 32 bits.
| bitmap | The description to copy. |
| bAllocatePixels | Whether to allocate a fresh pixel rectangle for the copy. |
Construct a canvas over a fresh pixel rectangle shaped like a bitmap.
Rewrites a format code of kABitmapFormatRle8 to kABitmapFormatLinear8 in a copy, then calls NewCompatibleCanvas() with allocation requested. The image has no caller.
| bitmap | The description to copy. |
|
static |
Construct a canvas over a rectangle of a bitmap's pixels, sharing them.
Builds the rectangle through the sub-rectangle ABitmap constructor and selects the subclass through the jump table at 0x00837db0. Unlike NewCompatibleCanvas(), a kABitmapFormatLinear4 rectangle gets an ACanvasLin8, and kABitmapFormatRle8 gets no canvas. The image has no caller.
| source | The bitmap whose pixels the canvas draws into. |
| nX | The left column of the rectangle. |
| nY | The top row of the rectangle. |
| nWidth | The width in pixels. |
| nHeight | The height in pixels. |
Reduce this canvas's 32 bit pixels to palette indices over ramps of the given colours.
One NormalKey per distinct hue is collected from colors through NormalKey::InsertUniqueNormalKey(), and the static APalette::BuildRampPalette() writes their ramps into dest's palette. Every source pixel then writes one byte to dest. A pixel with zero alpha becomes index 0. Any other pixel is matched to the key whose ratios have the least summed absolute difference from its own, the first such key winning a tie. Its shade is (int)(pixel scale / key scale / 17 + 0.5), and a shade of 0 becomes index 16 while any other becomes 16 times the key's position plus the shade, capped at 15. With no colours, dest's first width times height bytes are cleared. The pixel count is this canvas's width times height, and dest is assumed to be as large. MetRenderer's routine at 0x001716d0 is the one caller, passing the locked canvases of two textures. The name is inferred.
| dest | The eight bit canvas whose pixels and palette are written. |
| colors | The colours whose hues the palette covers. Their alpha is not read. |
| void ACanvas::DrawBitmap | ( | const ABitmap & | source, |
| int | nX, | ||
| int | nY ) |
Copy a source bitmap, clipped, choosing the slot by source format.
Calls through the six entry table of pointers to member functions at 0x0077dcc8, the same table DrawChar() uses, whose entries are DrawBitmapLin4() through DrawBitmapLin32() and then DrawBitmapRle8(). The one caller in the image is Rnd::Movie::OnChunk() at 0x005cf4c0, outside the art library.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Rewrite every alpha byte of the pixel rectangle from a colour key.
A pixel whose colour channels equal the key loses its alpha, and every other pixel gains full alpha. The two indexed subclasses implement the slot over their own storage width.
| nColorKey | The colour to treat as transparent. |
Implemented in ACanvas8, ACanvasLin15, ACanvasLin24, and ACanvasLin32.
|
pure virtual |
Store the pen colour at one point, with no clip test.
| nX | The column. |
| nY | The row. |
Implemented in ACanvasLin15, ACanvasLin24, ACanvasLin32, ACanvasLin4, and ACanvasLin8.
|
virtual |
Store the pen colour at one point.
Returns with no store for a point outside the clip rectangle.
| nX | The column. |
| nY | The row. |
|
pure virtual |
Store one palette index at one point, with no clip test.
| nX | The column. |
| nY | The row. |
| nIndex | The palette index. |
Implemented in ACanvas15, ACanvas24, ACanvas32, ACanvasLin4, and ACanvasLin8.
|
virtual |
Store one palette index at one point, clipped.
| nX | The column. |
| nY | The row. |
| nIndex | The palette index. |
|
pure virtual |
Store one 1555 colour at one point, with no clip test.
| nX | The column. |
| nY | The row. |
| nColor | The colour. |
Implemented in ACanvas24, ACanvas32, ACanvas8, and ACanvasLin15.
|
virtual |
Store one 1555 colour at one point, clipped.
| nX | The column. |
| nY | The row. |
| nColor | The colour. |
|
pure virtual |
Store one red, green, blue triple at one point, with no clip test.
| nX | The column. |
| nY | The row. |
| pRGB | The three channel bytes. |
Implemented in ACanvas15, ACanvas32, ACanvas8, and ACanvasLin24.
|
virtual |
Store one red, green, blue triple at one point, clipped.
| nX | The column. |
| nY | The row. |
| pRGB | The three channel bytes. |
|
pure virtual |
Store one 8888 colour at one point, with no clip test.
| nX | The column. |
| nY | The row. |
| nColor | The colour. |
Implemented in ACanvas15, ACanvas24, ACanvas8, and ACanvasLin32.
|
virtual |
Store one 8888 colour at one point, clipped.
| nX | The column. |
| nY | The row. |
| nColor | The colour. |
|
pure virtual |
|
virtual |
Store one value in the canvas storage width at one point, clipped.
| nX | The column. |
| nY | The row. |
| nColor | The colour in the canvas pixel format. |
|
pure virtual |
Read one point as a palette index, with no clip test.
| nX | The column. |
| nY | The row. |
Implemented in ACanvas15, ACanvas24, ACanvas32, ACanvasLin4, and ACanvasLin8.
|
virtual |
Read one point as a palette index, clipped.
| nX | The column. |
| nY | The row. |
|
pure virtual |
Read one point as a 1555 colour, with no clip test.
| nX | The column. |
| nY | The row. |
Implemented in ACanvas24, ACanvas32, ACanvas8, and ACanvasLin15.
|
virtual |
Read one point as a 1555 colour, clipped.
| nX | The column. |
| nY | The row. |
|
pure virtual |
Read one point into three bytes in red, green, blue order, with no clip test.
| nX | The column. |
| nY | The row. |
| pRGB | The three channel bytes to write. |
Implemented in ACanvas15, ACanvas32, ACanvas8, and ACanvasLin24.
|
virtual |
Read one point into three bytes in red, green, blue order, clipped.
Clears the three bytes for a point outside the clip rectangle.
| nX | The column. |
| nY | The row. |
| pRGB | The three channel bytes to write. |
|
pure virtual |
Read one point as an 8888 colour, with no clip test.
ACanvasLin32 implements the slot at 0x00614350 as a single word load at the row stride times the row plus four times the column, which settles the result as one 32-bit word. Its signedness is not recoverable.
| nX | The column. |
| nY | The row. |
Implemented in ACanvas15, ACanvas24, ACanvas8, and ACanvasLin32.
|
virtual |
Read one point as an 8888 colour, clipped.
| nX | The column. |
| nY | The row. |
|
pure virtual |
|
virtual |
Read one point in the canvas storage width, clipped.
| nX | The column. |
| nY | The row. |
|
virtual |
Fill part of one row with the pen colour, with no clip test.
| nY | The row. |
| nLeft | The first column. |
| nRight | One past the last column. |
Reimplemented in ACanvasLin15, ACanvasLin24, ACanvasLin32, and ACanvasLin8.
|
virtual |
Fill part of one row with the pen colour.
Clamps the column range to the clip rectangle and returns for a row outside it.
| nY | The row. |
| nLeft | The first column. |
| nRight | One past the last column. |
|
virtual |
Fill part of one column with the pen colour, with no clip test.
| nX | The column. |
| nTop | The first row. |
| nBottom | One past the last row. |
Reimplemented in ACanvasLin15, ACanvasLin24, ACanvasLin32, and ACanvasLin8.
|
virtual |
Fill part of one column with the pen colour, clamped to the clip rectangle.
| nX | The column. |
| nTop | The first row. |
| nBottom | One past the last row. |
|
virtual |
Fill a rectangle with the pen colour, with no clip test.
| rect | The rectangle. |
Reimplemented in ACanvasLin15, ACanvasLin24, ACanvasLin32, and ACanvasLin8.
|
virtual |
Fill a rectangle with the pen colour.
Intersects the rectangle with the clip rectangle in place and returns for an empty result.
| rect | The rectangle. |
|
virtual |
Draw the four edges of a rectangle in the pen colour, with no clip test.
| rect | The rectangle. |
|
virtual |
Draw the four edges of a rectangle in the pen colour, through the clipped fills.
| rect | The rectangle. |
|
virtual |
Rewrite every palette index inside a rectangle through a remap table.
| rect | The rectangle. |
| pRemap | 256 replacement indices, one per source index. |
Reimplemented in ACanvasLin8.
|
virtual |
Draw a line in the pen colour, with no clip test.
Every coordinate is 24.8 fixed point. SetupLine() supplies a step of one whole unit along the major axis and the pixel count.
| nX0 | The first column. |
| nY0 | The first row. |
| nX1 | The last column. |
| nY1 | The last row. |
|
virtual |
Draw a line in the pen colour, clipped.
Clips both endpoints first and returns when nothing survives. Every coordinate is 24.8 fixed point.
| nX0 | The first column. |
| nY0 | The first row. |
| nX1 | The last column. |
| nY1 | The last row. |
|
virtual |
Fill part of one row by sampling an indexed source bitmap along a fixed step.
The position advances by the step once per destination column, and the whole parts of the two components address one source byte. The step advances both components, so the sampled run is an arbitrary straight line through the source rather than one source row.
| nY | The destination row. |
| nLeft | The first destination column. |
| nRight | One past the last destination column. |
| pSource | The source bitmap. |
| pSourcePosition | The source position in 24.8 fixed point, advanced in place. |
| pSourceStep | The per column advance in 24.8 fixed point. |
Reimplemented in ACanvasLin15, ACanvasLin24, ACanvasLin32, and ACanvasLin8.
|
virtual |
Copy a four bit source bitmap, with no clip test.
Walks the low nibble of each byte first, and the kABitmapOddNibbleStart bit of the source starts a row in the high nibble instead.
The transparency test compares a whole source byte against mTransparentColor rather than the nibble the loop just consumed, and it reads the byte after the loop has already advanced past it in the high nibble case. Both are faithful to the binary.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
Reimplemented in ACanvasLin15, ACanvasLin32, ACanvasLin4, and ACanvasLin8.
|
virtual |
Copy a four bit source bitmap, clipped.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
|
virtual |
Copy an eight bit source bitmap, with no clip test.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
Reimplemented in ACanvasLin15, ACanvasLin24, ACanvasLin32, ACanvasLin4, and ACanvasLin8.
|
virtual |
Copy an eight bit source bitmap, clipped.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
|
virtual |
Copy a 1555 source bitmap, with no clip test.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
Reimplemented in ACanvasLin15.
|
virtual |
Copy a 1555 source bitmap, clipped.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
|
virtual |
Copy a 24 bit source bitmap, with no clip test.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
Reimplemented in ACanvasLin24.
|
virtual |
Copy a 24 bit source bitmap, clipped.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
|
virtual |
Copy a 32 bit source bitmap, with no clip test.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
Reimplemented in ACanvasLin32.
|
virtual |
Copy a 32 bit source bitmap, clipped.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
|
virtual |
Copy a run length encoded eight bit source bitmap, with no clip test.
Decodes one row into ACanvas::tempBuff, describes the decoded row as an eight bit ABitmap of one row, and copies it with DrawBitmapLin8U().
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
Reimplemented in ACanvasLin4, and ACanvasLin8.
|
virtual |
Copy a run length encoded eight bit source bitmap, clipped.
Forwards to DrawBitmapRle8U() when the whole source fits inside the clip rectangle, and otherwise decodes and copies the surviving rows one at a time.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
|
virtual |
Read a rectangle of the canvas into a four bit bitmap, clipped.
| dest | The destination bitmap, whose extent selects the rectangle. |
| nX | The source column. |
| nY | The source row. |
|
virtual |
Read a rectangle of the canvas into a four bit bitmap, with no clip test.
| dest | The destination bitmap, whose extent selects the rectangle. |
| nX | The source column. |
| nY | The source row. |
|
virtual |
Read a rectangle of the canvas into an eight bit bitmap, clipped.
| dest | The destination bitmap, whose extent selects the rectangle. |
| nX | The source column. |
| nY | The source row. |
|
virtual |
Read a rectangle of the canvas into an eight bit bitmap, with no clip test.
| dest | The destination bitmap, whose extent selects the rectangle. |
| nX | The source column. |
| nY | The source row. |
|
virtual |
Read a rectangle of the canvas into a 1555 bitmap, clipped.
| dest | The destination bitmap, whose extent selects the rectangle. |
| nX | The source column. |
| nY | The source row. |
|
virtual |
Read a rectangle of the canvas into a 1555 bitmap, with no clip test.
| dest | The destination bitmap, whose extent selects the rectangle. |
| nX | The source column. |
| nY | The source row. |
|
virtual |
Read a rectangle of the canvas into a 24 bit bitmap, clipped.
| dest | The destination bitmap, whose extent selects the rectangle. |
| nX | The source column. |
| nY | The source row. |
|
virtual |
Read a rectangle of the canvas into a 24 bit bitmap, with no clip test.
| dest | The destination bitmap, whose extent selects the rectangle. |
| nX | The source column. |
| nY | The source row. |
|
virtual |
Read a rectangle of the canvas into a 32 bit bitmap, clipped.
| dest | The destination bitmap, whose extent selects the rectangle. |
| nX | The source column. |
| nY | The source row. |
|
virtual |
Read a rectangle of the canvas into a 32 bit bitmap, with no clip test.
| dest | The destination bitmap, whose extent selects the rectangle. |
| nX | The source column. |
| nY | The source row. |
|
virtual |
Draw one glyph of a font, with no clip test.
Selects the unclipped copy slot from the glyph format code, through the six entry table of pointers to member functions at 0x0077dc98. A code below mFirstCharCode indexes before the glyph array, and a code at or beyond the glyph count yields a null glyph the routine then reads through. Both are faithful to the binary.
| nCharCode | The character code. |
| pFont | The font. |
| nX | The destination column. |
| nY | The baseline row. |
|
virtual |
Draw one glyph of a font, clipped.
Selects the clipped copy slot through the table at 0x0077dcc8.
| nCharCode | The character code. |
| pFont | The font. |
| nX | The destination column. |
| nY | The baseline row. |
|
virtual |
Draw a null terminated string, with no clip test.
A newline returns to the starting column and advances the row by the font line height. Every other code draws one glyph and advances the column by the glyph width.
| pText | The string. |
| pFont | The font. |
| nX | The starting column. |
| nY | The baseline row. |
|
virtual |
Draw a null terminated string, clipped.
| pText | The string. |
| pFont | The font. |
| nX | The starting column. |
| nY | The baseline row. |
|
virtual |
Copy a four bit source bitmap through a remap table.
Unpacks one row into ACanvas::tempBuff and stores the remapped row.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| pRemap | 256 replacement indices, one per source index. |
|
virtual |
Copy an eight bit source bitmap through a remap table, one row at a time.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| pRemap | 256 replacement indices, one per source index. |
|
virtual |
Store one row of palette indices through a remap table.
Skips a source value equal to the span transparent colour.
| span | The row to store. |
| pRemap | 256 replacement indices, one per source index. |
Reimplemented in ACanvasLin15, ACanvasLin24, ACanvasLin32, and ACanvasLin8.
|
virtual |
Copy a four bit source bitmap through a blend table.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| ppBlend | 256 rows of 256 replacement indices, selected by source then destination. |
|
virtual |
Copy an eight bit source bitmap through a blend table.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| ppBlend | 256 rows of 256 replacement indices, selected by source then destination. |
|
virtual |
Store one row of palette indices blended against the destination.
Reads the destination index, then selects the replacement from the blend row of the source index. Index zero is transparent when the span requests transparency, which differs from DrawClutBitmapRowLin8U(), where the span transparent colour applies instead.
| span | The row to store. |
| ppBlend | 256 rows of 256 replacement indices, selected by source then destination. |
Reimplemented in ACanvasLin8.
|
virtual |
Store one row of palette indices sampled along a fixed step.
| span | The row to store. |
Reimplemented in ACanvasLin15, ACanvasLin24, ACanvasLin32, and ACanvasLin8.
|
virtual |
Store one row of 1555 colours sampled along a fixed step.
| span | The row to store. |
|
virtual |
Store one row of red, green, blue triples sampled along a fixed step.
| span | The row to store. |
|
virtual |
Store one row of 8888 colours sampled along a fixed step.
| span | The row to store. |
|
virtual |
Store one row of palette indices sampled along a fixed step, through a remap table.
| span | The row to store. |
| pRemap | 256 replacement indices, one per source index. |
Reimplemented in ACanvasLin15, ACanvasLin24, ACanvasLin32, and ACanvasLin8.
|
virtual |
Store one row of palette indices sampled along a fixed step, blended against the destination.
| span | The row to store. |
| ppBlend | 256 rows of 256 replacement indices, selected by source then destination. |
Reimplemented in ACanvasLin8.
|
protected |
Classify a point against the clip rectangle.
The code is formed in eight bits, and ClipLine() compares combinations of two codes in eight bits as well.
| nX | The horizontal coordinate. |
| nY | The vertical coordinate. |
|
protected |
Clip a run length encoded copy against the clip rectangle.
Records the decoded columns that remain and the destination row the copy stops at, and moves the destination position onto the clip rectangle. Rows above the clip rectangle are consumed through ARle8Reader::SkipRow(), so the reader then addresses the first row that remains. The row fields are not written when no column remains.
The image has no caller. DrawBitmapRle8(), DrawClutBitmapRle8(), and DrawBlendBitmapRle8() each compile an inlined copy.
| source | The source bitmap. |
| pnX | The destination column, moved right to the clip rectangle when it lies left of it. |
| pnY | The destination row, moved down likewise. |
| pReader | The reader over the source, already at the first row. |
| pSpan | The record to fill. |
|
protected |
Clip a line against the clip rectangle, rewriting both endpoints in place.
Every coordinate is 24.8 fixed point. The routine is a Cohen and Sutherland clip that only ever moves the second endpoint. When the second endpoint is inside and the first is not, the two are exchanged first, so the endpoints can return in the opposite order. An endpoint clipped to the right or bottom edge lands AFix::epsilon inside the exclusive edge.
The outcode of the first endpoint is computed once, before the loop, and after an exchange it is taken as zero rather than recomputed.
| pnX0 | The first column. |
| pnY0 | The first row. |
| pnX1 | The last column. |
| pnY1 | The last row. |
|
protected |
Clip a source bitmap and a destination position against the clip rectangle.
Advances the pixel pointer, shrinks the extent, and moves the destination position, all in place. Every clipped copy and read slot calls this first.
The left clip of a kABitmapFormatLinear4 bitmap has two defects in the binary. The pixel pointer advances by half the destination column rather than by half the columns clipped away, and for an odd count the new mOddNibbleStart is the inverse of this canvas's own flag rather than of the bitmap's.
| pBitmap | The bitmap to clip. |
| pnX | The destination column. |
| pnY | The destination row. |
|
protected |
Intersect a rectangle with the clip rectangle in place.
Non-virtual, and the image has no caller.
| pRect | The rectangle to clip. |
|
protected |
Rewrite the palette indices inside a rectangle through a remap table, clipped.
Intersects the rectangle with the clip rectangle and calls DrawClutRectU() when the result is not empty. Non-virtual and orphaned.
| rect | The rectangle. |
| pRemap | 256 replacement indices, one per source index. |
|
protected |
Copy a source bitmap, with no clip test, choosing the slot by source format.
Calls through the table at 0x0077dc98, the one DrawCharU() uses. Non-virtual and orphaned.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
|
protected |
Clip against the clip rectangle and then copy a four bit source through a remap table.
The clip runs against a stack copy of the source description. Non-virtual and orphaned.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| pRemap | 256 replacement indices, one per source index. |
|
protected |
Clip against the clip rectangle and then copy an eight bit source through a remap table.
Non-virtual and orphaned.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| pRemap | 256 replacement indices, one per source index. |
|
protected |
Clip against the clip rectangle and then copy a four bit source through a blend table.
Non-virtual and orphaned.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| ppBlend | 256 rows of 256 replacement indices, selected by source then destination. |
|
protected |
Clip against the clip rectangle and then copy an eight bit source through a blend table.
Non-virtual and orphaned.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| ppBlend | 256 rows of 256 replacement indices, selected by source then destination. |
|
protected |
Fill a convex polygon with its colour.
Sets the pen colour through SetColorNative() from APolygon::mColor, then walks two edges down from the top vertex, one forward and one backward through the vertex list, filling each row between them with DrawHorzLine(). Each edge column is rounded to the nearest whole column with AFix::onehalf. Rows above the clip rectangle advance the edges without drawing, and the walk stops at the bottom of the clip rectangle or when the two edges meet.
Non-virtual and orphaned.
| polygon | The polygon. |
|
protected |
Fill a convex polygon by sampling its texture.
Walks the edges as DrawFlatConvexPolygon() does. Each row interpolates the texture position between the two edges, clamps its columns to the clip rectangle, advancing the start position by the columns clamped away on the left, and draws with DrawTmapRow8U(). A row of no columns draws nothing. FindTopmostPolyVertex() is compiled inline here.
Non-virtual and orphaned.
| polygon | The polygon, whose first word is its texture. |
|
protected |
Copy a source bitmap through a remap table, choosing the arm by source format.
Non-virtual, and orphaned in the shipped image: it fills no slot of this class's table and the image has no caller and no data reference. Format code 0 goes to DrawClutBitmapLin4U(), code 1 to DrawClutBitmapLin8U(), and code 5 to DrawClutBitmapRle8U(). Every other code returns without drawing.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| pRemap | 256 replacement indices, one per source index. |
|
protected |
Clip against the clip rectangle and then copy through a remap table.
The clip runs against a stack copy of the source description, because ClipBitmap() rewrites what it is given. A zero result returns without drawing. The run length encoded format is handed over unclipped, because DrawClutBitmapRle8() clips for itself.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| pRemap | 256 replacement indices, one per source index. |
|
protected |
Copy a run length encoded source through a remap table.
The run length encoded arm of DrawClutBitmapU(), reached only for format code 5. It decodes each row into ACanvas::tempBuff through ARle8Reader and stores it with DrawClutBitmapRowLin8U().
The row loop advances nY rather than the span row, so its bound recedes with the row and a source of one row or more never finishes. DrawClutBitmapU() has no caller in the image, so the defect is unreachable.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| pRemap | 256 replacement indices, one per source index. |
|
protected |
Clip and copy a run length encoded source through a remap table.
The clipped counterpart of DrawClutBitmapRle8U(), reached only from DrawClutBitmap(). Rows above the clip rectangle are consumed through ARle8Reader::SkipRow() rather than decoded. The clipping matches DrawBitmapRle8(), without its test for a source wholly inside the clip rectangle.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| pRemap | 256 replacement indices, one per source index. |
|
protected |
Copy a source bitmap through a table of blend tables, choosing the arm by source format.
Non-virtual and orphaned, with the same shape as DrawClutBitmapU(). Format code 0 goes to DrawBlendBitmapLin4U(), code 1 to DrawBlendBitmapLin8U(), and code 5 to DrawBlendBitmapRle8U().
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| ppBlend | 256 rows of 256 replacement indices, selected by source then destination. |
|
protected |
Clip against the clip rectangle and then copy through a table of blend tables.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| ppBlend | 256 rows of 256 replacement indices, selected by source then destination. |
|
protected |
Copy a run length encoded source through a table of blend tables.
The same code as DrawClutBitmapRle8U() with DrawBlendBitmapRowLin8U() in place of DrawClutBitmapRowLin8U(), including the row loop that never finishes. DrawBlendBitmapU() has no caller in the image.
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| ppBlend | 256 rows of 256 replacement indices, selected by source then destination. |
|
protected |
Clip and copy a run length encoded source through a table of blend tables.
The same code as DrawClutBitmapRle8() with DrawBlendBitmapRowLin8U() in place of DrawClutBitmapRowLin8U().
| source | The source bitmap. |
| nX | The destination column. |
| nY | The destination row. |
| ppBlend | 256 rows of 256 replacement indices, selected by source then destination. |
|
protected |
Read a rectangle of the canvas into a bitmap, choosing the slot by destination format.
Non-virtual and orphaned, like DrawClutBitmapU(). Calls through the six entry table of pointers to member functions at 0x0077dcf8, whose first five entries address the unclipped read slots GetBitmapLin4U() through GetBitmapLin32U() and whose sixth is ReadRectRle8().
| dest | The destination bitmap, whose extent selects the rectangle. |
| nX | The source column. |
| nY | The source row. |
|
protected |
Read a rectangle of the canvas into a bitmap, clipped, choosing the slot by destination format.
Non-virtual and orphaned. Calls through the table at 0x0077dd28, which addresses the clipped read slots GetBitmapLin4() through GetBitmapLin32() and then ReadRectRle8().
| dest | The destination bitmap, whose extent selects the rectangle. |
| nX | The source column. |
| nY | The source row. |
|
protected |
Read a rectangle of the canvas into a run length encoded bitmap.
Empty. The run length encoded entry of both read tables addresses this one body, so a read into kABitmapFormatRle8 does nothing.
| dest | The destination bitmap. |
| nX | The source column. |
| nY | The source row. |
|
protected |
Prepare a stretched copy of a source bitmap into a destination rectangle.
Both steps are the source extent in 24.8 fixed point divided by the destination extent, and each position starts at half its step, so the walk samples the centre of each source cell. The destination rectangle is clamped to the clip rectangle, and the positions advance by one step per row or column clamped away. AScaledRowInfo::mSource addresses the first source row the walk samples.
The palette resolves from the source, then the canvas, then ACanvas::palDefault.
| source | The source bitmap. |
| rect | The destination rectangle, before clipping. |
| pBlit | The record to fill. |
Stretch a source bitmap into a destination rectangle, choosing the arm by source format.
Non-virtual and orphaned. Calls through the six entry table of pointers to member functions at 0x0077dd58, whose entries are DrawScaledBitmapLin4() through DrawScaledBitmapLin32() and then DrawScaledBitmapRle8(). Every arm clips against the clip rectangle.
| source | The source bitmap. |
| rect | The destination rectangle. |
Stretch a four bit source bitmap into a destination rectangle.
Unpacks each sampled row into ACanvas::tempBuff and stores it with DrawScaledBitmapRowLin8U(). The row walk starts at the first source row rather than at the row ClipAndSetupScaledBitmap() selected. A rectangle clipped at the top samples rows from too high in the source.
| source | The source bitmap. |
| rect | The destination rectangle. |
Stretch an eight bit source bitmap into a destination rectangle, through DrawScaledBitmapRowLin8U().
| source | The source bitmap. |
| rect | The destination rectangle. |
Stretch a 1555 source bitmap into a destination rectangle, through DrawScaledBitmapRowLin15U().
| source | The source bitmap. |
| rect | The destination rectangle. |
Stretch a 24 bit source bitmap into a destination rectangle, through DrawScaledBitmapRowLin24U().
| source | The source bitmap. |
| rect | The destination rectangle. |
Stretch a 32 bit source bitmap into a destination rectangle, through DrawScaledBitmapRowLin32U().
| source | The source bitmap. |
| rect | The destination rectangle. |
Stretch a run length encoded source into a destination rectangle.
Decodes the first sampled row into ACanvas::tempBuff, then decodes again only when the sampled row changes, consuming any rows between through ARle8Reader::SkipRow().
| source | The source bitmap. |
| rect | The destination rectangle. |
|
protected |
Stretch an indexed source through a remap table, choosing the arm by source format.
Non-virtual and orphaned. Format code 0 goes to DrawScaledClutBitmapLin4(), code 1 to DrawScaledClutBitmapLin8(), and code 5 to DrawScaledClutBitmapRle8(). Every other code draws nothing.
| source | The source bitmap. |
| rect | The destination rectangle. |
| pRemap | 256 replacement indices, one per source index. |
|
protected |
Stretch a four bit source through a remap table.
Empty.
| source | The source bitmap. |
| rect | The destination rectangle. |
| pRemap | 256 replacement indices, one per source index. |
|
protected |
Stretch an eight bit source through a remap table, through DrawScaledClutBitmapRowLin8U().
| source | The source bitmap. |
| rect | The destination rectangle. |
| pRemap | 256 replacement indices, one per source index. |
|
protected |
Stretch a run length encoded source through a remap table.
The same code as DrawScaledBitmapRle8() with DrawScaledClutBitmapRowLin8U() in place of DrawScaledBitmapRowLin8U().
| source | The source bitmap. |
| rect | The destination rectangle. |
| pRemap | 256 replacement indices, one per source index. |
|
protected |
Stretch an indexed source blended against the destination, choosing the arm by source format.
Non-virtual and orphaned. Format code 0 goes to DrawScaledBlendBitmapLin4(), code 1 to DrawScaledBlendBitmapLin8(), and code 5 to DrawScaledBlendBitmapRle8(). The four bit arm reads its source as eight bit and the eight bit arm is empty.
| source | The source bitmap. |
| rect | The destination rectangle. |
| ppBlend | 256 rows of 256 replacement indices, selected by source then destination. |
|
protected |
Stretch an eight bit source blended against the destination.
Empty.
| source | The source bitmap. |
| rect | The destination rectangle. |
| ppBlend | 256 rows of 256 replacement indices, selected by source then destination. |
|
protected |
Stretch a four bit source blended against the destination.
The source is read as eight bit, through DrawScaledBlendBitmapRowLin8U().
| source | The source bitmap. |
| rect | The destination rectangle. |
| ppBlend | 256 rows of 256 replacement indices, selected by source then destination. |
|
protected |
Stretch a run length encoded source blended against the destination.
The same code as DrawScaledBitmapRle8() with DrawScaledBlendBitmapRowLin8U() in place of DrawScaledBitmapRowLin8U().
| source | The source bitmap. |
| rect | The destination rectangle. |
| ppBlend | 256 rows of 256 replacement indices, selected by source then destination. |
|
staticprotected |
Derive the per pixel step of a line and return the pixel count.
Every coordinate and both steps are 24.8 fixed point. The major axis advances one whole unit per pixel and the minor axis advances the quotient of the two extents.
| nX0 | The first column. |
| nY0 | The first row. |
| nX1 | The last column. |
| nY1 | The last row. |
| pnStepX | The column step to write. |
| pnStepY | The row step to write. |
|
staticprotected |
Return the position in APolygon::mIndices of the vertex with the smallest row.
A tie resolves to the earlier position.
| polygon | The polygon. |
|
staticprotected |
Unpack one row of four bit pixels into one byte each.
The low nibble of a byte supplies the earlier pixel.
| pSource | The packed row. |
| pDest | The unpacked row. |
| nCount | The number of pixels. |
| bStartHighNibble | Whether the first pixel is the high nibble of the first byte. |
|
static |
Palette every canvas falls back to when neither its bitmap nor its source supplies one.
Read by ACanvas8::SetColor8() and every other slot that resolves a palette index, always after the bitmap palette is found null.
No writer was located. The fallback may be permanently null.
|
static |
One row of indices, shared by every block copy that has to expand a row before writing it.
ACanvasLin4 unpacks a four-bit row into it, both four-bit layout classes decode a run-length encoded row into it, and several ACanvas block copies use it the same way. Each writes the row and consumes it before returning.
The bound is not recovered. The buffer is a plain static with no allocation to read a size from, and the definition takes the 0x400 bytes up to the nearest referenced address above it.
| ABitmap ACanvas::mBitmap |
The pixel rectangle this canvas draws into. +0x00
| ARect ACanvas::mClip |
The clip rectangle every clipped operation tests against. +0x18