From 99cc599f92e1316a8b8706ecab8f7f85aff55853 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Wed, 28 Jun 2023 13:59:26 +1000 Subject: [PATCH] example/toy-aux-image: comment on config macros --- example/toy-aux-image/toy-aux-image.cc | 30 ++++++++++++++++++++++++++ example/toy-genlib/toy-genlib.c | 4 ++++ 2 files changed, 34 insertions(+) diff --git a/example/toy-aux-image/toy-aux-image.cc b/example/toy-aux-image/toy-aux-image.cc index a25e71f6..74356c55 100644 --- a/example/toy-aux-image/toy-aux-image.cc +++ b/example/toy-aux-image/toy-aux-image.cc @@ -24,6 +24,29 @@ To run: $CXX toy-aux-image.cc && ./a.out; rm -f a.out for a C++ compiler $CXX, such as clang++ or g++. + +The expected output: + +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@X@@@@XX@@@@@@@@@@X +XXXXX@@XXX@@@@@@@II@@@X@X@@@@@ +XXXXX@@XX@@X@@@XO+XXX@XX@@@X@@ +XXXXXXXX@XX@X@XI=I@@XXI+OXX@XX +XXXXXXXXXXXXXXX+=+OXO+=::OXX@X +XXXXXXXXXXXXXXXXXX=+==:::=XXXX +XXXXXXXXO+:::::+OO+===+OI=+XXX +XXXO::=++:::==+++XI+++X@XXO@XX +XXXO=X@X+::=::::+O++=I@XX@XXXX +XXXXX@XXX=:::::::::=+@XXXX@XXX +XXXXXXXX@O::IXO=::::O@@XXXXXXX +XXXXXXXXO=X+X@@XX::O@@XXXXXXXX +XXXXXXXXXOO=X@X@X+OIXXXXXXXXXX +XXXXXXXXXXX+IIXX+X@OX@XXXXXXXX +XXXXXXXXX@XXOI+IIOOOXXXXXXXXXX +XXXXXXXXXXX@XXXXX@XXXXXXXXXXXX +XXXXXXXXXXXXXXXXX@XXXXXXXXXXXX +OOOOXXXXXXXXXXOXXXXXXXXXXXXOOO +=+++IIIIIIIOOOOOOOOOOIIIIIIII+ */ // Wuffs ships as a "single file C library" or "header file library" as per @@ -149,6 +172,13 @@ decode() { // example program just prints an ASCII value based on the high 3 bits of // the blue channel value. // + // This example program also configures wuffs_aux::DecodeImage to only + // support JPEG images (and not BMP, PNG, etc). To add support for other + // image file formats, add e.g. "#define WUFFS_CONFIG__MODULE__BMP" (and + // any dependencies) next to the "#define WUFFS_CONFIG__MODULE__JPEG" + // line above. Dependencies are listed at + // https://github.com/google/wuffs/tree/main/doc/std#modules-and-dependencies + // // Calling the color_u32_at method is simple and easy, but like any // one-call-per-pixel approach, it has some performance overhead. An // alternative approach calls result.pixbuf.plane instead, to get the diff --git a/example/toy-genlib/toy-genlib.c b/example/toy-genlib/toy-genlib.c index f9b33ef1..6eb735e4 100644 --- a/example/toy-genlib/toy-genlib.c +++ b/example/toy-genlib/toy-genlib.c @@ -30,6 +30,10 @@ LD_LIBRARY_PATH=../../gen/lib/c/$CC-dynamic ./a.out rm -f a.out for a C compiler $CC, such as clang or gcc. + +The expected output: + +Hello Wuffs. */ #include