diff options
author | Mattias Andrée <m@maandree.se> | 2025-03-02 22:18:45 +0100 |
---|---|---|
committer | Mattias Andrée <m@maandree.se> | 2025-03-02 22:18:45 +0100 |
commit | fd54698d12d468420d344f0ff4d5e502e04d64d4 (patch) | |
tree | 62fbc4488e3374b27dddffe00de665894e7eec41 /liblss16_encode_strerror.c | |
parent | First commit (diff) | |
download | liblss16-fd54698d12d468420d344f0ff4d5e502e04d64d4.tar.gz liblss16-fd54698d12d468420d344f0ff4d5e502e04d64d4.tar.bz2 liblss16-fd54698d12d468420d344f0ff4d5e502e04d64d4.tar.xz |
Add some functions needed fore encoding LSS16 files
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'liblss16_encode_strerror.c')
-rw-r--r-- | liblss16_encode_strerror.c | 21 |
1 files changed, 21 insertions, 0 deletions
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"; + } +} |