GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
Data Structures | Typedefs | Enumerations | Functions
gp_gamma_correction.h File Reference

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_gammagp_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_gammagp_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.
 

Detailed Description

Gamma and sRGB corrections.

Definition in file gp_gamma_correction.h.

Typedef Documentation

◆ gp_gamma

typedef struct gp_gamma 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.

Function Documentation

◆ gp_correction_type_name()

const char * gp_correction_type_name ( gp_correction_type  type)

Returns correction name.

Parameters
typeA correction type.
Returns
A correction name.

◆ gp_gamma_decref()

void gp_gamma_decref ( gp_gamma self)

Decreases reference counters.

Decreases reference counters and frees the table if counters drop to zero.

Parameters
selfA gamma table.

◆ gp_gamma_incref()

gp_gamma * gp_gamma_incref ( gp_gamma gamma)

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
gammaA gamma table.
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
selfA gamma table.