Babl – 0.1
Description: Reference for Babl-0.1

### Namespace

# Babl – 0.1

Babl library

Version | 0.1.108
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`

#### Additional documentation

- Classes Hierarchy

#### Unions

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

#### Enumerations

IccIntent | since: 0.1
SpaceFlags | since: 0.1

#### Bitfields

ModelFlag | since: 0.1

#### Callbacks

FishProcess | since: 0.1
FuncLinear | since: 0.1
FuncPlanar | since: 0.1

#### Functions

component | Returns the babl object representing the color component given by `name` such as for example “R”, “cyan” or “CIE L”. since: 0.1
component_new | Defines a new color component with babl. since: 0.1
conversion_get_destination_space | Returns the RGB space defined for the destination of conversion. since: 0.1
conversion_get_source_space | Returns the RGB space defined for the source of conversion. since: 0.1
conversion_new | Defines a new conversion between either two formats, two models or two types in babl. since: 0.1
exit | Deinitializes the babl library and frees any resources used when matched with the number of calls to babl_init(). since: 0.1
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” since: 0.1
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. since: 0.1
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. since: 0.1
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. since: 0.1
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). since: 0.1
format_get_bytes_per_pixel | Returns the bytes per pixel for a babl color format. since: 0.1
format_get_encoding | Returns the components and data type, without space suffix. since: 0.1
format_get_model | Return the model used for constructing the format. since: 0.1
format_get_n_components | Returns the number of components for the given `format`. since: 0.1
format_get_space | since: 0.1
format_get_type | Returns the type in the given `format` for the given `component_index`. since: 0.1
format_has_alpha | Returns whether the `format` has an alpha channel. since: 0.1
format_is_format_n | Returns whether the `format` is a format_n type. since: 0.1
format_is_palette | Check whether a format is a palette backed format. since: 0.1
format_n | since: 0.1
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. since: 0.1
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. since: 0.1
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. since: 0.1
get_model_flags | since: 0.1
get_name | Returns a string describing a Babl object. since: 0.1
get_user_data | Get data set with babl_set_user_data. since: 0.1
get_version | Get the version information on the babl library. since: 0.1
icc_get_key | since: 0.1
icc_make_space | since: 0.1
init | Initializes the babl library. since: 0.1
introspect | Introspect a given BablObject. since: 0.1
model | Returns the babl object representing the color model given by `name` such as for example “RGB”, “CMYK” or “CIE Lab”. since: 0.1
model_is | since: 0.1
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. since: 0.1
model_with_space | The models for formats also have a space in babl, try to avoid code needing to use this. since: 0.1
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. since: 0.1
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. since: 0.1
palette_reset | Reset a palette to initial state, frees up some caches that optimize conversions. since: 0.1
palette_set_palette | Assign a palette to a palette format, the data is a single span of pixels representing the colors of the palette. since: 0.1
process | Process n pixels from source to destination using babl_fish, returns number of pixels converted. since: 0.1
process_rows | since: 0.1
sampling | Returns the babl object representing the `horizontal` and `vertical` sampling such as for example 2, 2 for the chroma components in YCbCr. since: 0.1
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. since: 0.1
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. since: 0.1
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; since: 0.1
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. since: 0.1
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. since: 0.1
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`). since: 0.1
space_get_gamma | since: 0.1
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. since: 0.1
space_get_rgb_luminance | Retrieve the relevant RGB luminance constants for a babl space. since: 0.1
space_is_cmyk | since: 0.1
space_is_gray | since: 0.1
space_is_rgb | since: 0.1
space_with_trc | Creates a variant of an existing space with different trc. since: 0.1
trc | Look up a TRC by name, “sRGB” and “linear” are recognized strings in a stock babl configuration. since: 0.1
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. since: 0.1
type | Returns the babl object representing the data type given by `name` such as for example “u8”, “u16” or “float”. since: 0.1
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. since: 0.1

#### Constants

ALPHA_FLOOR | since: 0.1
ALPHA_FLOOR_F | since: 0.1
MAJOR_VERSION | since: 0.1
MICRO_VERSION | since: 0.1
MINOR_VERSION | since: 0.1