Commit Graph

9 Commits

Author SHA1 Message Date
Pharap 7f456cff69
Make cabi C++ compatible
Casting the result of these calls to malloc should be all that is required to make cabi compilable as C++.
Without these casts cabi won't compile as C++ because in C++ `void *` is not implicitly convertible to other data types.
LodePNG already has C++ compatibility.
2022-05-01 08:41:41 +01:00
Andrew Dent b4b4d45009 Optimize png images
The project’s images have been run through lossless optimization.
It will not affect the project but saves a few bytes for each
download of the repository.
See: https://github.com/ace-dent/pngslim
2020-09-30 11:41:46 +01:00
Scott Allen 500d81abb7 Add image height check to cabi.c
An image converted using the cabi utility must have a height that is
a multiple of 8 pixels. An error is now reported if not.

Also, the README.md file for cabi was updated with this requirement.
2020-09-29 09:44:40 -04:00
Scott Allen c74438e377 Rewrite Cabi README.md with more details
Also added file sample.png in the cabi directory, which is used
for the example sketch in the Cabi README.md file

Also added a note referring to Cabi in the documentation for
drawCompressed()
2020-07-25 18:37:44 -04:00
Scott Allen 566557eab3 Delete trailing whitespace in cabi.c 2020-07-24 17:15:37 -04:00
Scott Allen 3345198d3d Eliminate compile warnings and minor mods for cabi
Compiler warnings generated by cabi.c were mostly due to
signed/unsigned mismatches and unused variables. Unused variables
were removed and most type int variables were changed to unsigned,
since there is no signed math or negative numbers required.

More detailed error messages are reported by using the LodePNG
capability to provide text descriptions for its error codes.

The default output array name prefix was changed
from "out" to "compressed_image".

Changed the on/off opaque/transparent thresholds from 128 to 127,
the half way point, because it makes more sense.

Added a program description to the usage output given when no
arguments are provided.

Other unused code was removed and some code was refactored.
2020-07-24 17:15:37 -04:00
Scott Allen 1bcf707616 Add LodePNG files used by cabi to read PNG files
Added lodepng.c (renamed from lodepng.cpp), lodepng.h and LICENSE from
the LodePNG project by Lode Vandevenne.
https://github.com/lvandeve/lodepng
Since this code is licensed separately from the cabi code, it has been
placed in its own subdirectory named lodepng.

cabi.c and README.md have been modified for the LodePNG file location.
2020-07-24 17:15:37 -04:00
Scott Allen 568a15ff87 Elaborate on description and CC0 waiver in cabi.c
Also renamed file LICENSE to COPYING as recommended for CC0
2020-07-24 17:15:37 -04:00
Scott Allen 966c2125f1 Add the Team A.R.G. cabi program to extras
cabi is a command line program written in C. Its purpose is to read
a PNG file containing a bitmap image and convert it to C/C++ code
suitable for use with the drawCompressed() function.

cabi was published by the Team A.R.G. organization. This organization
has been dissolved and its presence on the internet has been removed,
thus public access to cabi from them is no longer available.

A copy of the relevant cabi files has been added under the extras
directory to maintain a method of creating drawCompressed() compatible
bitmaps.
2020-07-24 17:15:37 -04:00