resonance 1.0.1
Loading...
Searching...
No Matches
acanvas.h File Reference
#include <vector>
#include "rndartt/abitmap.h"
#include "rndartt/arect.h"
#include "rndartt/arle8reader.h"
Include dependency graph for acanvas.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ACanvas
 Drawing surface over an ABitmap, with a clip rectangle. More...

Enumerations

enum  ACanvasClipCode { kACanvasClipLeft = 1 , kACanvasClipRight = 2 , kACanvasClipAbove = 4 , kACanvasClipBelow = 8 }
 Bits ACanvas::ClipCode() returns. More...

Functions

unsigned short APackRgb1555From8888 (unsigned int nColor)
 Pack an 8888 colour into 1555.

Variables

constexpr int kACanvasFractionBits = 8
 Fractional bits in the coordinates DrawLine() and DrawTmapRow8U() take.

Enumeration Type Documentation

◆ ACanvasClipCode

Bits ACanvas::ClipCode() returns.

The four bits form a Cohen and Sutherland outcode against the canvas clip rectangle. A point inside the rectangle produces zero.

Enumerator
kACanvasClipLeft 

The point sits left of the clip rectangle.

kACanvasClipRight 

The point sits at or right of the clip rectangle.

kACanvasClipAbove 

The point sits above the clip rectangle.

kACanvasClipBelow 

The point sits at or below the clip rectangle.

Function Documentation

◆ APackRgb1555From8888()

unsigned short APackRgb1555From8888 ( unsigned int nColor)

Pack an 8888 colour into 1555.

The alpha bit comes from bit 31 and the low three bits of each channel are dropped. The helper is out of line because eleven call sites across ACanvas8, ACanvas15, and ACanvasLin15 share it, while the same packing inlined into ACanvas15::SetColor32() is written out there instruction for instruction.

Parameters
nColorThe 8888 colour.
Returns
The 1555 colour.
Ghidra address:
NTSC-U/C: 0x00618f38
Ghidra address:
PAL: 0x00659ac8

Variable Documentation

◆ kACanvasFractionBits

int kACanvasFractionBits = 8
constexpr

Fractional bits in the coordinates DrawLine() and DrawTmapRow8U() take.