FFmpeg
|
Go to the source code of this file.
Macros | |
#define | K ((1 << 16) - 1) |
#define | K2 ((int64_t)K*K) |
#define | P ((1 << 9) - 1) |
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... | |
static int32_t | cbrt01_int (int32_t x) |
static int64_t | div_round64 (int64_t a, int64_t b) |
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) |
Variables | |
static const uint16_t | srgb2linear [256] |
Table mapping formula: f(x) = x < 0.04045 ? x/12.92 : ((x+0.055)/1.055)^2.4 (sRGB EOTF) Where x is the normalized index in the table and f(x) the value in the table. More... | |
static const uint8_t | linear2srgb [P+1] |
Table mapping formula: f(x) = x < 0.0031308 ? x*12.92 : 1.055*x^(1/2.4)-0.055 (sRGB OETF) Where x is the normalized index in the table and f(x) the value in the table. More... | |
int32_t ff_srgb_u8_to_linear_int | ( | uint8_t | x | ) |
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().
Definition at line 135 of file palette.c.
Referenced by ff_srgb_u8_to_oklab_int().
|
static |
Definition at line 168 of file palette.c.
Referenced by ff_oklab_int_to_srgb_u8(), and ff_srgb_u8_to_oklab_int().
struct Lab ff_srgb_u8_to_oklab_int | ( | uint32_t | srgb | ) |
sRGB (non-linear) to OkLab conversion
Definition at line 170 of file palette.c.
Referenced by color_inc(), get_color_from_srgb(), and get_next_color().
uint32_t ff_oklab_int_to_srgb_u8 | ( | struct Lab | c | ) |
OkLab to sRGB (non-linear) conversion.
Definition at line 194 of file palette.c.
Referenced by get_palette_frame().
uint32_t ff_lowbias32 | ( | uint32_t | x | ) |
Definition at line 211 of file palette.c.
Referenced by color_get(), and color_inc().
|
static |
Table mapping formula: f(x) = x < 0.04045 ? x/12.92 : ((x+0.055)/1.055)^2.4 (sRGB EOTF) Where x is the normalized index in the table and f(x) the value in the table.
f(x) is remapped to [0;K] and rounded.
Definition at line 35 of file palette.c.
Referenced by ff_srgb_u8_to_linear_int(), and ff_srgb_u8_to_oklab_int().
|
static |
Table mapping formula: f(x) = x < 0.0031308 ? x*12.92 : 1.055*x^(1/2.4)-0.055 (sRGB OETF) Where x is the normalized index in the table and f(x) the value in the table.
f(x) is remapped to [0;0xff] and rounded.
Since a 16-bit table is too large, we reduce its precision to 9-bit.
Definition at line 78 of file palette.c.
Referenced by ff_linear_int_to_srgb_u8().