util: add SMPTE pattern support for C1 format
authorGeert Uytterhoeven <geert@linux-m68k.org>
Thu, 30 Jun 2022 16:14:04 +0000 (18:14 +0200)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 24 Oct 2023 07:44:29 +0000 (09:44 +0200)
commit6b9b4627294fd54acd4ed5af0c72f88a303dbc0f
treec2224076d19a51a1ad09001bc271fa4bcc9dcfd5
parent15c6657617a38527b8c4698d3f56cd6cbd55e3fb
util: add SMPTE pattern support for C1 format

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

As only two colors are available, the pattern is drawn in black and
white, using Floyd-Steinberg dithering[1].

[1] https://en.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dithering

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/1waJczErrIaEKRhBCCU1ynxRG8agpo0Xx/view

v5:
  - Add Reviewed-by,

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

v3:
  - Add Acked-by,
  - Add Wikipedia link,

v2:
  New.
tests/util/pattern.c