From fd54698d12d468420d344f0ff4d5e502e04d64d4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 2 Mar 2025 22:18:45 +0100 Subject: Add some functions needed fore encoding LSS16 files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- liblss16_encode_strerror.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 liblss16_encode_strerror.c (limited to 'liblss16_encode_strerror.c') diff --git a/liblss16_encode_strerror.c b/liblss16_encode_strerror.c new file mode 100644 index 0000000..a5fcd49 --- /dev/null +++ b/liblss16_encode_strerror.c @@ -0,0 +1,21 @@ +/* See LICENSE file for copyright and license details. */ +#include "liblss16.h" + + +const char * +liblss16_encode_strerror(enum liblss16_encode_error error) +{ + switch (error) { + case LIBLSS16_ENCODE_BAD_IMAGE_SIZE: + return "Unencodable image: unsupported image size"; + + case LIBLSS16_ENCODE_BAD_COLOUR: + return "Invalid colour map: 6-bit colours encoded with additional bits"; + + case LIBLSS16_ENCODE_BAD_COLOUR_INDEX: + return "Invalid image: colour index out of range"; + + default: + return "Unrecognised error"; + } +} -- cgit v1.2.3-70-g09d2