GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_get_put_pixel.gen.h File Reference

Generated macros and function to access pixels. More...

Go to the source code of this file.

Macros

#define GP_PIXEL_ADDR_1BPP_DB(pixmap, x, y)
 A macro to get address of a starting byte for a pixel in a 1BPP_DB pixmap.
 
#define GP_PIXEL_ADDR_SHIFT_1BPP_DB(pixmap, x)
 A macro to get bit-shift of pixel in 1BPP_DB pixmap.
 
#define GP_PIXEL_ADDR_OFFSET_1BPP_DB(pixmap, x)
 A macro to get pixel offset in pixels.
 
#define GP_PIXEL_ADDR_1BPP_UB(pixmap, x, y)
 A macro to get address of a starting byte for a pixel in a 1BPP_UB pixmap.
 
#define GP_PIXEL_ADDR_SHIFT_1BPP_UB(pixmap, x)
 A macro to get bit-shift of pixel in 1BPP_UB pixmap.
 
#define GP_PIXEL_ADDR_OFFSET_1BPP_UB(pixmap, x)
 A macro to get pixel offset in pixels.
 
#define GP_PIXEL_ADDR_2BPP_DB(pixmap, x, y)
 A macro to get address of a starting byte for a pixel in a 2BPP_DB pixmap.
 
#define GP_PIXEL_ADDR_SHIFT_2BPP_DB(pixmap, x)
 A macro to get bit-shift of pixel in 2BPP_DB pixmap.
 
#define GP_PIXEL_ADDR_OFFSET_2BPP_DB(pixmap, x)
 A macro to get pixel offset in pixels.
 
#define GP_PIXEL_ADDR_2BPP_UB(pixmap, x, y)
 A macro to get address of a starting byte for a pixel in a 2BPP_UB pixmap.
 
#define GP_PIXEL_ADDR_SHIFT_2BPP_UB(pixmap, x)
 A macro to get bit-shift of pixel in 2BPP_UB pixmap.
 
#define GP_PIXEL_ADDR_OFFSET_2BPP_UB(pixmap, x)
 A macro to get pixel offset in pixels.
 
#define GP_PIXEL_ADDR_4BPP_DB(pixmap, x, y)
 A macro to get address of a starting byte for a pixel in a 4BPP_DB pixmap.
 
#define GP_PIXEL_ADDR_SHIFT_4BPP_DB(pixmap, x)
 A macro to get bit-shift of pixel in 4BPP_DB pixmap.
 
#define GP_PIXEL_ADDR_OFFSET_4BPP_DB(pixmap, x)
 A macro to get pixel offset in pixels.
 
#define GP_PIXEL_ADDR_4BPP_UB(pixmap, x, y)
 A macro to get address of a starting byte for a pixel in a 4BPP_UB pixmap.
 
#define GP_PIXEL_ADDR_SHIFT_4BPP_UB(pixmap, x)
 A macro to get bit-shift of pixel in 4BPP_UB pixmap.
 
#define GP_PIXEL_ADDR_OFFSET_4BPP_UB(pixmap, x)
 A macro to get pixel offset in pixels.
 
#define GP_PIXEL_ADDR_8BPP(pixmap, x, y)
 A macro to get address of a starting byte for a pixel in a 8BPP pixmap.
 
#define GP_PIXEL_ADDR_SHIFT_8BPP(pixmap, x)
 A macro to get bit-shift of pixel in 8BPP pixmap.
 
#define GP_PIXEL_ADDR_OFFSET_8BPP(pixmap, x)
 A macro to get pixel offset in pixels.
 
#define GP_PIXEL_ADDR_16BPP(pixmap, x, y)
 A macro to get address of a starting byte for a pixel in a 16BPP pixmap.
 
#define GP_PIXEL_ADDR_SHIFT_16BPP(pixmap, x)
 A macro to get bit-shift of pixel in 16BPP pixmap.
 
#define GP_PIXEL_ADDR_OFFSET_16BPP(pixmap, x)
 A macro to get pixel offset in pixels.
 
#define GP_PIXEL_ADDR_16BPP_BE(pixmap, x, y)
 A macro to get address of a starting byte for a pixel in a 16BPP_BE pixmap.
 
#define GP_PIXEL_ADDR_SHIFT_16BPP_BE(pixmap, x)
 A macro to get bit-shift of pixel in 16BPP_BE pixmap.
 
#define GP_PIXEL_ADDR_OFFSET_16BPP_BE(pixmap, x)
 A macro to get pixel offset in pixels.
 
#define GP_PIXEL_ADDR_24BPP(pixmap, x, y)
 A macro to get address of a starting byte for a pixel in a 24BPP pixmap.
 
#define GP_PIXEL_ADDR_SHIFT_24BPP(pixmap, x)
 A macro to get bit-shift of pixel in 24BPP pixmap.
 
#define GP_PIXEL_ADDR_OFFSET_24BPP(pixmap, x)
 A macro to get pixel offset in pixels.
 
#define GP_PIXEL_ADDR_32BPP(pixmap, x, y)
 A macro to get address of a starting byte for a pixel in a 32BPP pixmap.
 
#define GP_PIXEL_ADDR_SHIFT_32BPP(pixmap, x)
 A macro to get bit-shift of pixel in 32BPP pixmap.
 
#define GP_PIXEL_ADDR_OFFSET_32BPP(pixmap, x)
 A macro to get pixel offset in pixels.
 
#define GP_PIXEL_ADDR_18BPP_DB(pixmap, x, y)
 A macro to get address of a starting byte for a pixel in a 18BPP_DB pixmap.
 
#define GP_PIXEL_ADDR_SHIFT_18BPP_DB(pixmap, x)
 A macro to get bit-shift of pixel in 18BPP_DB pixmap.
 
#define GP_PIXEL_ADDR_OFFSET_18BPP_DB(pixmap, x)
 A macro to get pixel offset in pixels.
 

Functions

static gp_pixel gp_getpixel_raw_1BPP_DB (const gp_pixmap *c, gp_coord x, gp_coord y)
 gp_getpixel for 1BPP_DB
 
static void gp_putpixel_raw_1BPP_DB (gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
 gp_putpixel for 1BPP_DB
 
static gp_pixel gp_getpixel_raw_1BPP_UB (const gp_pixmap *c, gp_coord x, gp_coord y)
 gp_getpixel for 1BPP_UB
 
static void gp_putpixel_raw_1BPP_UB (gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
 gp_putpixel for 1BPP_UB
 
static gp_pixel gp_getpixel_raw_2BPP_DB (const gp_pixmap *c, gp_coord x, gp_coord y)
 gp_getpixel for 2BPP_DB
 
static void gp_putpixel_raw_2BPP_DB (gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
 gp_putpixel for 2BPP_DB
 
static gp_pixel gp_getpixel_raw_2BPP_UB (const gp_pixmap *c, gp_coord x, gp_coord y)
 gp_getpixel for 2BPP_UB
 
static void gp_putpixel_raw_2BPP_UB (gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
 gp_putpixel for 2BPP_UB
 
static gp_pixel gp_getpixel_raw_4BPP_DB (const gp_pixmap *c, gp_coord x, gp_coord y)
 gp_getpixel for 4BPP_DB
 
static void gp_putpixel_raw_4BPP_DB (gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
 gp_putpixel for 4BPP_DB
 
static gp_pixel gp_getpixel_raw_4BPP_UB (const gp_pixmap *c, gp_coord x, gp_coord y)
 gp_getpixel for 4BPP_UB
 
static void gp_putpixel_raw_4BPP_UB (gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
 gp_putpixel for 4BPP_UB
 
static gp_pixel gp_getpixel_raw_8BPP (const gp_pixmap *c, gp_coord x, gp_coord y)
 gp_getpixel for 8BPP
 
static void gp_putpixel_raw_8BPP (gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
 gp_putpixel for 8BPP
 
static gp_pixel gp_getpixel_raw_16BPP (const gp_pixmap *c, gp_coord x, gp_coord y)
 gp_getpixel for 16BPP
 
static void gp_putpixel_raw_16BPP (gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
 gp_putpixel for 16BPP
 
static gp_pixel gp_getpixel_raw_16BPP_BE (const gp_pixmap *c, gp_coord x, gp_coord y)
 gp_getpixel for 16BPP_BE
 
static void gp_putpixel_raw_16BPP_BE (gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
 gp_putpixel for 16BPP_BE
 
static gp_pixel gp_getpixel_raw_24BPP (const gp_pixmap *c, gp_coord x, gp_coord y)
 gp_getpixel for 24BPP
 
static void gp_putpixel_raw_24BPP (gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
 gp_putpixel for 24BPP
 
static gp_pixel gp_getpixel_raw_32BPP (const gp_pixmap *c, gp_coord x, gp_coord y)
 gp_getpixel for 32BPP
 
static void gp_putpixel_raw_32BPP (gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
 gp_putpixel for 32BPP
 
static gp_pixel gp_getpixel_raw_18BPP_DB (const gp_pixmap *c, gp_coord x, gp_coord y)
 gp_getpixel for 18BPP_DB
 
static void gp_putpixel_raw_18BPP_DB (gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
 gp_putpixel for 18BPP_DB
 

Detailed Description

Generated macros and function to access pixels.

Generated macros to access pixel data

These function and macros are generated based on the pixel defintions in gfxprim_config.py. The get and put pixel functions are build on the top of macros to manipulate bytes and bits.

The GP_PIXEL_ADDR macros return a pointer to the first byte of the pixel in the gp_pixmap buffer. If the pixel is aligned to whole bytes, we just need to fetch/write a few bytes. Otherwise we need to compute the shift, fetch a few bytes and then mask and bit shift it.

Note about byte aligment

Unaligned access happens when instruction that works with multiple byte value gets an address that is not divideable by the size of the value. Eg. if 32 bit integer instruction gets an address that is not a multiple of 4. On intel cpus this type of access works and is supported however the C standard defines this as undefined behavior. This fails to work older ARM and most of the non intel cpus. So some more trickery must be done in order to write unaligned multibyte values. First of all we must compute offset and number of bytes to be accessed (which is cruicial for speed as we are going to read the pixel value byte by byte).

The offsets (starting with the first one e.g. pixel_size mod 8) forms subgroup in the mod 8 cyclic group. The maximal count of bits, from the start of the byte, then will be max from this subgroup + pixel_size. If this number is less or equal to 8 * N, we could write such pixel by writing N bytes.

For example the offsets of 16 BPP forms subgroup only with {0} so we only need 2 bytes to write it. As a matter of fact the 16 and 32 BPP are special cases that are always aligned together with the 8 BPP (which is aligned trivially). These three are coded as special cases which yields to faster operations in case of 16 and 32 BPP. The 24 BPP is not aligned as there are no instruction to operate 3 byte long numbers.

For second example take offsets of 20 BPP that forms subgroup {4, 0} so the max + pixel_size = 24 and indeed we fit into 3 bytes.

If pixel_size is coprime to 8, the offsets generates whole group and so the max + pixel_size = 7 + pixel_size. The 17 BPP fits into 24 bits and so 3 bytes are needed. The 19 BPP fits into 26 bits and because of that 4 bytes are needed.

Once we figure maximal number of bytes and the offset all that is to be done is to fetch first and last byte to combine it together with given pixel value and write the result back to the bitmap.

Definition in file gp_get_put_pixel.gen.h.

Macro Definition Documentation

◆ GP_PIXEL_ADDR_16BPP

#define GP_PIXEL_ADDR_16BPP ( pixmap,
x,
y )
Value:
((gp_pixel*)(((void*)((pixmap)->pixels)) + (pixmap)->bytes_per_row * (y) + \
(16 * (x)) / 8))
uint32_t gp_pixel
Pixel integer value.
Definition gp_types.h:33

A macro to get address of a starting byte for a pixel in a 16BPP pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate within the pixmap.
yAn y coordinate within the pixmap.

Definition at line 627 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_16BPP(), and gp_putpixel_raw_16BPP().

◆ GP_PIXEL_ADDR_16BPP_BE

#define GP_PIXEL_ADDR_16BPP_BE ( pixmap,
x,
y )
Value:
((gp_pixel*)(((void*)((pixmap)->pixels)) + (pixmap)->bytes_per_row * (y) + \
(16 * (x)) / 8))

A macro to get address of a starting byte for a pixel in a 16BPP_BE pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate within the pixmap.
yAn y coordinate within the pixmap.

Definition at line 699 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_16BPP_BE(), and gp_putpixel_raw_16BPP_BE().

◆ GP_PIXEL_ADDR_18BPP_DB

#define GP_PIXEL_ADDR_18BPP_DB ( pixmap,
x,
y )
Value:
((gp_pixel*)(((void*)((pixmap)->pixels)) + (pixmap)->bytes_per_row * (y) + \
(18 * ((pixmap)->offset + x)) / 8))

A macro to get address of a starting byte for a pixel in a 18BPP_DB pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate within the pixmap.
yAn y coordinate within the pixmap.

Definition at line 933 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_18BPP_DB(), and gp_putpixel_raw_18BPP_DB().

◆ GP_PIXEL_ADDR_1BPP_DB

#define GP_PIXEL_ADDR_1BPP_DB ( pixmap,
x,
y )
Value:
((gp_pixel*)(((void*)((pixmap)->pixels)) + (pixmap)->bytes_per_row * (y) + \
(1 * ((pixmap)->offset + x)) / 8))

A macro to get address of a starting byte for a pixel in a 1BPP_DB pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate within the pixmap.
yAn y coordinate within the pixmap.

Definition at line 87 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_1BPP_DB(), and gp_putpixel_raw_1BPP_DB().

◆ GP_PIXEL_ADDR_1BPP_UB

#define GP_PIXEL_ADDR_1BPP_UB ( pixmap,
x,
y )
Value:
((gp_pixel*)(((void*)((pixmap)->pixels)) + (pixmap)->bytes_per_row * (y) + \
(1 * ((pixmap)->offset + x)) / 8))

A macro to get address of a starting byte for a pixel in a 1BPP_UB pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate within the pixmap.
yAn y coordinate within the pixmap.

Definition at line 165 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_1BPP_UB(), and gp_putpixel_raw_1BPP_UB().

◆ GP_PIXEL_ADDR_24BPP

#define GP_PIXEL_ADDR_24BPP ( pixmap,
x,
y )
Value:
((gp_pixel*)(((void*)((pixmap)->pixels)) + (pixmap)->bytes_per_row * (y) + \
(24 * (x)) / 8))

A macro to get address of a starting byte for a pixel in a 24BPP pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate within the pixmap.
yAn y coordinate within the pixmap.

Definition at line 771 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_24BPP(), and gp_putpixel_raw_24BPP().

◆ GP_PIXEL_ADDR_2BPP_DB

#define GP_PIXEL_ADDR_2BPP_DB ( pixmap,
x,
y )
Value:
((gp_pixel*)(((void*)((pixmap)->pixels)) + (pixmap)->bytes_per_row * (y) + \
(2 * ((pixmap)->offset + x)) / 8))

A macro to get address of a starting byte for a pixel in a 2BPP_DB pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate within the pixmap.
yAn y coordinate within the pixmap.

Definition at line 243 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_2BPP_DB(), and gp_putpixel_raw_2BPP_DB().

◆ GP_PIXEL_ADDR_2BPP_UB

#define GP_PIXEL_ADDR_2BPP_UB ( pixmap,
x,
y )
Value:
((gp_pixel*)(((void*)((pixmap)->pixels)) + (pixmap)->bytes_per_row * (y) + \
(2 * ((pixmap)->offset + x)) / 8))

A macro to get address of a starting byte for a pixel in a 2BPP_UB pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate within the pixmap.
yAn y coordinate within the pixmap.

Definition at line 321 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_2BPP_UB(), and gp_putpixel_raw_2BPP_UB().

◆ GP_PIXEL_ADDR_32BPP

#define GP_PIXEL_ADDR_32BPP ( pixmap,
x,
y )
Value:
((gp_pixel*)(((void*)((pixmap)->pixels)) + (pixmap)->bytes_per_row * (y) + \
(32 * (x)) / 8))

A macro to get address of a starting byte for a pixel in a 32BPP pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate within the pixmap.
yAn y coordinate within the pixmap.

Definition at line 861 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_32BPP(), and gp_putpixel_raw_32BPP().

◆ GP_PIXEL_ADDR_4BPP_DB

#define GP_PIXEL_ADDR_4BPP_DB ( pixmap,
x,
y )
Value:
((gp_pixel*)(((void*)((pixmap)->pixels)) + (pixmap)->bytes_per_row * (y) + \
(4 * ((pixmap)->offset + x)) / 8))

A macro to get address of a starting byte for a pixel in a 4BPP_DB pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate within the pixmap.
yAn y coordinate within the pixmap.

Definition at line 399 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_4BPP_DB(), and gp_putpixel_raw_4BPP_DB().

◆ GP_PIXEL_ADDR_4BPP_UB

#define GP_PIXEL_ADDR_4BPP_UB ( pixmap,
x,
y )
Value:
((gp_pixel*)(((void*)((pixmap)->pixels)) + (pixmap)->bytes_per_row * (y) + \
(4 * ((pixmap)->offset + x)) / 8))

A macro to get address of a starting byte for a pixel in a 4BPP_UB pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate within the pixmap.
yAn y coordinate within the pixmap.

Definition at line 477 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_4BPP_UB(), and gp_putpixel_raw_4BPP_UB().

◆ GP_PIXEL_ADDR_8BPP

#define GP_PIXEL_ADDR_8BPP ( pixmap,
x,
y )
Value:
((gp_pixel*)(((void*)((pixmap)->pixels)) + (pixmap)->bytes_per_row * (y) + \
(8 * (x)) / 8))

A macro to get address of a starting byte for a pixel in a 8BPP pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate within the pixmap.
yAn y coordinate within the pixmap.

Definition at line 555 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_8BPP(), and gp_putpixel_raw_8BPP().

◆ GP_PIXEL_ADDR_SHIFT_16BPP

#define GP_PIXEL_ADDR_SHIFT_16BPP ( pixmap,
x )
Value:
(0)

A macro to get bit-shift of pixel in 16BPP pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate in the pixmap.

Definition at line 637 of file gp_get_put_pixel.gen.h.

◆ GP_PIXEL_ADDR_SHIFT_16BPP_BE

#define GP_PIXEL_ADDR_SHIFT_16BPP_BE ( pixmap,
x )
Value:
(0)

A macro to get bit-shift of pixel in 16BPP_BE pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate in the pixmap.

Definition at line 709 of file gp_get_put_pixel.gen.h.

◆ GP_PIXEL_ADDR_SHIFT_18BPP_DB

#define GP_PIXEL_ADDR_SHIFT_18BPP_DB ( pixmap,
x )
Value:
((18 * (x + (pixmap)->offset)) % 8)

A macro to get bit-shift of pixel in 18BPP_DB pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate in the pixmap.

Definition at line 943 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_18BPP_DB(), and gp_putpixel_raw_18BPP_DB().

◆ GP_PIXEL_ADDR_SHIFT_1BPP_DB

#define GP_PIXEL_ADDR_SHIFT_1BPP_DB ( pixmap,
x )
Value:
(((x + (pixmap)->offset) % 8) * 1)

A macro to get bit-shift of pixel in 1BPP_DB pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate in the pixmap.

Definition at line 97 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_1BPP_DB(), and gp_putpixel_raw_1BPP_DB().

◆ GP_PIXEL_ADDR_SHIFT_1BPP_UB

#define GP_PIXEL_ADDR_SHIFT_1BPP_UB ( pixmap,
x )
Value:
(7 - ((x + (pixmap)->offset) % 8) * 1)

A macro to get bit-shift of pixel in 1BPP_UB pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate in the pixmap.

Definition at line 175 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_1BPP_UB(), and gp_putpixel_raw_1BPP_UB().

◆ GP_PIXEL_ADDR_SHIFT_24BPP

#define GP_PIXEL_ADDR_SHIFT_24BPP ( pixmap,
x )
Value:
(0)

A macro to get bit-shift of pixel in 24BPP pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate in the pixmap.

Definition at line 781 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_24BPP(), and gp_putpixel_raw_24BPP().

◆ GP_PIXEL_ADDR_SHIFT_2BPP_DB

#define GP_PIXEL_ADDR_SHIFT_2BPP_DB ( pixmap,
x )
Value:
(((x + (pixmap)->offset) % 4) * 2)

A macro to get bit-shift of pixel in 2BPP_DB pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate in the pixmap.

Definition at line 253 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_2BPP_DB(), and gp_putpixel_raw_2BPP_DB().

◆ GP_PIXEL_ADDR_SHIFT_2BPP_UB

#define GP_PIXEL_ADDR_SHIFT_2BPP_UB ( pixmap,
x )
Value:
(6 - ((x + (pixmap)->offset) % 4) * 2)

A macro to get bit-shift of pixel in 2BPP_UB pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate in the pixmap.

Definition at line 331 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_2BPP_UB(), and gp_putpixel_raw_2BPP_UB().

◆ GP_PIXEL_ADDR_SHIFT_32BPP

#define GP_PIXEL_ADDR_SHIFT_32BPP ( pixmap,
x )
Value:
(0)

A macro to get bit-shift of pixel in 32BPP pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate in the pixmap.

Definition at line 871 of file gp_get_put_pixel.gen.h.

◆ GP_PIXEL_ADDR_SHIFT_4BPP_DB

#define GP_PIXEL_ADDR_SHIFT_4BPP_DB ( pixmap,
x )
Value:
(((x + (pixmap)->offset) % 2) * 4)

A macro to get bit-shift of pixel in 4BPP_DB pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate in the pixmap.

Definition at line 409 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_4BPP_DB(), and gp_putpixel_raw_4BPP_DB().

◆ GP_PIXEL_ADDR_SHIFT_4BPP_UB

#define GP_PIXEL_ADDR_SHIFT_4BPP_UB ( pixmap,
x )
Value:
(4 - ((x + (pixmap)->offset) % 2) * 4)

A macro to get bit-shift of pixel in 4BPP_UB pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate in the pixmap.

Definition at line 487 of file gp_get_put_pixel.gen.h.

Referenced by gp_getpixel_raw_4BPP_UB(), and gp_putpixel_raw_4BPP_UB().

◆ GP_PIXEL_ADDR_SHIFT_8BPP

#define GP_PIXEL_ADDR_SHIFT_8BPP ( pixmap,
x )
Value:
(0)

A macro to get bit-shift of pixel in 8BPP pixmap.

Parameters
pixmapA pixmap.
xAn x coordinate in the pixmap.

Definition at line 565 of file gp_get_put_pixel.gen.h.

Function Documentation

◆ gp_getpixel_raw_16BPP()

static gp_pixel gp_getpixel_raw_16BPP ( const gp_pixmap * c,
gp_coord x,
gp_coord y )
inlinestatic

gp_getpixel for 16BPP

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
Returns
A pixel value at x, y.

Definition at line 657 of file gp_get_put_pixel.gen.h.

References GP_GET_BYTES2_LE, and GP_PIXEL_ADDR_16BPP.

◆ gp_getpixel_raw_16BPP_BE()

static gp_pixel gp_getpixel_raw_16BPP_BE ( const gp_pixmap * c,
gp_coord x,
gp_coord y )
inlinestatic

gp_getpixel for 16BPP_BE

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
Returns
A pixel value at x, y.

Definition at line 729 of file gp_get_put_pixel.gen.h.

References GP_GET_BYTES2_BE, and GP_PIXEL_ADDR_16BPP_BE.

◆ gp_getpixel_raw_18BPP_DB()

static gp_pixel gp_getpixel_raw_18BPP_DB ( const gp_pixmap * c,
gp_coord x,
gp_coord y )
inlinestatic

gp_getpixel for 18BPP_DB

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
Returns
A pixel value at x, y.

Definition at line 963 of file gp_get_put_pixel.gen.h.

References GP_GET_BITS3_LE, GP_PIXEL_ADDR_18BPP_DB, and GP_PIXEL_ADDR_SHIFT_18BPP_DB.

◆ gp_getpixel_raw_1BPP_DB()

static gp_pixel gp_getpixel_raw_1BPP_DB ( const gp_pixmap * c,
gp_coord x,
gp_coord y )
inlinestatic

gp_getpixel for 1BPP_DB

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
Returns
A pixel value at x, y.

Definition at line 117 of file gp_get_put_pixel.gen.h.

References GP_GET_BITS1, GP_PIXEL_ADDR_1BPP_DB, and GP_PIXEL_ADDR_SHIFT_1BPP_DB.

◆ gp_getpixel_raw_1BPP_UB()

static gp_pixel gp_getpixel_raw_1BPP_UB ( const gp_pixmap * c,
gp_coord x,
gp_coord y )
inlinestatic

gp_getpixel for 1BPP_UB

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
Returns
A pixel value at x, y.

Definition at line 195 of file gp_get_put_pixel.gen.h.

References GP_GET_BITS1, GP_PIXEL_ADDR_1BPP_UB, and GP_PIXEL_ADDR_SHIFT_1BPP_UB.

◆ gp_getpixel_raw_24BPP()

static gp_pixel gp_getpixel_raw_24BPP ( const gp_pixmap * c,
gp_coord x,
gp_coord y )
inlinestatic

gp_getpixel for 24BPP

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
Returns
A pixel value at x, y.

Definition at line 801 of file gp_get_put_pixel.gen.h.

References GP_GET_BITS3_LE, GP_PIXEL_ADDR_24BPP, and GP_PIXEL_ADDR_SHIFT_24BPP.

◆ gp_getpixel_raw_2BPP_DB()

static gp_pixel gp_getpixel_raw_2BPP_DB ( const gp_pixmap * c,
gp_coord x,
gp_coord y )
inlinestatic

gp_getpixel for 2BPP_DB

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
Returns
A pixel value at x, y.

Definition at line 273 of file gp_get_put_pixel.gen.h.

References GP_GET_BITS1, GP_PIXEL_ADDR_2BPP_DB, and GP_PIXEL_ADDR_SHIFT_2BPP_DB.

◆ gp_getpixel_raw_2BPP_UB()

static gp_pixel gp_getpixel_raw_2BPP_UB ( const gp_pixmap * c,
gp_coord x,
gp_coord y )
inlinestatic

gp_getpixel for 2BPP_UB

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
Returns
A pixel value at x, y.

Definition at line 351 of file gp_get_put_pixel.gen.h.

References GP_GET_BITS1, GP_PIXEL_ADDR_2BPP_UB, and GP_PIXEL_ADDR_SHIFT_2BPP_UB.

◆ gp_getpixel_raw_32BPP()

static gp_pixel gp_getpixel_raw_32BPP ( const gp_pixmap * c,
gp_coord x,
gp_coord y )
inlinestatic

gp_getpixel for 32BPP

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
Returns
A pixel value at x, y.

Definition at line 891 of file gp_get_put_pixel.gen.h.

References GP_GET_BYTES4_LE, and GP_PIXEL_ADDR_32BPP.

◆ gp_getpixel_raw_4BPP_DB()

static gp_pixel gp_getpixel_raw_4BPP_DB ( const gp_pixmap * c,
gp_coord x,
gp_coord y )
inlinestatic

gp_getpixel for 4BPP_DB

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
Returns
A pixel value at x, y.

Definition at line 429 of file gp_get_put_pixel.gen.h.

References GP_GET_BITS1, GP_PIXEL_ADDR_4BPP_DB, and GP_PIXEL_ADDR_SHIFT_4BPP_DB.

◆ gp_getpixel_raw_4BPP_UB()

static gp_pixel gp_getpixel_raw_4BPP_UB ( const gp_pixmap * c,
gp_coord x,
gp_coord y )
inlinestatic

gp_getpixel for 4BPP_UB

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
Returns
A pixel value at x, y.

Definition at line 507 of file gp_get_put_pixel.gen.h.

References GP_GET_BITS1, GP_PIXEL_ADDR_4BPP_UB, and GP_PIXEL_ADDR_SHIFT_4BPP_UB.

◆ gp_getpixel_raw_8BPP()

static gp_pixel gp_getpixel_raw_8BPP ( const gp_pixmap * c,
gp_coord x,
gp_coord y )
inlinestatic

gp_getpixel for 8BPP

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
Returns
A pixel value at x, y.

Definition at line 585 of file gp_get_put_pixel.gen.h.

References GP_GET_BYTES1, and GP_PIXEL_ADDR_8BPP.

◆ gp_putpixel_raw_16BPP()

static void gp_putpixel_raw_16BPP ( gp_pixmap * c,
gp_coord x,
gp_coord y,
gp_pixel p )
inlinestatic

gp_putpixel for 16BPP

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
pA pixel value to be written into the buffer.

Definition at line 675 of file gp_get_put_pixel.gen.h.

References GP_PIXEL_ADDR_16BPP, and GP_SET_BYTES2_LE.

◆ gp_putpixel_raw_16BPP_BE()

static void gp_putpixel_raw_16BPP_BE ( gp_pixmap * c,
gp_coord x,
gp_coord y,
gp_pixel p )
inlinestatic

gp_putpixel for 16BPP_BE

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
pA pixel value to be written into the buffer.

Definition at line 747 of file gp_get_put_pixel.gen.h.

References GP_PIXEL_ADDR_16BPP_BE, and GP_SET_BYTES2_BE.

◆ gp_putpixel_raw_18BPP_DB()

static void gp_putpixel_raw_18BPP_DB ( gp_pixmap * c,
gp_coord x,
gp_coord y,
gp_pixel p )
inlinestatic

gp_putpixel for 18BPP_DB

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
pA pixel value to be written into the buffer.

Definition at line 990 of file gp_get_put_pixel.gen.h.

References GP_PIXEL_ADDR_18BPP_DB, GP_PIXEL_ADDR_SHIFT_18BPP_DB, and GP_SET_BITS3_LE.

◆ gp_putpixel_raw_1BPP_DB()

static void gp_putpixel_raw_1BPP_DB ( gp_pixmap * c,
gp_coord x,
gp_coord y,
gp_pixel p )
inlinestatic

gp_putpixel for 1BPP_DB

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
pA pixel value to be written into the buffer.

Definition at line 138 of file gp_get_put_pixel.gen.h.

References GP_PIXEL_ADDR_1BPP_DB, GP_PIXEL_ADDR_SHIFT_1BPP_DB, and GP_SET_BITS1.

◆ gp_putpixel_raw_1BPP_UB()

static void gp_putpixel_raw_1BPP_UB ( gp_pixmap * c,
gp_coord x,
gp_coord y,
gp_pixel p )
inlinestatic

gp_putpixel for 1BPP_UB

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
pA pixel value to be written into the buffer.

Definition at line 216 of file gp_get_put_pixel.gen.h.

References GP_PIXEL_ADDR_1BPP_UB, GP_PIXEL_ADDR_SHIFT_1BPP_UB, and GP_SET_BITS1.

◆ gp_putpixel_raw_24BPP()

static void gp_putpixel_raw_24BPP ( gp_pixmap * c,
gp_coord x,
gp_coord y,
gp_pixel p )
inlinestatic

gp_putpixel for 24BPP

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
pA pixel value to be written into the buffer.

Definition at line 828 of file gp_get_put_pixel.gen.h.

References GP_PIXEL_ADDR_24BPP, GP_PIXEL_ADDR_SHIFT_24BPP, and GP_SET_BITS3_LE.

◆ gp_putpixel_raw_2BPP_DB()

static void gp_putpixel_raw_2BPP_DB ( gp_pixmap * c,
gp_coord x,
gp_coord y,
gp_pixel p )
inlinestatic

gp_putpixel for 2BPP_DB

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
pA pixel value to be written into the buffer.

Definition at line 294 of file gp_get_put_pixel.gen.h.

References GP_PIXEL_ADDR_2BPP_DB, GP_PIXEL_ADDR_SHIFT_2BPP_DB, and GP_SET_BITS1.

◆ gp_putpixel_raw_2BPP_UB()

static void gp_putpixel_raw_2BPP_UB ( gp_pixmap * c,
gp_coord x,
gp_coord y,
gp_pixel p )
inlinestatic

gp_putpixel for 2BPP_UB

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
pA pixel value to be written into the buffer.

Definition at line 372 of file gp_get_put_pixel.gen.h.

References GP_PIXEL_ADDR_2BPP_UB, GP_PIXEL_ADDR_SHIFT_2BPP_UB, and GP_SET_BITS1.

◆ gp_putpixel_raw_32BPP()

static void gp_putpixel_raw_32BPP ( gp_pixmap * c,
gp_coord x,
gp_coord y,
gp_pixel p )
inlinestatic

gp_putpixel for 32BPP

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
pA pixel value to be written into the buffer.

Definition at line 909 of file gp_get_put_pixel.gen.h.

References GP_PIXEL_ADDR_32BPP, and GP_SET_BYTES4_LE.

◆ gp_putpixel_raw_4BPP_DB()

static void gp_putpixel_raw_4BPP_DB ( gp_pixmap * c,
gp_coord x,
gp_coord y,
gp_pixel p )
inlinestatic

gp_putpixel for 4BPP_DB

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
pA pixel value to be written into the buffer.

Definition at line 450 of file gp_get_put_pixel.gen.h.

References GP_PIXEL_ADDR_4BPP_DB, GP_PIXEL_ADDR_SHIFT_4BPP_DB, and GP_SET_BITS1.

◆ gp_putpixel_raw_4BPP_UB()

static void gp_putpixel_raw_4BPP_UB ( gp_pixmap * c,
gp_coord x,
gp_coord y,
gp_pixel p )
inlinestatic

gp_putpixel for 4BPP_UB

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
pA pixel value to be written into the buffer.

Definition at line 528 of file gp_get_put_pixel.gen.h.

References GP_PIXEL_ADDR_4BPP_UB, GP_PIXEL_ADDR_SHIFT_4BPP_UB, and GP_SET_BITS1.

◆ gp_putpixel_raw_8BPP()

static void gp_putpixel_raw_8BPP ( gp_pixmap * c,
gp_coord x,
gp_coord y,
gp_pixel p )
inlinestatic

gp_putpixel for 8BPP

Warning
The x and y must be inside of the pixmap!
Parameters
cA pixmap.
xA x coordinate.
yA y coordinate.
pA pixel value to be written into the buffer.

Definition at line 603 of file gp_get_put_pixel.gen.h.

References GP_PIXEL_ADDR_8BPP, and GP_SET_BYTES1.