42#include "freertos/FreeRTOS.h"
43#include "freertos/queue.h"
58class CVBSPalettedController :
public CVBSBaseController {
62 CVBSPalettedController(
int columnsQuantum,
NativePixelFormat nativePixelFormat,
int viewPortRatioDiv,
int viewPortRatioMul);
63 ~CVBSPalettedController();
66 CVBSPalettedController(CVBSPalettedController
const&) =
delete;
67 void operator=(CVBSPalettedController
const&) =
delete;
72 void suspendBackgroundPrimitiveExecution();
75 using CVBSBaseController::setResolution;
77 void setResolution(CVBSParams
const * params,
int viewPortWidth = -1,
int viewPortHeight = -1,
bool doubleBuffered =
false);
81 virtual int colorsCount() {
return getPaletteSize(); }
83 void setProcessPrimitivesOnBlank(
bool value) { m_processPrimitivesOnBlank = value; }
86 static uint8_t * sgetScanline(
int y) {
return (uint8_t*) s_viewPort[y]; }
96 virtual void setupDefaultPalette() = 0;
98 void updateRGB2PaletteLUT();
99 void calculateAvailableCyclesForDrawings();
100 static void primitiveExecTask(
void * arg);
102 uint8_t RGB888toPaletteIndex(RGB888
const & rgb) {
103 return m_packedRGB222_to_PaletteIndex[RGB888toPackedRGB222(rgb)];
106 uint8_t RGB2222toPaletteIndex(uint8_t value) {
107 return m_packedRGB222_to_PaletteIndex[value & 0b00111111];
110 uint8_t RGB8888toPaletteIndex(RGBA8888 value) {
111 return RGB888toPaletteIndex(RGB888(value.R, value.G, value.B));
118 TaskHandle_t m_primitiveExecTask;
121 static volatile uint8_t * * s_viewPort;
122 static volatile uint8_t * * s_viewPortVisible;
129 void allocateViewPort();
131 void checkViewPortSize();
134 volatile uint32_t m_primitiveExecTimeoutCycles;
136 volatile bool m_taskProcessingPrimitives;
140 bool m_processPrimitivesOnBlank;
142 uint8_t m_packedRGB222_to_PaletteIndex[64];
145 int m_columnsQuantum;
147 int m_viewPortRatioDiv;
148 int m_viewPortRatioMul;
This file contains fabgl::CVBSBaseController definition.
This file contains fabgl::BitmappedDisplayController definition.
This file contains FabGL library configuration settings, like number of supported colors,...
This file contains some utility classes and functions.
NativePixelFormat
This enum defines the display controller native pixel format.