util: add SMPTE pattern support for C2 format
authorGeert Uytterhoeven <geert@linux-m68k.org>
Thu, 30 Jun 2022 16:19:27 +0000 (18:19 +0200)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 24 Oct 2023 07:44:49 +0000 (09:44 +0200)
commitc895650f5de52b6ddcbf4594374db94e5ae76c7a
tree6859f0e95ac3d935beb84a2857b468ce944f7b91
parent6b9b4627294fd54acd4ed5af0c72f88a303dbc0f
util: add SMPTE pattern support for C2 format

Add support for drawing the SMPTE pattern in a buffer using the C2
indexed format.

As only four colors are available, resolution is halved, and the pattern
is drawn in a PenTile RG-GB matrix, using Floyd-Steinberg dithering.
The magnitude of the green subpixels is reduced, as there are twice as
many green subpixels as red or blue subpixels.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
Dithering example at https://drive.google.com/file/d/1g5O8XeacrjrC8rgaVENvR65YeI6QvmtO/view

v5:
  - Add Reviewed-by,

v4:
  - Replace FILL_COLOR() use by pentile_color_lut[],

v3:
  - Add Acked-by,

v2:
  - New.
tests/util/pattern.c