TftPixel(wX_Pixel As Word, wY_Pixel As Word, wColor As Word)
|
Parameter |
Description |
|
wX_Pixel |
X-coordinate |
|
wY_Pixel |
Y-coordinate |
|
wColor |
16-bit RGB565 color |
Places a single pixel in the RAM or SRAM frame buffer.
This writes a pixel to the given position in the RAM/SRAM buffer — not to be confused with EpdPixel(), which writes a single pixel directly to the given position in the driver IC's GRAM.
This procedure exists to replace TFT Library 2's own TftPixel(), redirecting every pixel write from TFT Library 2 commands into the virtual buffer instead.
This redirection is the core mechanism the entire TFT-to-EPD virtualization layer is built on — every shape, font, and drawing function that works through the buffer ultimately comes down to calls to this procedure.
Since the targeted EPD panels only support a small, fixed palette (Black, White, and — on 3-color panels — Red or Yellow), incoming 16-bit RGB565 colors need to be reduced to one of these before they can be stored in the buffer.
If the given color is already an exact match for one of the four core colors, it's used as-is.
Otherwise, the color is passed through the system procedure EpdMapColor(), which picks the closest available color: on a 3-color panel, it first checks whether the color is close enough to the panel's specific accent color (Red or Yellow) to count as that color; if not — or on a plain Black/White panel — it falls back to a brightness-based decision between Black and White.
That brightness cutoff is controlled by a separate parameter, EpdBwThreshold, covered in its own entry later — for now, it's enough to know it exists and determines where the pixel falls between "counts as white" and "counts as black."
Created with the Personal Edition of HelpNDoc: Free help authoring tool