GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
Gamma and sRGB corrections. More...
#include <stdint.h>
#include <core/gp_types.h>
#include <core/gp_pixel.gen.h>
#include <core/gp_gamma_correction.gen.h>
Go to the source code of this file.
Data Structures | |
struct | gp_gamma_table |
A lookup gamma table. More... | |
struct | gp_gamma |
A correction tables for all pixel channels. More... | |
Typedefs | |
typedef enum gp_correction_type | gp_correction_type |
A list of supported correction types. | |
typedef struct gp_gamma_table | gp_gamma_table |
A lookup gamma table. | |
typedef struct gp_gamma | gp_gamma |
A correction tables for all pixel channels. | |
Enumerations | |
enum | gp_correction_type { GP_CORRECTION_GAMMA , GP_CORRECTION_SRGB } |
A list of supported correction types. More... | |
Functions | |
gp_gamma * | gp_gamma_acquire (gp_pixel_type pixel_type, gp_correction_type corr_type, float gamma) |
Acquires a gamma tables for a given pixel type, correction type and a gamma value. | |
gp_gamma * | gp_gamma_incref (gp_gamma *gamma) |
Increases reference counters. | |
void | gp_gamma_decref (gp_gamma *self) |
Decreases reference counters. | |
const char * | gp_correction_type_name (gp_correction_type type) |
Returns correction name. | |
void | gp_gamma_print (const gp_gamma *self) |
Prints info about gamma table into the stdout. | |
Gamma and sRGB corrections.
Definition in file gp_gamma_correction.h.
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.
const char * gp_correction_type_name | ( | gp_correction_type | type | ) |
Returns correction name.
type | A correction type. |
void gp_gamma_decref | ( | gp_gamma * | self | ) |
Decreases reference counters.
Decreases reference counters and frees the table if counters drop to zero.
self | A gamma table. |
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.
gamma | A gamma table. |
void gp_gamma_print | ( | const gp_gamma * | self | ) |
Prints info about gamma table into the stdout.
self | A gamma table. |