FFmpeg
Data Structures | Functions
palette.h File Reference
#include <math.h>
#include <stdint.h>
#include "libavutil/attributes.h"

Go to the source code of this file.

Data Structures

struct  Lab
 

Functions

int32_t ff_srgb_u8_to_linear_int (uint8_t x)
 Map sRGB 8-bit color component to a 16-bit linear value (gamma expand from electrical to optical value). More...
 
uint8_t ff_linear_int_to_srgb_u8 (int32_t x)
 Map a 16-bit linear value to a sRGB 8-bit color component (gamma compressed from optical to electrical value). More...
 
struct Lab ff_srgb_u8_to_oklab_int (uint32_t srgb)
 sRGB (non-linear) to OkLab conversion More...
 
uint32_t ff_oklab_int_to_srgb_u8 (struct Lab c)
 OkLab to sRGB (non-linear) conversion. More...
 
uint32_t ff_lowbias32 (uint32_t x)
 

Function Documentation

◆ ff_srgb_u8_to_linear_int()

int32_t ff_srgb_u8_to_linear_int ( uint8_t  x)

Map sRGB 8-bit color component to a 16-bit linear value (gamma expand from electrical to optical value).

Definition at line 113 of file palette.c.

◆ ff_linear_int_to_srgb_u8()

uint8_t ff_linear_int_to_srgb_u8 ( int32_t  x)

Map a 16-bit linear value to a sRGB 8-bit color component (gamma compressed from optical to electrical value).

Definition at line 118 of file palette.c.

Referenced by ff_oklab_int_to_srgb_u8().

◆ ff_srgb_u8_to_oklab_int()

struct Lab ff_srgb_u8_to_oklab_int ( uint32_t  srgb)

sRGB (non-linear) to OkLab conversion

See also
https://bottosson.github.io/posts/oklab/

Definition at line 170 of file palette.c.

Referenced by color_inc(), get_color_from_srgb(), and get_next_color().

◆ ff_oklab_int_to_srgb_u8()

uint32_t ff_oklab_int_to_srgb_u8 ( struct Lab  c)

OkLab to sRGB (non-linear) conversion.

See also
https://bottosson.github.io/posts/oklab/

Definition at line 194 of file palette.c.

Referenced by get_palette_frame().

◆ ff_lowbias32()

uint32_t ff_lowbias32 ( uint32_t  x)

Definition at line 211 of file palette.c.

Referenced by color_get(), and color_inc().