Files
wuffs/doc/std
Nigel Tao 0bbc4c0083 std/jpeg: add new package
This is just a placeholder decoder implementation (and all of the
required plumbing) that produces a 1x1 reddish-purple image. Follow-up
commits will add flesh to the metaphorical bones.

Updates #42
2023-04-21 18:33:00 +10:00
..
2023-04-21 18:33:00 +10:00
2022-06-03 14:15:13 +10:00
2022-02-06 13:30:46 +11:00

Standard Library

Wuffs' standard library consists of multiple packages, each implementing a particular file format or algorithm. Those packages can be grouped into several categories:

The general pattern is that a package foo (e.g. jpeg, png) contains a struct bar (e.g. hasher, decoder, etc) that implements a package-independent interface. For example, every compression decoder struct would have a transform_io method. In C, this would be invoked as

// Allocate and initialize the struct.
wuffs_foo__decoder* dec = etc;

// Do the work. Error checking is not shown, for brevity.
wuffs_base__status status = wuffs_foo__decoder__transform_io(dec, etc);

When that C library is used as C++, that last line can be shortened:

wuffs_base__status status = dec->transform_io(etc);

See also the glossary, as well as the notes on:

Modules and Dependencies

By default, building Wuffs' standard library builds the entire thing (provided that you've defined the WUFFS_IMPLEMENTATION C macro), implementing a variety of codecs and file formats.

Packages can be individually allow-listed, for smaller binaries and faster compiles. Opt in by also defining WUFFS_CONFIG__MODULES and then also WUFFS_CONFIG__MODULE__ETC for each ETC (and its dependencies, listed below) to enable.

  • ADLER32: BASE
  • BMP: BASE
  • CBOR: BASE
  • CRC32: BASE
  • DEFLATE: BASE
  • GIF: BASE, LZW
  • GZIP: BASE, CRC32, DEFLATE
  • JSON: BASE
  • LZW: BASE
  • NIE: BASE
  • PNG: BASE, ADLER32, CRC32, DEFLATE, ZLIB
  • TGA: BASE
  • WBMP: BASE
  • ZLIB: BASE, ADLER32, DEFLATE

For the auxiliary modules:

  • AUX_CBOR: AUX_BASE, BASE, CBOR
  • AUX_IMAGE: AUX_BASE, BASE and whichever image-related modules (and their dependencies) you want, e.g. GIF, PNG, etc.
  • AUX_JSON: AUX_BASE, BASE, JSON