GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
Data Structures | |
struct | gp_pixmap |
A pixmap buffer. More... | |
Macros | |
#define | GP_PIXEL_IS_CLIPPED(pixmap, x, y) |
Returns true when pixel is clipped out of pixmap. | |
Functions | |
gp_pixmap * | gp_pixmap_alloc (gp_size w, gp_size h, gp_pixel_type type) |
Allocates a pixmap. | |
int | gp_pixmap_correction_set (gp_pixmap *self, gp_correction_desc *corr_desc) |
Sets a correction for the pixmap. | |
static int | gp_pixmap_gamma_set (gp_pixmap *self, float gamma) |
Sets a gamma correction for the pixmap. | |
static int | gp_pixmap_srgb_set (gp_pixmap *self) |
Sets a sRGB correction for the pixmap. | |
void | gp_pixmap_free (gp_pixmap *self) |
Frees a pixmap. | |
static gp_pixmap * | gp_pixmap_from_data (gp_size w, gp_size h, gp_pixel_type type, void *pixels, enum gp_pixmap_init_flags flags) |
Creates a pixmap from a buffer allocated by malloc(). | |
gp_pixmap * gp_pixmap_alloc | ( | gp_size | w, |
gp_size | h, | ||
gp_pixel_type | type | ||
) |
Allocates a pixmap.
The pixmap consists of two parts, the gp_pixmap structure and pixels array.
The rotation flags are set to (0, 0, 0).
w | A pixmap width. |
h | A pixmap height. |
type | A pixel type. |
int gp_pixmap_correction_set | ( | gp_pixmap * | self, |
gp_correction_desc * | corr_desc | ||
) |
Sets a correction for the pixmap.
If there was a gamma correction allready set for the pixmap the original correction reference counters are decremented and the correction is replaced with a new table.
self | A pixmap. |
corr_desc | A correction description. |
Referenced by gp_pixmap_gamma_set(), and gp_pixmap_srgb_set().
void gp_pixmap_free | ( | gp_pixmap * | self | ) |
Frees a pixmap.
If pixmap->free_pixels is set also free pixel data, this flag is set automatically by gp_pixmap_alloc().
self | A pixmap to free. |
|
inlinestatic |
Creates a pixmap from a buffer allocated by malloc().
This is actually shorthand for allocating the gp_pixmap structure and calling gp_pixmap_init() on the resulting pointer.
w | Pixmap width |
h | Pixmap height |
type | A pixel type, describes how pixels are organized in the data buffer. |
pixels | A pointer to a buffer with the pixel data. |
flags | A bitmask or of the enum gp_pixmap_init_flags |
Definition at line 276 of file gp_pixmap.h.
References gp_pixmap_init().
|
inlinestatic |
Sets a gamma correction for the pixmap.
This is a shorthand for:
self | A pixmap. |
gamma | A gamma value. |
Definition at line 181 of file gp_pixmap.h.
References gp_correction_desc::corr_type, GP_CORRECTION_TYPE_GAMMA, and gp_pixmap_correction_set().
|
inlinestatic |
Sets a sRGB correction for the pixmap.
This is a shorthand for:
self | A pixmap. |
Definition at line 208 of file gp_pixmap.h.
References gp_correction_desc::corr_type, GP_CORRECTION_TYPE_SRGB, and gp_pixmap_correction_set().