17#ifndef GFX_GP_HLINE_GEN_H__
18#define GFX_GP_HLINE_GEN_H__
23static inline void gp_hline_raw_1BPP_DB(
gp_pixmap *pixmap,
int x0,
int x1,
int y,
31 if (y < 0 || y >= (
int) pixmap->
h || x1 < 0 || x0 >= (
int) pixmap->
w)
38 size_t length = 1 + x1 - x0;
45static inline void gp_hline_raw_1BPP_UB(
gp_pixmap *pixmap,
int x0,
int x1,
int y,
53 if (y < 0 || y >= (
int) pixmap->
h || x1 < 0 || x0 >= (
int) pixmap->
w)
60 size_t length = 1 + x1 - x0;
67static inline void gp_hline_raw_2BPP_DB(
gp_pixmap *pixmap,
int x0,
int x1,
int y,
75 if (y < 0 || y >= (
int) pixmap->
h || x1 < 0 || x0 >= (
int) pixmap->
w)
82 size_t length = 1 + x1 - x0;
89static inline void gp_hline_raw_2BPP_UB(
gp_pixmap *pixmap,
int x0,
int x1,
int y,
97 if (y < 0 || y >= (
int) pixmap->
h || x1 < 0 || x0 >= (
int) pixmap->
w)
104 size_t length = 1 + x1 - x0;
111static inline void gp_hline_raw_4BPP_DB(
gp_pixmap *pixmap,
int x0,
int x1,
int y,
119 if (y < 0 || y >= (
int) pixmap->
h || x1 < 0 || x0 >= (
int) pixmap->
w)
126 size_t length = 1 + x1 - x0;
133static inline void gp_hline_raw_4BPP_UB(
gp_pixmap *pixmap,
int x0,
int x1,
int y,
141 if (y < 0 || y >= (
int) pixmap->
h || x1 < 0 || x0 >= (
int) pixmap->
w)
148 size_t length = 1 + x1 - x0;
155static inline void gp_hline_raw_8BPP(
gp_pixmap *pixmap,
int x0,
int x1,
int y,
163 if (y < 0 || y >= (
int) pixmap->
h || x1 < 0 || x0 >= (
int) pixmap->
w)
170 size_t length = 1 + x1 - x0;
176static inline void gp_hline_raw_16BPP(
gp_pixmap *pixmap,
int x0,
int x1,
int y,
184 if (y < 0 || y >= (
int) pixmap->
h || x1 < 0 || x0 >= (
int) pixmap->
w)
191 size_t length = 1 + x1 - x0;
197static inline void gp_hline_raw_16BPP_BE(
gp_pixmap *pixmap,
int x0,
int x1,
int y,
205 if (y < 0 || y >= (
int) pixmap->
h || x1 < 0 || x0 >= (
int) pixmap->
w)
212 size_t length = 1 + x1 - x0;
218static inline void gp_hline_raw_24BPP(
gp_pixmap *pixmap,
int x0,
int x1,
int y,
226 if (y < 0 || y >= (
int) pixmap->
h || x1 < 0 || x0 >= (
int) pixmap->
w)
233 size_t length = 1 + x1 - x0;
239static inline void gp_hline_raw_32BPP(
gp_pixmap *pixmap,
int x0,
int x1,
int y,
247 if (y < 0 || y >= (
int) pixmap->
h || x1 < 0 || x0 >= (
int) pixmap->
w)
254 size_t length = 1 + x1 - x0;
260static inline void gp_hline_raw_18BPP_DB(
gp_pixmap *pixmap,
int x0,
int x1,
int y,
268 if (y < 0 || y >= (
int) pixmap->
h || x1 < 0 || x0 >= (
int) pixmap->
w)
275 for (;x0 <= x1; x0++)
#define GP_SWAP(a, b)
Swaps a and b.
#define GP_MAX(a, b)
Returns a maximum of the two numbers.
#define GP_MIN(a, b)
Returns a minimum of the two numbers.
uint32_t gp_pixel
Pixel integer value.
int gp_coord
Integer type for coordinates i.e. x, y, ...
Generated macros and function to access pixels.
static void gp_putpixel_raw_18BPP_DB(gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
gp_putpixel for 18BPP_DB
#define GP_PIXEL_ADDR_OFFSET_4BPP_DB(pixmap, x)
A macro to get pixel offset in pixels.
#define GP_PIXEL_ADDR_OFFSET_2BPP_DB(pixmap, x)
A macro to get pixel offset in pixels.
#define GP_PIXEL_ADDR_OFFSET_4BPP_UB(pixmap, x)
A macro to get pixel offset in pixels.
#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_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_OFFSET_1BPP_UB(pixmap, x)
A macro to get pixel offset in pixels.
#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_24BPP(pixmap, x, y)
A macro to get address of a starting byte for a pixel in a 24BPP pixmap.
#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_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_8BPP(pixmap, x, y)
A macro to get address of a starting byte for a pixel in a 8BPP pixmap.
#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_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_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_16BPP(pixmap, x, y)
A macro to get address of a starting byte for a pixel in a 16BPP pixmap.
Optimized functions to write a row of pixels.
void gp_write_pixels_8BPP(void *start, size_t cnt, unsigned int val)
Optimized function to draw a row of 8BPP pixels.
void gp_write_pixels_4BPP_UB(void *start, uint8_t off, size_t cnt, unsigned int val)
Optimized function to draw a row of 4BPP_UB pixels.
void gp_write_pixels_4BPP_DB(void *start, uint8_t off, size_t cnt, unsigned int val)
Optimized function to draw a row of 4BPP_DB pixels.
void gp_write_pixels_2BPP_DB(void *start, uint8_t off, size_t cnt, unsigned int val)
Optimized function to draw a row of 2BPP_DB pixels.
void gp_write_pixels_16BPP_BE(void *start, size_t cnt, unsigned int val)
Optimized function to draw a row of 16BPP_BE pixels.
void gp_write_pixels_32BPP(void *start, size_t cnt, unsigned int val)
Optimized function to draw a row of 32BPP pixels.
void gp_write_pixels_1BPP_DB(void *start, uint8_t off, uint8_t y_off, size_t cnt, unsigned int val)
Optimized function to draw a row of 1BPP_DB pixels.
void gp_write_pixels_16BPP(void *start, size_t cnt, unsigned int val)
Optimized function to draw a row of 16BPP pixels.
void gp_write_pixels_24BPP(void *start, size_t cnt, unsigned int val)
Optimized function to draw a row of 24BPP pixels.
void gp_write_pixels_1BPP_UB(void *start, uint8_t off, uint8_t y_off, size_t cnt, unsigned int val)
Optimized function to draw a row of 1BPP_UB pixels.
void gp_write_pixels_2BPP_UB(void *start, uint8_t off, size_t cnt, unsigned int val)
Optimized function to draw a row of 2BPP_UB pixels.
uint32_t h
Pixmap height in pixels.
uint32_t w
Pixmap width in pixels.