GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
Data Fields
gp_pixmap Struct Reference

A pixmap buffer. More...

#include <gp_pixmap.h>

Data Fields

uint8_t * pixels
 A pointer to image pixels.
 
uint32_t bytes_per_row
 Number of bytes per row.
 
uint32_t w
 Pixmap width in pixels.
 
uint32_t h
 Pixmap height in pixels.
 
uint8_t offset
 An offset to apply before the start of the pixel row.
 
enum gp_pixel_type pixel_type
 A pixel format.
 
gp_gammagamma
 A pointer to a gamma correction table.
 
uint8_t axes_swap:1
 Swaps image x and y axes for drawing.
 
uint8_t x_swap:1
 Mirrors image x axis for drawing.
 
uint8_t y_swap:1
 Mirrors image y axis for drawing.
 
uint8_t free_pixels:1
 If set pixels are freed on gp_pixmap_free.
 

Detailed Description

A pixmap buffer.

This structure holds all information needed for drawing into an pixel buffer.

Definition at line 33 of file gp_pixmap.h.

Field Documentation

◆ axes_swap

uint8_t gp_pixmap::axes_swap

Swaps image x and y axes for drawing.

In order to draw an image rotated by 90 degrees all that needs to be done is to set the axes_swap flag before we start drawing into the pixmap.

Definition at line 79 of file gp_pixmap.h.

Referenced by gp_pixmap_h(), gp_pixmap_rotation_copy(), gp_pixmap_rotation_equal(), gp_pixmap_rotation_set(), and gp_pixmap_w().

◆ bytes_per_row

uint32_t gp_pixmap::bytes_per_row

Number of bytes per row.

This is an integer number even when the actual number of bits used by a row is not a multiple of 8.

Definition at line 42 of file gp_pixmap.h.

◆ gamma

gp_gamma* gp_pixmap::gamma

A pointer to a gamma correction table.

If NULL the channel values are considered linear.

Definition at line 70 of file gp_pixmap.h.

◆ offset

uint8_t gp_pixmap::offset

An offset to apply before the start of the pixel row.

Offset, in pixels, for non-byte aligned pixels. The x = 0 coordinate in the pixmap starts at this offset. It's mainly useful for sub pixmaps for 1BPP, 2BPP and 4BPP pixel types.

The offset is ignored for byte aligned pixels.

Definition at line 56 of file gp_pixmap.h.

◆ pixel_type

enum gp_pixel_type gp_pixmap::pixel_type

A pixel format.

See gp_pixel.gen.h and gp_pixel.gen.c.

Definition at line 63 of file gp_pixmap.h.

◆ x_swap

uint8_t gp_pixmap::x_swap

Mirrors image x axis for drawing.

In order to draw an image mirrored around x axis all that needs to be done is to set the axes_swap flag before we start drawing into the pixmap.

Definition at line 87 of file gp_pixmap.h.

Referenced by gp_pixmap_rotation_copy(), gp_pixmap_rotation_equal(), and gp_pixmap_rotation_set().

◆ y_swap

uint8_t gp_pixmap::y_swap

Mirrors image y axis for drawing.

In order to draw an image mirrored around y axis all that needs to be done is to set the axes_swap flag before we start drawing into the pixmap.

Definition at line 95 of file gp_pixmap.h.

Referenced by gp_pixmap_rotation_copy(), gp_pixmap_rotation_equal(), and gp_pixmap_rotation_set().


The documentation for this struct was generated from the following file: