rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
gfx_sprite.h
Go to the documentation of this file.
1
33
34#pragma once
35
36#include <stdbool.h>
37#include <stdint.h>
38
39#include "gfx.h"
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
46enum {
52};
53
55#define GFX_RUN_MAX 64
56
58typedef struct {
59 int16_t w;
60 int16_t h;
61 uint32_t bytes;
62 const uint8_t *rle;
64
80bool gfx_sprite_draw(gfx_canvas_t *c, int x, int y, const gfx_sprite_t *sp);
81
89static inline gfx_rect_t gfx_sprite_rect(const gfx_sprite_t *sp, int x, int y)
90{
91 return (sp != NULL) ? gfx_rect_make(x, y, sp->w, sp->h)
92 : gfx_rect_make(x, y, 0, 0);
93}
94
95#ifdef __cplusplus
96}
97#endif
gfx: an RGB565 (16-bit red, green, blue) rasteriser with no dependencies.
bool gfx_sprite_draw(gfx_canvas_t *c, int x, int y, const gfx_sprite_t *sp)
Blend sp onto c with its top-left corner at (x, y).
Definition gfx_sprite.c:57
@ GFX_RUN_FILL
Definition gfx_sprite.h:48
@ GFX_RUN_SKIP
Definition gfx_sprite.h:47
@ GFX_RUN_COPY
Definition gfx_sprite.h:49
@ GFX_RUN_BLEND
Definition gfx_sprite.h:50
static gfx_rect_t gfx_sprite_rect(const gfx_sprite_t *sp, int x, int y)
The sprite's box with its top-left corner at (x, y).
Definition gfx_sprite.h:89
Definition gfx.h:129
Definition gfx.h:81
An encoded image with alpha.
Definition gfx_sprite.h:58
int16_t w
Definition gfx_sprite.h:59
const uint8_t * rle
Definition gfx_sprite.h:62
int16_t h
Definition gfx_sprite.h:60
uint32_t bytes
Definition gfx_sprite.h:61