Gjsify LogoGjsify Logo

Index

Variables

ALPHA_FLOOR: number
ALPHA_FLOOR_F: number
MAJOR_VERSION: number
MICRO_VERSION: number
MINOR_VERSION: number

Functions

  • Returns the babl object representing the color component given by name such as for example "R", "cyan" or "CIE L".

    Parameters

    • name: string

    Returns Babl.Object

  • exit(): void
  • Deinitializes the babl library and frees any resources used when matched with the number of calls to babl_init().

    Returns void

  • fast_fish(source_format: object, destination_format: object, performance: string): Babl.Object
  • 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"

    Fast fishes should be cached, since they are not internally kept track of/made into singletons by babl and many creations of fast fishes will otherwise be a leak.

    Parameters

    • source_format: object
    • destination_format: object
    • performance: string

    Returns Babl.Object

  • fish(source_format: object, destination_format: object): Babl.Object
  • 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.

    Parameters

    • source_format: object
    • destination_format: object

    Returns Babl.Object

  • 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.

    Parameters

    • encoding: string

    Returns Babl.Object

  • format_exists(name: string): number
  • 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).

    Parameters

    • name: string

    Returns number

  • format_get_bytes_per_pixel(format: Babl.Object): number
  • format_get_n_components(format: Babl.Object): number
  • 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.

    Parameters

    Returns Babl.Object

  • get_version(): [number, number, number]
  • icc_get_key(icc_data: string, icc_length: number, key: string, language: string, country: string): string
  • icc_make_space(icc_data: string, icc_length: number, intent: IccIntent, error: string): Babl.Object
  • init(): void
  • Returns the babl object representing the color model given by name such as for example "RGB", "CMYK" or "CIE Lab".

    Parameters

    • name: string

    Returns Babl.Object

  • model_is(babl: Babl.Object, model_name: string): number
  • 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.

    Parameters

    Returns Babl.Object

  • 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.

    Parameters

    Returns Babl.Object

  • Assign a palette to a palette format, the data is a single span of pixels representing the colors of the palette.

    Parameters

    • babl: Babl.Object

      a #Babl

    • format: Babl.Object

      The pixel format

    • data: Uint8Array

      The pixel data

    • count: number

      The number of pixels in data

    Returns void

  • process(babl_fish: Babl.Object, source: object, destination: object, n: number): number
  • Process n pixels from source to destination using babl_fish, returns number of pixels converted.

    Parameters

    • babl_fish: Babl.Object
    • source: object
    • destination: object
    • n: number

    Returns number

  • process_rows(babl_fish: Babl.Object, source: object, source_stride: number, dest: object, dest_stride: number, n: number, rows: number): number
  • sampling(horizontal: number, vertical: number): Babl.Object
  • Returns the babl object representing the horizontal and vertical sampling such as for example 2, 2 for the chroma components in YCbCr.

    Parameters

    • horizontal: number
    • vertical: number

    Returns Babl.Object

  • 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

    Parameters

    • name: string

    Returns Babl.Object

  • 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;

    Internally this does the math to derive the RGBXYZ matrix as used in an ICC profile.

    Parameters

    • name: string

      The name for the color space

    • wx: number

      The X-coordinate of the color space's white point

    • wy: number

      The Y-coordinate of the color space's white point

    • rx: number

      The X-coordinate of the red primary

    • ry: number

      The Y-coordinate of the red primary

    • gx: number

      The X-coordinate of the green primary

    • gy: number

      The Y-coordinate of the green primary

    • bx: number

      The X-coordinate of the blue primary

    • by: number

      The Y-coordinate of the blue primary

    • trc_red: Babl.Object

      The red component of the TRC.

    • trc_green: Babl.Object

      The green component of the TRC (can be %NULL if it's the same as trc_red).

    • trc_blue: Babl.Object

      The blue component of the TRC (can be %NULL if it's the same as trc_red).

    • flags: SpaceFlags

      The #BablSpaceFlags

    Returns Babl.Object

  • 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.

    On a profile that doesn't contain A2B0 and B2A0 CLUTs perceptual and relative-colorimetric intents are treated the same.

    If a BablSpace cannot be created from the profile NULL is returned and a static string is set on the const char *value pointed at with &value containing a message describing why the provided data does not yield a babl space.

    Parameters

    • icc_data: string

      pointer to icc profile in memory

    • icc_length: number

      length of icc profile in bytes

    • intent: IccIntent

      the intent from the ICC profile to use.

    Returns [Babl.Object, string]

  • space_from_rgbxyz_matrix(name: string, wx: number, wy: number, wz: number, rx: number, gx: number, bx: number, ry: number, gy: number, by: number, rz: number, gz: number, bz: number, trc_red: Babl.Object, trc_green: Babl.Object, trc_blue: Babl.Object): Babl.Object
  • 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.

    Parameters

    • name: string

      The name for the color space

    • wx: number

      The X-coordinate of the color space's white point

    • wy: number

      The Y-coordinate of the color space's white point

    • wz: number

      The Z-coordinate of the color space's white point

    • rx: number

      The X-coordinate of the red primary

    • gx: number

      The X-coordinate of the green primary

    • bx: number

      The X-coordinate of the blue primary

    • ry: number

      The Y-coordinate of the red primary

    • gy: number

      The Y-coordinate of the green primary

    • by: number

      The Y-coordinate of the blue primary

    • rz: number

      The Z-coordinate of the red primary

    • gz: number

      The Z-coordinate of the green primary

    • bz: number

      The Z-coordinate of the blue primary

    • trc_red: Babl.Object

      The red component of the TRC.

    • trc_green: Babl.Object

      The green component of the TRC (can be %NULL if it's the same as trc_red).

    • trc_blue: Babl.Object

      The blue component of the TRC (can be %NULL if it's the same as trc_red).

    Returns Babl.Object

  • space_get_icc(babl: Babl.Object): [string, number]
  • 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.

    Parameters

    Returns [string, number]

  • space_get_rgb_luminance(space: Babl.Object): [number, number, number]
  • Creates a Babl TRC for a specific gamma value, it will be given a name that is a short string representation of the value.

    Parameters

    • gamma: number

    Returns Babl.Object

  • Returns the babl object representing the data type given by name such as for example "u8", "u16" or "float".

    Parameters

    • name: string

    Returns Babl.Object

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method