85#ifndef CORE_GP_GAMMA_CORRECTION_H
86#define CORE_GP_GAMMA_CORRECTION_H
214extern uint16_t gp_srgb8_to_lin10_tbl[256];
215extern uint8_t gp_lin10_to_srgb8_tbl[1024];
225 return gp_lin10_to_srgb8_tbl[(val + (1<<3))>>6];
236 return gp_srgb8_to_lin10_tbl[val]<<6;
gp_gamma * gp_gamma_incref(gp_gamma *gamma)
Increases reference counters.
gp_gamma * gp_correction_acquire(gp_pixel_type pixel_type, gp_correction_desc *corr_desc)
Acquires a gamma, sRGB, ... correction tables for a given pixel type.
static uint8_t gp_lin16_to_srgb8(uint16_t val)
Converts 16 bit linear value to 8 bit sRGB.
void gp_gamma_decref(gp_gamma *self)
Decreases reference counters.
void gp_gamma_print(const gp_gamma *self)
Prints info about gamma table into the stdout.
static uint16_t gp_srgb8_to_lin16(uint8_t val)
Converts 8 bit sRGB to 16 bit linear value.
const char * gp_correction_type_name(gp_correction_type type)
Returns correction name.
A pixel defintions generated from gen/include/gfxprim_config.py.
#define GP_PIXEL_CHANS_MAX
Maximal number of channels per all defined pixel types.
gp_pixel_type
List of all pixel types.
gp_correction_type
A list of supported correction types.
@ GP_CORRECTION_TYPE_GAMMA
Classical gamma correction.
@ GP_CORRECTION_TYPE_SRGB
Standard RGB.
A correction description.
float gamma
gamma for GP_CORRECTION_TYPE_GAMMA
gp_correction_type corr_type
Correction type.
uint8_t in_bits
Number of input bits.
float gamma
Gamma for GP_CORRECTION_GAMMA.
gp_correction_type corr_type
Correction type.
uint8_t u8[0]
8-bit lookup table pointer
unsigned int ref_count
Reference counter.
uint8_t out_bits
Number of output bits.
uint16_t u16[0]
16-bit lookup table pointer
A correction tables for all pixel channels.
unsigned int ref_count
Reference counter.
gp_gamma_table * lin[4]
Tables to linearize channel values.
gp_gamma_table * enc[4]
Tables to encode the values back.
gp_pixel_type pixel_type
Pixel type the table could be used for.