32#include "freertos/FreeRTOS.h"
33#include "freertos/task.h"
35#include "esp_spi_flash.h"
42#pragma GCC optimize ("O2")
53static inline __attribute__((always_inline))
void CVBS16_SETPIXELINROW(uint8_t * row,
int x,
int value) {
55 row[brow] = (x & 1) ? ((row[brow] & 0xf0) | value) : ((row[brow] & 0x0f) | (value << 4));
58static inline __attribute__((always_inline))
int CVBS16_GETPIXELINROW(uint8_t * row,
int x) {
60 return ((x & 1) ? (row[brow] & 0x0f) : ((row[brow] & 0xf0) >> 4));
63#define CVBS16_INVERTPIXELINROW(row, x) (row)[(x) >> 1] ^= (0xf0 >> (((x) & 1) << 2))
65static inline __attribute__((always_inline))
void CVBS16_SETPIXEL(
int x,
int y,
int value) {
66 auto row = (uint8_t*) CVBS16Controller::sgetScanline(y);
68 row[brow] = (x & 1) ? ((row[brow] & 0xf0) | value) : ((row[brow] & 0x0f) | (value << 4));
71#define CVBS16_GETPIXEL(x, y) CVBS16_GETPIXELINROW((uint8_t*)CVBS16Controller::s_viewPort[(y)], (x))
73#define CVBS16_INVERT_PIXEL(x, y) CVBS16_INVERTPIXELINROW((uint8_t*)CVBS16Controller::s_viewPort[(y)], (x))
76#define CVBS16_COLUMNSQUANTUM 16
83CVBS16Controller * CVBS16Controller::s_instance =
nullptr;
84volatile uint16_t * * CVBS16Controller::s_paletteToRawPixel[2];
87CVBS16Controller::CVBS16Controller()
95void CVBS16Controller::allocateViewPort()
97 CVBSPalettedController::allocateViewPort();
99 for (
int line = 0; line < 2; ++line) {
100 s_paletteToRawPixel[line] = (
volatile uint16_t * *) heap_caps_malloc(
sizeof(uint16_t *) * 16, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL);
101 for (
int index = 0; index < 16; ++index)
102 s_paletteToRawPixel[line][index] = (uint16_t *) heap_caps_malloc(
sizeof(uint16_t) * CVBS_SUBCARRIERPHASES * 2, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL);
105 switch (horizontalRate()) {
107 setDrawScanlineCallback(drawScanlineX1);
110 setDrawScanlineCallback(drawScanlineX2);
113 setDrawScanlineCallback(drawScanlineX3);
122void CVBS16Controller::checkViewPortSize()
124 CVBSPalettedController::checkViewPortSize();
129void CVBS16Controller::setupDefaultPalette()
131 for (
int colorIndex = 0; colorIndex < 16; ++colorIndex) {
132 RGB888 rgb888((
Color)colorIndex);
133 setPaletteItem(colorIndex, rgb888);
138void CVBS16Controller::setPaletteItem(
int index, RGB888
const & color)
141 m_palette[index] = color;
143 double range = params()->whiteLevel - params()->blackLevel + 1;
145 for (
int line = 0; line < 2; ++line) {
146 for (
int sample = 0; sample < CVBS_SUBCARRIERPHASES * 2; ++sample) {
148 double phase = 2. * M_PI * (sample) / CVBS_SUBCARRIERPHASES;
151 double chroma = params()->getComposite(line == 0, phase, color.R / 255., color.G / 255., color.B / 255., &
Y);
157 s_paletteToRawPixel[line][index][sample] = (uint16_t)(params()->blackLevel + (
Y + chroma) * range) << 8;
163void CVBS16Controller::setPixelAt(PixelDesc
const & pixelDesc, Rect & updateRect)
165 genericSetPixelAt(pixelDesc, updateRect,
166 [&] (RGB888
const & color) {
return RGB888toPaletteIndex(color); },
174void CVBS16Controller::absDrawLine(
int X1,
int Y1,
int X2,
int Y2, RGB888 color)
176 genericAbsDrawLine(
X1,
Y1,
X2,
Y2, color,
177 [&] (RGB888
const & color) {
return RGB888toPaletteIndex(color); },
178 [&] (
int Y,
int X1,
int X2, uint8_t colorIndex) { rawFillRow(
Y,
X1,
X2, colorIndex); },
179 [&] (
int Y,
int X1,
int X2) { rawInvertRow(
Y,
X1,
X2); },
181 [&] (
int X,
int Y) { CVBS16_INVERT_PIXEL(
X,
Y); }
187void CVBS16Controller::rawFillRow(
int y,
int x1,
int x2, RGB888 color)
189 rawFillRow(y, x1, x2, RGB888toPaletteIndex(color));
194void CVBS16Controller::rawFillRow(
int y,
int x1,
int x2, uint8_t colorIndex)
196 uint8_t * row = (uint8_t*) m_viewPort[y];
199 for (; x <= x2 && (x & 3) != 0; ++x) {
200 CVBS16_SETPIXELINROW(row, x, colorIndex);
204 int sz = (x2 & ~3) - x;
205 memset((
void*)(row + x / 2), colorIndex | (colorIndex << 4), sz / 2);
209 for (; x <= x2; ++x) {
210 CVBS16_SETPIXELINROW(row, x, colorIndex);
216void CVBS16Controller::rawInvertRow(
int y,
int x1,
int x2)
218 auto row = m_viewPort[y];
219 for (
int x = x1; x <= x2; ++x)
220 CVBS16_INVERTPIXELINROW(row, x);
224void CVBS16Controller::rawCopyRow(
int x1,
int x2,
int srcY,
int dstY)
226 auto srcRow = (uint8_t*) m_viewPort[srcY];
227 auto dstRow = (uint8_t*) m_viewPort[dstY];
230 for (; x <= x2 && (x & 3) != 0; ++x) {
231 CVBS16_SETPIXELINROW(dstRow, x, CVBS16_GETPIXELINROW(srcRow, x));
234 auto src = (uint16_t*)(srcRow + x / 2);
235 auto dst = (uint16_t*)(dstRow + x / 2);
236 for (
int right = (x2 & ~3); x < right; x += 4)
239 for (x = (x2 & ~3); x <= x2; ++x) {
240 CVBS16_SETPIXELINROW(dstRow, x, CVBS16_GETPIXELINROW(srcRow, x));
245void CVBS16Controller::swapRows(
int yA,
int yB,
int x1,
int x2)
247 auto rowA = (uint8_t*) m_viewPort[yA];
248 auto rowB = (uint8_t*) m_viewPort[yB];
251 for (; x <= x2 && (x & 3) != 0; ++x) {
252 uint8_t a = CVBS16_GETPIXELINROW(rowA, x);
253 uint8_t b = CVBS16_GETPIXELINROW(rowB, x);
254 CVBS16_SETPIXELINROW(rowA, x, b);
255 CVBS16_SETPIXELINROW(rowB, x, a);
258 auto a = (uint16_t*)(rowA + x / 2);
259 auto b = (uint16_t*)(rowB + x / 2);
260 for (
int right = (x2 & ~3); x < right; x += 4)
263 for (x = (x2 & ~3); x <= x2; ++x) {
264 uint8_t a = CVBS16_GETPIXELINROW(rowA, x);
265 uint8_t b = CVBS16_GETPIXELINROW(rowB, x);
266 CVBS16_SETPIXELINROW(rowA, x, b);
267 CVBS16_SETPIXELINROW(rowB, x, a);
272void CVBS16Controller::drawEllipse(Size
const & size, Rect & updateRect)
274 genericDrawEllipse(size, updateRect,
275 [&] (RGB888
const & color) {
return RGB888toPaletteIndex(color); },
281void CVBS16Controller::clear(Rect & updateRect)
283 hideSprites(updateRect);
284 uint8_t paletteIndex = RGB888toPaletteIndex(getActualBrushColor());
285 uint8_t pattern = paletteIndex | (paletteIndex << 4);
286 for (
int y = 0; y < m_viewPortHeight; ++y)
287 memset((uint8_t*) m_viewPort[y], pattern, m_viewPortWidth / 2);
293void CVBS16Controller::VScroll(
int scroll, Rect & updateRect)
295 genericVScroll(scroll, updateRect,
296 [&] (
int yA,
int yB,
int x1,
int x2) { swapRows(yA, yB, x1, x2); },
297 [&] (
int yA,
int yB) { tswap(m_viewPort[yA], m_viewPort[yB]); },
298 [&] (
int y,
int x1,
int x2, RGB888 color) { rawFillRow(y, x1, x2, color); }
303void CVBS16Controller::HScroll(
int scroll, Rect & updateRect)
305 hideSprites(updateRect);
306 uint8_t back4 = RGB888toPaletteIndex(getActualBrushColor());
308 int Y1 = paintState().scrollingRegion.Y1;
309 int Y2 = paintState().scrollingRegion.Y2;
310 int X1 = paintState().scrollingRegion.X1;
311 int X2 = paintState().scrollingRegion.X2;
314 bool HScrolllingRegionAligned = ((
X1 & 3) == 0 && (
width & 3) == 0);
318 for (
int y =
Y1; y <=
Y2; ++y) {
319 if (HScrolllingRegionAligned) {
321 uint8_t * row = (uint8_t*) (m_viewPort[y]) +
X1 / 2;
322 for (
int s = -scroll; s > 0;) {
326 auto sz =
width & ~1;
327 memmove(row, row + sc / 2, (sz - sc) / 2);
328 rawFillRow(y,
X2 - sc + 1,
X2, back4);
336 auto w = (uint16_t *) (row +
width / 2) - 1;
337 for (
int i = 0; i <
width; i += 4) {
338 const uint16_t p4 = *w;
339 *w-- = (p4 << 4 & 0xf000) | (prev << 8 & 0x0f00) | (p4 << 4 & 0x00f0) | (p4 >> 12 & 0x000f);
340 prev = p4 >> 4 & 0x000f;
347 auto row = (uint8_t*) m_viewPort[y];
348 for (
int x =
X1; x <=
X2 + scroll; ++x)
349 CVBS16_SETPIXELINROW(row, x, CVBS16_GETPIXELINROW(row, x - scroll));
351 rawFillRow(y,
X2 + 1 + scroll,
X2, back4);
354 }
else if (scroll > 0) {
356 for (
int y =
Y1; y <=
Y2; ++y) {
357 if (HScrolllingRegionAligned) {
359 uint8_t * row = (uint8_t*) (m_viewPort[y]) +
X1 / 2;
360 for (
int s = scroll; s > 0;) {
364 auto sz =
width & ~1;
365 memmove(row + sc / 2, row, (sz - sc) / 2);
366 rawFillRow(y,
X1,
X1 + sc - 1, back4);
374 auto w = (uint16_t *) row;
375 for (
int i = 0; i <
width; i += 4) {
376 const uint16_t p4 = *w;
377 *w++ = (p4 << 12 & 0xf000) | (p4 >> 4 & 0x0f00) | (prev << 4) | (p4 >> 4 & 0x000f);
378 prev = p4 >> 8 & 0x000f;
385 auto row = (uint8_t*) m_viewPort[y];
386 for (
int x =
X2 - scroll; x >=
X1; --x)
387 CVBS16_SETPIXELINROW(row, x + scroll, CVBS16_GETPIXELINROW(row, x));
389 rawFillRow(y,
X1,
X1 + scroll - 1, back4);
397void CVBS16Controller::drawGlyph(Glyph
const & glyph, GlyphOptions glyphOptions, RGB888 penColor, RGB888 brushColor, Rect & updateRect)
399 genericDrawGlyph(glyph, glyphOptions, penColor, brushColor, updateRect,
400 [&] (RGB888
const & color) {
return RGB888toPaletteIndex(color); },
401 [&] (
int y) {
return (uint8_t*) m_viewPort[y]; },
407void CVBS16Controller::invertRect(Rect
const & rect, Rect & updateRect)
409 genericInvertRect(rect, updateRect,
410 [&] (
int Y,
int X1,
int X2) { rawInvertRow(
Y,
X1,
X2); }
417 genericSwapFGBG(rect, updateRect,
418 [&] (RGB888
const & color) {
return RGB888toPaletteIndex(color); },
419 [&] (
int y) {
return (uint8_t*) m_viewPort[y]; },
420 CVBS16_GETPIXELINROW,
428void CVBS16Controller::copyRect(Rect
const & source, Rect & updateRect)
430 genericCopyRect(source, updateRect,
431 [&] (
int y) {
return (uint8_t*) m_viewPort[y]; },
432 CVBS16_GETPIXELINROW,
439void CVBS16Controller::readScreen(Rect
const & rect, RGB888 * destBuf)
441 for (
int y = rect.Y1; y <= rect.Y2; ++y) {
442 auto row = (uint8_t*) m_viewPort[y];
443 for (
int x = rect.X1; x <= rect.X2; ++x, ++destBuf) {
444 const RGB222 v = m_palette[CVBS16_GETPIXELINROW(row, x)];
445 *destBuf = RGB888(v.R * 85, v.G * 85, v.B * 85);
451void CVBS16Controller::rawDrawBitmap_Native(
int destX,
int destY, Bitmap
const * bitmap,
int X1,
int Y1,
int XCount,
int YCount)
453 genericRawDrawBitmap_Native(destX, destY, (uint8_t*) bitmap->data, bitmap->width,
X1,
Y1, XCount, YCount,
454 [&] (
int y) { return (uint8_t*) m_viewPort[y]; },
460void CVBS16Controller::rawDrawBitmap_Mask(
int destX,
int destY, Bitmap
const * bitmap,
void * saveBackground,
int X1,
int Y1,
int XCount,
int YCount)
462 auto foregroundColorIndex = RGB888toPaletteIndex(bitmap->foregroundColor);
463 genericRawDrawBitmap_Mask(destX, destY, bitmap, (uint8_t*)saveBackground,
X1,
Y1, XCount, YCount,
464 [&] (
int y) {
return (uint8_t*) m_viewPort[y]; },
465 CVBS16_GETPIXELINROW,
466 [&] (uint8_t * row,
int x) { CVBS16_SETPIXELINROW(row, x, foregroundColorIndex); }
471void CVBS16Controller::rawDrawBitmap_RGBA2222(
int destX,
int destY, Bitmap
const * bitmap,
void * saveBackground,
int X1,
int Y1,
int XCount,
int YCount)
473 genericRawDrawBitmap_RGBA2222(destX, destY, bitmap, (uint8_t*)saveBackground,
X1,
Y1, XCount, YCount,
474 [&] (
int y) {
return (uint8_t*) m_viewPort[y]; },
475 CVBS16_GETPIXELINROW,
476 [&] (uint8_t * row,
int x, uint8_t src) { CVBS16_SETPIXELINROW(row, x, RGB2222toPaletteIndex(src)); }
481void CVBS16Controller::rawDrawBitmap_RGBA8888(
int destX,
int destY, Bitmap
const * bitmap,
void * saveBackground,
int X1,
int Y1,
int XCount,
int YCount)
483 genericRawDrawBitmap_RGBA8888(destX, destY, bitmap, (uint8_t*)saveBackground,
X1,
Y1, XCount, YCount,
484 [&] (
int y) {
return (uint8_t*) m_viewPort[y]; },
485 [&] (uint8_t * row,
int x) {
return CVBS16_GETPIXELINROW(row, x); },
486 [&] (uint8_t * row,
int x,
RGBA8888 const & src) { CVBS16_SETPIXELINROW(row, x, RGB8888toPaletteIndex(src)); }
491void IRAM_ATTR CVBS16Controller::drawScanlineX1(
void * arg, uint16_t * dest,
int scanLine)
493 auto ctrl = (CVBS16Controller *) arg;
495 auto const width = ctrl->m_viewPortWidth;
496 auto const height = ctrl->m_viewPortHeight;
498 auto src = (uint8_t
const *) s_viewPortVisible[scanLine];
499 auto dest32 = (uint32_t*) dest;
501 int firstVisibleSample = CVBSGenerator::firstVisibleSample();
502 int subCarrierPhaseSam = CVBSGenerator::subCarrierPhase();
503 auto paletteToRaw = s_paletteToRawPixel[CVBSGenerator::interFrameLine() & 1];
504 auto sampleLUT = CVBSGenerator::lineSampleToSubCarrierSample();
512 for (
int col = 0; col <
width; col += 16) {
514 auto src1 = *(src + 0);
515 auto src2 = *(src + 1);
516 auto src3 = *(src + 2);
517 auto src4 = *(src + 3);
518 auto src5 = *(src + 4);
519 auto src6 = *(src + 5);
520 auto src7 = *(src + 6);
521 auto src8 = *(src + 7);
525 int sample = firstVisibleSample + col;
527 auto v1 = (paletteToRaw[src1 >> 4][sampleLUT[sample + 0] + subCarrierPhaseSam] << 16) | (paletteToRaw[src1 & 0x0f][sampleLUT[sample + 1] + subCarrierPhaseSam]);
528 auto v2 = (paletteToRaw[src2 >> 4][sampleLUT[sample + 2] + subCarrierPhaseSam] << 16) | (paletteToRaw[src2 & 0x0f][sampleLUT[sample + 3] + subCarrierPhaseSam]);
529 auto v3 = (paletteToRaw[src3 >> 4][sampleLUT[sample + 4] + subCarrierPhaseSam] << 16) | (paletteToRaw[src3 & 0x0f][sampleLUT[sample + 5] + subCarrierPhaseSam]);
530 auto v4 = (paletteToRaw[src4 >> 4][sampleLUT[sample + 6] + subCarrierPhaseSam] << 16) | (paletteToRaw[src4 & 0x0f][sampleLUT[sample + 7] + subCarrierPhaseSam]);
531 auto v5 = (paletteToRaw[src5 >> 4][sampleLUT[sample + 8] + subCarrierPhaseSam] << 16) | (paletteToRaw[src5 & 0x0f][sampleLUT[sample + 9] + subCarrierPhaseSam]);
532 auto v6 = (paletteToRaw[src6 >> 4][sampleLUT[sample + 10] + subCarrierPhaseSam] << 16) | (paletteToRaw[src6 & 0x0f][sampleLUT[sample + 11] + subCarrierPhaseSam]);
533 auto v7 = (paletteToRaw[src7 >> 4][sampleLUT[sample + 12] + subCarrierPhaseSam] << 16) | (paletteToRaw[src7 & 0x0f][sampleLUT[sample + 13] + subCarrierPhaseSam]);
534 auto v8 = (paletteToRaw[src8 >> 4][sampleLUT[sample + 14] + subCarrierPhaseSam] << 16) | (paletteToRaw[src8 & 0x0f][sampleLUT[sample + 15] + subCarrierPhaseSam]);
550 if (scanLine >=
height - 1 && !ctrl->m_primitiveProcessingSuspended && spi_flash_cache_enabled() && ctrl->m_primitiveExecTask) {
553 vTaskNotifyGiveFromISR(ctrl->m_primitiveExecTask, NULL);
559void IRAM_ATTR CVBS16Controller::drawScanlineX2(
void * arg, uint16_t * dest,
int scanLine)
561 auto ctrl = (CVBS16Controller *) arg;
563 auto const width = ctrl->m_viewPortWidth * 2;
564 auto const height = ctrl->m_viewPortHeight;
566 auto src = (uint8_t
const *) s_viewPortVisible[scanLine];
567 auto dest32 = (uint32_t*) dest;
569 int firstVisibleSample = CVBSGenerator::firstVisibleSample();
570 int subCarrierPhaseSam = CVBSGenerator::subCarrierPhase();
571 auto paletteToRaw = s_paletteToRawPixel[CVBSGenerator::interFrameLine() & 1];
572 auto sampleLUT = CVBSGenerator::lineSampleToSubCarrierSample();
575 for (
int col = 0; col <
width; col += 16) {
577 auto src1 = *(src + 0);
578 auto src2 = *(src + 1);
579 auto src3 = *(src + 2);
580 auto src4 = *(src + 3);
584 int sample = firstVisibleSample + col;
586 auto v1 = (paletteToRaw[src1 >> 4 ][sampleLUT[sample + 0] + subCarrierPhaseSam] << 16) | (paletteToRaw[src1 >> 4 ][sampleLUT[sample + 1] + subCarrierPhaseSam]);
587 auto v2 = (paletteToRaw[src1 & 0x0f][sampleLUT[sample + 2] + subCarrierPhaseSam] << 16) | (paletteToRaw[src1 & 0x0f][sampleLUT[sample + 3] + subCarrierPhaseSam]);
588 auto v3 = (paletteToRaw[src2 >> 4 ][sampleLUT[sample + 4] + subCarrierPhaseSam] << 16) | (paletteToRaw[src2 >> 4 ][sampleLUT[sample + 5] + subCarrierPhaseSam]);
589 auto v4 = (paletteToRaw[src2 & 0x0f][sampleLUT[sample + 6] + subCarrierPhaseSam] << 16) | (paletteToRaw[src2 & 0x0f][sampleLUT[sample + 7] + subCarrierPhaseSam]);
590 auto v5 = (paletteToRaw[src3 >> 4 ][sampleLUT[sample + 8] + subCarrierPhaseSam] << 16) | (paletteToRaw[src3 >> 4 ][sampleLUT[sample + 9] + subCarrierPhaseSam]);
591 auto v6 = (paletteToRaw[src3 & 0x0f][sampleLUT[sample + 10] + subCarrierPhaseSam] << 16) | (paletteToRaw[src3 & 0x0f][sampleLUT[sample + 11] + subCarrierPhaseSam]);
592 auto v7 = (paletteToRaw[src4 >> 4 ][sampleLUT[sample + 12] + subCarrierPhaseSam] << 16) | (paletteToRaw[src4 >> 4 ][sampleLUT[sample + 13] + subCarrierPhaseSam]);
593 auto v8 = (paletteToRaw[src4 & 0x0f][sampleLUT[sample + 14] + subCarrierPhaseSam] << 16) | (paletteToRaw[src4 & 0x0f][sampleLUT[sample + 15] + subCarrierPhaseSam]);
609 if (scanLine >=
height - 1 && !ctrl->m_primitiveProcessingSuspended && spi_flash_cache_enabled() && ctrl->m_primitiveExecTask) {
612 vTaskNotifyGiveFromISR(ctrl->m_primitiveExecTask, NULL);
618void IRAM_ATTR CVBS16Controller::drawScanlineX3(
void * arg, uint16_t * dest,
int scanLine)
620 auto ctrl = (CVBS16Controller *) arg;
622 auto const width = ctrl->m_viewPortWidth * 3;
623 auto const height = ctrl->m_viewPortHeight;
625 auto src = (uint8_t
const *) s_viewPortVisible[scanLine];
626 auto dest32 = (uint32_t*) dest;
628 int firstVisibleSample = CVBSGenerator::firstVisibleSample();
629 int subCarrierPhaseSam = CVBSGenerator::subCarrierPhase();
630 auto paletteToRaw = s_paletteToRawPixel[CVBSGenerator::interFrameLine() & 1];
631 auto sampleLUT = CVBSGenerator::lineSampleToSubCarrierSample();
634 for (
int col = 0; col <
width; col += 24) {
636 auto src1 = *(src + 0);
637 auto src2 = *(src + 1);
638 auto src3 = *(src + 2);
639 auto src4 = *(src + 3);
643 int sample = firstVisibleSample + col;
645 auto v1 = (paletteToRaw[src1 >> 4 ][sampleLUT[sample + 0] + subCarrierPhaseSam] << 16) | (paletteToRaw[src1 >> 4 ][sampleLUT[sample + 1] + subCarrierPhaseSam]);
646 auto v2 = (paletteToRaw[src1 >> 4 ][sampleLUT[sample + 2] + subCarrierPhaseSam] << 16) | (paletteToRaw[src1 & 0x0f][sampleLUT[sample + 3] + subCarrierPhaseSam]);
647 auto v3 = (paletteToRaw[src1 & 0x0f][sampleLUT[sample + 4] + subCarrierPhaseSam] << 16) | (paletteToRaw[src1 & 0x0f][sampleLUT[sample + 5] + subCarrierPhaseSam]);
649 auto v4 = (paletteToRaw[src2 >> 4 ][sampleLUT[sample + 6] + subCarrierPhaseSam] << 16) | (paletteToRaw[src2 >> 4 ][sampleLUT[sample + 7] + subCarrierPhaseSam]);
650 auto v5 = (paletteToRaw[src2 >> 4 ][sampleLUT[sample + 8] + subCarrierPhaseSam] << 16) | (paletteToRaw[src2 & 0x0f][sampleLUT[sample + 9] + subCarrierPhaseSam]);
651 auto v6 = (paletteToRaw[src2 & 0x0f][sampleLUT[sample + 10] + subCarrierPhaseSam] << 16) | (paletteToRaw[src2 & 0x0f][sampleLUT[sample + 11] + subCarrierPhaseSam]);
653 auto v7 = (paletteToRaw[src3 >> 4 ][sampleLUT[sample + 12] + subCarrierPhaseSam] << 16) | (paletteToRaw[src3 >> 4 ][sampleLUT[sample + 13] + subCarrierPhaseSam]);
654 auto v8 = (paletteToRaw[src3 >> 4 ][sampleLUT[sample + 14] + subCarrierPhaseSam] << 16) | (paletteToRaw[src3 & 0x0f][sampleLUT[sample + 15] + subCarrierPhaseSam]);
655 auto v9 = (paletteToRaw[src3 & 0x0f][sampleLUT[sample + 16] + subCarrierPhaseSam] << 16) | (paletteToRaw[src3 & 0x0f][sampleLUT[sample + 17] + subCarrierPhaseSam]);
657 auto v10 = (paletteToRaw[src4 >> 4 ][sampleLUT[sample + 18] + subCarrierPhaseSam] << 16) | (paletteToRaw[src4 >> 4 ][sampleLUT[sample + 19] + subCarrierPhaseSam]);
658 auto v11 = (paletteToRaw[src4 >> 4 ][sampleLUT[sample + 20] + subCarrierPhaseSam] << 16) | (paletteToRaw[src4 & 0x0f][sampleLUT[sample + 21] + subCarrierPhaseSam]);
659 auto v12 = (paletteToRaw[src4 & 0x0f][sampleLUT[sample + 22] + subCarrierPhaseSam] << 16) | (paletteToRaw[src4 & 0x0f][sampleLUT[sample + 23] + subCarrierPhaseSam]);
671 *(dest32 + 10) = v11;
672 *(dest32 + 11) = v12;
679 if (scanLine >=
height - 1 && !ctrl->m_primitiveProcessingSuspended && spi_flash_cache_enabled() && ctrl->m_primitiveExecTask) {
682 vTaskNotifyGiveFromISR(ctrl->m_primitiveExecTask, NULL);
This file contains fabgl::CVBS16Controller definition.
This file contains some utility classes and functions.
NativePixelFormat
This enum defines the display controller native pixel format.
Color
This enum defines named colors.