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

Pixel manipulations. More...

#include <core/gp_types.h>
#include <core/gp_pixel.h>
#include <core/gp_pixel_pack.gen.h>
#include <core/gp_get_put_pixel.gen.h>

Go to the source code of this file.

Functions

gp_pixel gp_getpixel (const gp_pixmap *pixmap, gp_coord x, gp_coord y)
 Gets a pixel value.
 
static gp_pixel gp_getpixel_raw (const gp_pixmap *pixmap, gp_coord x, gp_coord y)
 Gets a pixel value.
 
void gp_putpixel (gp_pixmap *pixmap, gp_coord x, gp_coord y, gp_pixel p)
 Puts a pixel value.
 
static void gp_putpixel_raw (gp_pixmap *pixmap, gp_coord x, gp_coord y, gp_pixel p)
 Puts a pixel value.
 
uint8_t gp_pixel_addr_offset (const gp_pixmap *pixmap, gp_coord x)
 Returns a pixel offset in a byte (in pixels).
 

Detailed Description

Pixel manipulations.

Definition in file gp_get_put_pixel.h.

Function Documentation

◆ gp_pixel_addr_offset()

uint8_t gp_pixel_addr_offset ( const gp_pixmap pixmap,
gp_coord  x 
)

Returns a pixel offset in a byte (in pixels).

This function is internally used in gp_sub_pixmap() to compute starting offset for a subpixmap to a first pixel in a row. Returns zero for pixel types aligned to bytes.

Parameters
pixmapA pixmap.
xA x coordinate in a pixmap.
Returns
An offset to the first pixel in byte.