mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jules Maselbas <jmaselbas@kalray.eu>
To: barebox@lists.infradead.org
Cc: Jules Maselbas <jmaselbas@kalray.eu>
Subject: [PATCH v2 5/5] logo: Add choice for the QOI image format option
Date: Tue, 18 Jan 2022 00:02:35 +0100	[thread overview]
Message-ID: <20220117230235.13549-6-jmaselbas@kalray.eu> (raw)
In-Reply-To: <20220117230235.13549-1-jmaselbas@kalray.eu>

Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
---
 lib/logo/Kconfig  |  7 +++++++
 lib/logo/Makefile | 14 +++++++++++++-
 lib/logo/logo.c   |  2 ++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/lib/logo/Kconfig b/lib/logo/Kconfig
index 8edfaaeb51..a79806f54c 100644
--- a/lib/logo/Kconfig
+++ b/lib/logo/Kconfig
@@ -23,6 +23,13 @@ config BAREBOX_LOGO_BMP
 	help
 	  Encode logo with the BMP image format
 
+config BAREBOX_LOGO_QOI
+	bool "qoi"
+	select QOI
+	select QOICONV
+	help
+	  Encode logo with the QOI image format
+
 endchoice
 
 config BAREBOX_LOGO_64
diff --git a/lib/logo/Makefile b/lib/logo/Makefile
index 04c4906838..e04deb5536 100644
--- a/lib/logo/Makefile
+++ b/lib/logo/Makefile
@@ -51,6 +51,12 @@ extra-y += $(patsubst %,%.bmp,$(bblogo-y))
 %.bblogo: %.bmp FORCE
 	$(call if_changed,logo)
 endif
+ifdef CONFIG_BAREBOX_LOGO_QOI
+extra-y += $(patsubst %,%.png,$(bblogo-y))
+extra-y += $(patsubst %,%.qoi,$(bblogo-y))
+%.bblogo: %.qoi FORCE
+	$(call if_changed,logo)
+endif
 
 CONVERTOPTS += -background none
 
@@ -66,4 +72,10 @@ quiet_cmd_png = PNG     $@
 %.png: $(srctree)/Documentation/barebox.svg FORCE
 	$(call if_changed,png)
 
-clean-files += *.png *.bmp *.bblogo *.bblogo.S
+quiet_cmd_qoi = QOI     $@
+      cmd_qoi =	$(objtree)/scripts/qoiconv $< $@
+
+%.qoi: %.png FORCE
+	$(call if_changed,qoi)
+
+clean-files += *.png *.qoi *.bmp *.bblogo *.bblogo.S
diff --git a/lib/logo/logo.c b/lib/logo/logo.c
index 200eb992b3..a64f489939 100644
--- a/lib/logo/logo.c
+++ b/lib/logo/logo.c
@@ -38,6 +38,8 @@ static void load_logo(int width, void *start, void *end)
 		ext = "png";
 	else if (IS_ENABLED(CONFIG_BAREBOX_LOGO_BMP))
 		ext = "bmp";
+	else if (IS_ENABLED(CONFIG_BAREBOX_LOGO_QOI))
+		ext = "qoi";
 
 	filename = basprintf("/logo/barebox-logo-%d.%s", width, ext);
 	write_file(filename, start, size);
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  parent reply	other threads:[~2022-01-17 23:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17 23:02 [PATCH v2 0/5] Add support for QOI image format Jules Maselbas
2022-01-17 23:02 ` [PATCH v2 1/5] filetype: Add QOI format image type Jules Maselbas
2022-01-17 23:02 ` [PATCH v2 2/5] gui: Add qoi image format Jules Maselbas
2022-01-17 23:02 ` [PATCH v2 3/5] scripts: Add qoiconv to convert png to qoi Jules Maselbas
2022-01-17 23:02 ` [PATCH v2 4/5] logo: Enable image format selection for the logo Jules Maselbas
2022-01-17 23:28   ` Trent Piepho
2022-01-18 17:00     ` Jules Maselbas
2022-01-20  8:13     ` Sascha Hauer
2022-01-20 10:38       ` Jules Maselbas
2022-01-17 23:02 ` Jules Maselbas [this message]
2022-01-20  8:25 ` [PATCH v2 0/5] Add support for QOI image format Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220117230235.13549-6-jmaselbas@kalray.eu \
    --to=jmaselbas@kalray.eu \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox