aboutsummaryrefslogtreecommitdiff
path: root/tests/unity/unity_support.c
diff options
context:
space:
mode:
authorZoltan Janosy <janosy.zoltan@gmail.com>2024-04-20 13:14:25 +0200
committerGitHub <noreply@github.com>2024-04-20 13:14:25 +0200
commitabc8a7292ac816bac8f78e9918876cf608c48de1 (patch)
tree23d2007434b178998504d3ec8651a01eac074489 /tests/unity/unity_support.c
parentbe4a9d1e735f191151aae5acf4a2018ca2e86f0b (diff)
downloadlvgl-abc8a7292ac816bac8f78e9918876cf608c48de1.tar.gz
lvgl-abc8a7292ac816bac8f78e9918876cf608c48de1.zip
feat(draw/sw): added support for LV_COLOR_FORMAT_L8 (#5800)
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com> Signed-off-by: qinshijing <qinshijing@xiaomi.com> Co-authored-by: Zoltan Janosy <zjanosy@fishman.com> Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com> Co-authored-by: VIFEX <vifextech@foxmail.com> Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com> Co-authored-by: Niklas Fiekas <niklas.fiekas@sartorius.com> Co-authored-by: qinshijing <51692568+qinshijing@users.noreply.github.com> Co-authored-by: qinshijing <qinshijing@xiaomi.com> Co-authored-by: Neo Xu <neo.xu1990@gmail.com>
Diffstat (limited to 'tests/unity/unity_support.c')
-rw-r--r--tests/unity/unity_support.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/unity/unity_support.c b/tests/unity/unity_support.c
index c045d6ddf..a2a563977 100644
--- a/tests/unity/unity_support.c
+++ b/tests/unity/unity_support.c
@@ -1,4 +1,4 @@
-/**
+/**
* @file lv_test_assert.c
*
* Copyright 2002-2010 Guillaume Cottenceau.
@@ -423,6 +423,36 @@ static void buf_to_xrgb8888(const uint8_t * buf_in, uint8_t * buf_out, lv_color_
buf_out += 800 * 4;
}
}
+ else if(cf_in == LV_COLOR_FORMAT_L8) {
+ uint32_t y;
+ for(y = 0; y < 480; y++) {
+ uint32_t x;
+ for(x = 0; x < 800; x++) {
+ buf_out[x * 4 + 3] = 0xff;
+ buf_out[x * 4 + 2] = buf_in[x];
+ buf_out[x * 4 + 1] = buf_in[x];
+ buf_out[x * 4 + 0] = buf_in[x];
+ }
+
+ buf_in += stride;
+ buf_out += 800 * 4;
+ }
+ }
+ else if (cf_in == LV_COLOR_FORMAT_AL88) {
+ uint32_t y;
+ for (y = 0; y < 480; y++) {
+ uint32_t x;
+ for (x = 0; x < 800; x++) {
+ buf_out[x * 4 + 3] = buf_in[x * 2 + 1];
+ buf_out[x * 4 + 2] = buf_in[x * 2 + 0];
+ buf_out[x * 4 + 1] = buf_in[x * 2 + 0];
+ buf_out[x * 4 + 0] = buf_in[x * 2 + 0];
+ }
+
+ buf_in += stride;
+ buf_out += 800 * 4;
+ }
+ }
}
static void create_folders_if_needed(const char * path)