Gamma and sRGB corrections.
More...
Go to the source code of this file.
Gamma and sRGB corrections.
Definition in file gp_gamma_correction.h.
◆ gp_gamma
A correction tables for all pixel channels.
Contains pointers to lookup tables for each pixel channel for linearization and inverse transformation. Linearization produces a values with a few more bits, e.g. for 8bit value you end up with at least 10bits to correctly encode the linearized values.
◆ gp_correction_acquire()
Acquires a gamma, sRGB, ... correction tables for a given pixel type.
- Parameters
-
pixel_type | A pixel type to build the tables for |
corr_desc | A correction description. |
- Returns
- Correction tables.
◆ gp_correction_type_name()
Returns correction name.
- Parameters
-
- Returns
- A correction name.
◆ gp_gamma_decref()
Decreases reference counters.
Decreases reference counters and frees the table if counters drop to zero.
- Parameters
-
◆ gp_gamma_incref()
Increases reference counters.
Increases reference counters for gamma tables. Each time a pixmap is duplicated or new pixmap is created as a result of filters the newly created pixmap needs to inherit the gamma correction tables.
- Parameters
-
- Returns
- A pointer to the gamma table passed as argument.
◆ gp_gamma_print()
void gp_gamma_print |
( |
const gp_gamma * |
self | ) |
|
Prints info about gamma table into the stdout.
- Parameters
-
◆ gp_lin16_to_srgb8()
static uint8_t gp_lin16_to_srgb8 |
( |
uint16_t |
val | ) |
|
|
inlinestatic |
Converts 16 bit linear value to 8 bit sRGB.
- Parameters
-
val | A linear 16 bit value. |
- Returns
- A sRGB 8 bit value.
Definition at line 223 of file gp_gamma_correction.h.
◆ gp_srgb8_to_lin16()
static uint16_t gp_srgb8_to_lin16 |
( |
uint8_t |
val | ) |
|
|
inlinestatic |
Converts 8 bit sRGB to 16 bit linear value.
- Parameters
-
- Returns
- A 16 bit linear value.
Definition at line 234 of file gp_gamma_correction.h.