6#ifndef BACKENDS_GP_SDL_PIXMAP_H
7#define BACKENDS_GP_SDL_PIXMAP_H
30static inline int gp_pixmap_from_sdl_surface(
gp_pixmap *pixmap,
31 const SDL_Surface *surf)
34 if (surf->format->BytesPerPixel == 0) {
35 GP_WARN(
"Surface->BytesPerPixel == 0");
39 if (surf->format->BytesPerPixel > 4) {
40 GP_WARN(
"Surface->BytesPerPixel > 4");
48 surf->format->BitsPerPixel);
50 if (pixeltype == GP_PIXEL_UNKNOWN)
54 pixmap->
pixels = surf->pixels;
#define GP_WARN(...)
A debug WARN printf-like macro.
gp_pixel_type
List of all pixel types.
gp_pixel_type gp_pixel_rgb_match(gp_pixel rmask, gp_pixel gmask, gp_pixel bmask, gp_pixel amask, uint8_t bits_per_pixel)
Matches a RGB pixel type againts known pixel types.
uint32_t h
Pixmap height in pixels.
uint8_t * pixels
A pointer to image pixels.
enum gp_pixel_type pixel_type
A pixel format.
uint32_t bytes_per_row
Number of bytes per row.
uint32_t w
Pixmap width in pixels.