rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Toggle main menu visibility
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
42
extern
"C"
{
43
#endif
44
46
enum
{
47
GFX_RUN_SKIP
= 0,
48
GFX_RUN_FILL
= 1,
49
GFX_RUN_COPY
= 2,
50
GFX_RUN_BLEND
= 3,
52
};
53
55
#define GFX_RUN_MAX 64
56
58
typedef
struct
{
59
int16_t
w
;
60
int16_t
h
;
61
uint32_t
bytes
;
62
const
uint8_t *
rle
;
63
}
gfx_sprite_t
;
64
80
bool
gfx_sprite_draw
(
gfx_canvas_t
*c,
int
x,
int
y,
const
gfx_sprite_t
*sp);
81
89
static
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.h
gfx: an RGB565 (16-bit red, green, blue) rasteriser with no dependencies.
gfx_sprite_draw
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
@ GFX_RUN_FILL
Definition
gfx_sprite.h:48
GFX_RUN_SKIP
@ GFX_RUN_SKIP
Definition
gfx_sprite.h:47
GFX_RUN_COPY
@ GFX_RUN_COPY
Definition
gfx_sprite.h:49
GFX_RUN_BLEND
@ GFX_RUN_BLEND
Definition
gfx_sprite.h:50
gfx_sprite_rect
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
gfx_canvas_t
Definition
gfx.h:129
gfx_rect_t
Definition
gfx.h:81
gfx_sprite_t
An encoded image with alpha.
Definition
gfx_sprite.h:58
gfx_sprite_t::w
int16_t w
Definition
gfx_sprite.h:59
gfx_sprite_t::rle
const uint8_t * rle
Definition
gfx_sprite.h:62
gfx_sprite_t::h
int16_t h
Definition
gfx_sprite.h:60
gfx_sprite_t::bytes
uint32_t bytes
Definition
gfx_sprite.h:61
shared
gfx
include
gfx_sprite.h
Generated by
1.18.0