### Namespace

# Babl – 0.1

Babl library

Version | 0.1.126
Authors | Babl contributors
License | LGPL-3.0-or-later
Website | https://www.gegl.org/babl/
Source | https://gitlab.gnome.org/GNOME/babl/

#### Build

C headers | `babl.h`
pkg-config files | `babl-0.1`

#### Unions

Object | The babl API is based around polymorphism and almost everything is a Babl object.

#### Enumerations

IccIntent |
SpaceFlags |

#### Bitfields

ModelFlag |

#### Callbacks

FishProcess |
FuncLinear |
FuncPlanar |

#### Functions

component | Returns the babl object representing the color component given by `name` such as for example “R”, “cyan” or “CIE L”.
component_new | Defines a new color component with babl.
conversion_get_destination_space | Returns the RGB space defined for the destination of conversion.
conversion_get_source_space | Returns the RGB space defined for the source of conversion.
conversion_new | Defines a new conversion between either two formats, two models or two types in babl.
exit | Deinitializes the babl library and frees any resources used when matched with the number of calls to babl_init().
fast_fish | Create a faster than normal fish with specified performance (and thus corresponding precision tradeoff), values tolerance can hold: NULL and “default”, means do same as babl_fish(), other values understood in increasing order of speed gain are: “exact” “precise” “fast” “glitch”.
fish | Create a babl fish capable of converting from source_format to destination_format, source and destination can be either strings with the names of the formats or Babl-format objects.
fish_get_process | Get the dispatch function of a fish, this allows faster use of a fish in a loop than the more indirect method of babl_process, this also avoids base-level instrumentation.
format | Returns the babl object representing the color format given by `name` such as for example “RGB u8”, “CMYK float” or “CIE Lab u16”, creates a format using the sRGB space, to also specify the color space and TRCs for a format, see babl_format_with_space.
format_exists | Returns 1 if the provided format name is known by babl or 0 if it is not. Can also be used to verify that specific extension formats are available (though this can also be inferred from the version of babl).
format_get_bytes_per_pixel | Returns the bytes per pixel for a babl color format.
format_get_encoding | Returns the components and data type, without space suffix.
format_get_model | Return the model used for constructing the format.
format_get_n_components | Returns the number of components for the given `format`.
format_get_space |
format_get_type | Returns the type in the given `format` for the given `component_index`.
format_has_alpha | Returns whether the `format` has an alpha channel.
format_is_format_n | Returns whether the `format` is a format_n type.
format_is_palette | Check whether a format is a palette backed format.
format_n |
format_new | Defines a new pixel format in babl. Provided BablType and|or BablSampling is valid for the following components as well. If no name is provided a (long) descriptive name is used.
format_with_space | Returns the babl object representing the color format given by `name` such as for example “RGB u8”, “R’G’B’A float”, “Y float” with a specific RGB working space used as the space, the resulting format has -space suffixed to it, unless the space requested is sRGB then the unsuffixed version is used. If a format is passed in as space the space of the format is used.
gc | Do a babl fish garbage collection cycle, should only be called from the main thread with no concurrent babl processing in other threads in paralell.
get_model_flags |
get_name | Returns a string describing a Babl object.
get_user_data | Get data set with babl_set_user_data.
get_version | Get the version information on the babl library.
icc_get_key |
icc_make_space |
init | Initializes the babl library.
introspect | Introspect a given BablObject.
model | Returns the babl object representing the color model given by `name` such as for example “RGB”, “CMYK” or “CIE Lab”.
model_is |
model_new | Defines a new color model in babl. If no name is provided a name is generated by concatenating the name of all the involved components.
model_with_space | The models for formats also have a space in babl, try to avoid code needing to use this.
new_palette | Create a new palette based format, name is optional pass in NULL to get an anonymous format. If you pass in with_alpha the format also gets an 8bit alpha channel. Returns the BablModel of the color model. If you pass in the same name the previous formats will be provided again.
new_palette_with_space | Create a new palette based format, name is optional pass in NULL to get an anonymous format. If you pass in with_alpha the format also gets an 8bit alpha channel. Returns the BablModel of the color model. If you pass in the same name the previous formats will be provided again.
palette_reset | Reset a palette to initial state, frees up some caches that optimize conversions.
palette_set_palette | Assign a palette to a palette format, the data is a single span of pixels representing the colors of the palette.
process | Process n pixels from source to destination using babl_fish, returns number of pixels converted.
process_rows |
sampling | Returns the babl object representing the `horizontal` and `vertical` sampling such as for example 2, 2 for the chroma components in YCbCr.
set_user_data | Associate a data pointer with a format/model, this data can be accessed and used from the conversion functions, encoding color profiles, palettes or similar with the data, perhaps this should be made internal API, not accesible at all from.
space | Returns the babl object representing the specific RGB matrix color working space referred to by name. Babl knows of: sRGB, Rec2020, Adobish, Apple and ProPhoto.
space_from_chromaticities | Creates a new babl-space/ RGB matrix color space definition with the specified CIE xy(Y) values for white point: wx, wy and primary chromaticities: rx,ry,gx,gy,bx,by and TRCs to be used. After registering a new babl-space it can be used with `babl_space()` passing its name;.
space_from_icc | Create a babl space from an in memory ICC profile, the profile does no longer need to be loaded for the space to work, multiple calls with the same icc profile and same intent will result in the same babl space.
space_from_rgbxyz_matrix | Creates a new RGB matrix color space definition using a precomputed D50 adapted 3x3 matrix and associated CIE XYZ whitepoint, as possibly read from an ICC profile.
space_get | Query the chromaticities of white point and primaries as well as trcs used for r g a nd b, all arguments are optional (can be `NULL`).
space_get_gamma |
space_get_icc | Return pointer to ICC profile for space note that this is the ICC profile for R’G’B’, though in formats only supporting linear like EXR GEGL chooses to load this lienar data as RGB and use the sRGB TRC.
space_get_rgb_luminance | Retrieve the relevant RGB luminance constants for a babl space.
space_is_cmyk |
space_is_gray |
space_is_rgb |
space_with_trc | Creates a variant of an existing space with different trc.
trc | Look up a TRC by name, “sRGB” and “linear” are recognized strings in a stock babl configuration.
trc_gamma | Creates a Babl TRC for a specific gamma value, it will be given a name that is a short string representation of the value.
type | Returns the babl object representing the data type given by `name` such as for example “u8”, “u16” or “float”.
type_new | Defines a new data type in babl. A data type that babl can have in its buffers requires conversions to and from “double” to be registered before passing sanity.

#### Constants

ALPHA_FLOOR |
ALPHA_FLOOR_F |
MAJOR_VERSION |
MICRO_VERSION |
MINOR_VERSION |