std/handsum: add Potato, Gray variants

This commit is contained in:
Nigel Tao committed 2026-04-13 00:20:06 +10:00
1 parent cbdc4d5f64
commit dd8db5dbb8
9 files changed
+465 -104

No files matched your search

+27 -5
View File
@@ -38,12 +38,12 @@ of running in a very restrictive sandbox (Linux's SECCOMP_MODE_STRICT).
See example/convert-to-nia and example/imageviewer in the Wuffs repository for
examples of using its C and C++ APIs.
Coming back to this program, pass the -demo flag to decode five versions of the
same image of the Mona Lisa, in Thumbhash, Handsum, PKM/ETC2, JPEG and PNG
formats. Only the last one is lossless.
Coming back to this program, pass the -demo flag to decode six versions of the
same image of the Mona Lisa, in Thumbhash, Handsum (HVXC), Handsum (HVPC),
PKM/ETC2, JPEG and PNG formats. Only the last one is lossless.
As of September 2024, the actual STB Image implementation only decodes two out
of five: JPEG and PNG. Wuffs' reimplementation decodes all five demo images.
As of April 2026, the actual STB Image implementation only decodes two out of
six: JPEG and PNG. Wuffs' reimplementation decodes all six demo images.
Define the DECODE_ONLY_JPEG macro to limit the variety of image file formats
that Wuffs decodes to just JPEG, for smaller binaries and faster compiles.
@@ -233,6 +233,23 @@ const uint8_t g_src_ptr__mona_lisa_21_32_hvxc_handsum[] = {
};
const size_t g_src_len__mona_lisa_21_32_hvxc_handsum = 48;
const uint8_t g_src_ptr__mona_lisa_21_32_hvpc_handsum[] = {
0xfe, 0xd7, 0xf4, 0x87, 0x7a, 0xa8, 0x87, 0x7b, 0x87, 0xa7, 0x84, 0x59,
0x47, 0x95, 0x98, 0xa4, 0x56, 0x78, 0x54, 0x77, 0x2a, 0x94, 0x59, 0x87,
0x93, 0x88, 0xfd, 0x96, 0x76, 0xa8, 0x97, 0x7b, 0xb8, 0x14, 0x5b, 0x2f,
0xb8, 0x97, 0x87, 0x14, 0x25, 0x7c, 0xa5, 0x66, 0x58, 0x18, 0x3e, 0xb8,
0xc4, 0x66, 0xa8, 0xb5, 0x48, 0x64, 0xb3, 0x66, 0x0a, 0x73, 0x36, 0x98,
0x83, 0x2b, 0x87, 0x71, 0x27, 0x6a, 0xa6, 0x66, 0x76, 0x81, 0x18, 0x79,
0x82, 0x14, 0x58, 0x34, 0x30, 0x88, 0x92, 0x48, 0x6b, 0x81, 0x17, 0x78,
0x91, 0x38, 0x7a, 0x63, 0x2a, 0x97, 0x81, 0x27, 0x8a, 0x71, 0x07, 0x78,
0x90, 0x18, 0x79, 0x87, 0x68, 0x77, 0x87, 0x79, 0x88, 0x87, 0x77, 0x85,
0xb7, 0x76, 0x78, 0x87, 0x79, 0xa7, 0x98, 0x8a, 0x97, 0x78, 0x79, 0xc8,
0x98, 0x9a, 0x88, 0x88, 0x99, 0xaa, 0x78, 0x89, 0x98, 0x88, 0x99, 0x8a,
0x69, 0x89, 0x98, 0x89, 0x97, 0x78, 0x88, 0x97, 0x79, 0x98, 0x98, 0x68,
0x89, 0x87, 0x89,
};
const size_t g_src_len__mona_lisa_21_32_hvpc_handsum = 147;
const uint8_t g_src_ptr__mona_lisa_21_32_etc2_pkm[] = {
0x50, 0x4b, 0x4d, 0x20, 0x32, 0x30, 0x00, 0x01, 0x00, 0x18, 0x00, 0x20,
0x00, 0x15, 0x00, 0x20, 0xb2, 0x74, 0x15, 0x32, 0x74, 0x8c, 0xb3, 0x18,
@@ -1021,6 +1038,11 @@ main(int argc, char** argv) {
g_src_ptr__mona_lisa_21_32_hvxc_handsum,
g_src_len__mona_lisa_21_32_hvxc_handsum,
},
{
"«demo»/mona-lisa.21x32.hvpc.handsum",
g_src_ptr__mona_lisa_21_32_hvpc_handsum,
g_src_len__mona_lisa_21_32_hvpc_handsum,
},
{
"«demo»/mona-lisa.21x32.etc2.pkm",
g_src_ptr__mona_lisa_21_32_etc2_pkm,