babl is a dynamic, any to any, pixel format translation library.
Babl allows converting between different methods of storing pixels known as pixel formats that have with different bitdepths and other data representations, color models and component permutations.
A vocabulary to formulate new pixel formats from existing primitives is provided as well as the framework to add new color models and data types.
The simplest scenario for using babl is converting between linear buffers represented by an existing BablPixelFormat.
babl_process (babl_fish (babl_format ("srgb"), babl_format ("CIE Lab float")),
If the existing pixel formats are not sufficient for your conversion needs, new ones can be created on the fly. The constructor will provide the prior created one if duplicates are registered.
format = babl_format_new (babl_model ("R'G'B'"),
babl_process (babl_fish (source_format, destination_format),
Here are some key features of "Babl":
· Stable, small API.
· Self profiling and optimizing.
· ANSI C, works on win32, linux and mac, 32bit and 64bit systems.
· Extendable with new formats, color models, components and datatypes.
· Reference 64bit floating point conversions for datatypes and color models.
What's New in This Release: [ read full changelog ]
· Speed improvements due to: coalesced hashing, early bail out upon creation of duplicate formats, caching of non existing paths.
· Large amounts of the core has also been reviewed and refactored. Improved conversion coverage in the matrix.