Project

General

Profile

Statistics
| Revision:

root / proj / libs / graph / include / basic_sprite.h @ 333

History | View | Annotate | Download (1.62 KB)

1 331 up20180642
#ifndef BASIC_SPRITE_H_INCLUDED
2
#define BASIC_SPRITE_H_INCLUDED
3
4
/**
5
 * @defgroup basic_sprite_t basic_sprite_t
6
 * @ingroup graph
7
 * @brief Basic sprite module.
8
 *
9
 * A basic sprite allows to represent an image file.
10
 *
11
 * @{
12
 */
13
typedef struct basic_sprite basic_sprite_t;
14
15 333 up20180642
/**
16
 * @brief Construct basic sprite.
17
 * @param   xpm     XPM array to build the basic sprite from
18
 * @param   u0      X-center of the XPM.
19
 * @param   v0      Y-center of the XPM.
20
 * @return  Pointer to created basic_sprite_t, or NULL if fails
21
 */
22 331 up20180642
basic_sprite_t* (basic_sprite_ctor)(const char *const *xpm, int16_t u0, int16_t v0);
23 333 up20180642
/**
24
 * @brief Destruct basic sprite.
25
 * @param   p   Pointer to basic sprite to destruct.
26
 */
27 331 up20180642
void            (basic_sprite_dtor)(basic_sprite_t *p);
28 333 up20180642
/**
29
 * @brief Get basic sprite map (pixels).
30
 * @param   p   Pointer to basic sprite
31
 * @return  Pixel map
32
 */
33 331 up20180642
const uint8_t* (basic_sprite_get_map)(const basic_sprite_t *p);
34 333 up20180642
/**
35
 * @brief Get width.
36
 * @param   p   Pointer to basic sprite
37
 * @return      Width
38
 */
39 331 up20180642
uint16_t       (basic_sprite_get_w)  (const basic_sprite_t *p);
40 333 up20180642
/**
41
 * @brief Get height.
42
 * @param   p   Pointer to basic sprite
43
 * @return      Height
44
 */
45 331 up20180642
uint16_t       (basic_sprite_get_h)  (const basic_sprite_t *p);
46 333 up20180642
/**
47
 * @brief Get X-center of the basic sprite.
48
 * @param   p   Pointer to basic sprite
49
 * @return      X-center
50
 */
51 331 up20180642
int16_t        (basic_sprite_get_u0) (const basic_sprite_t *p);
52 333 up20180642
/**
53
 * @brief Get Y-center of the basic sprite.
54
 * @param   p   Pointer to basic sprite
55
 * @return      Y-center
56
 */
57 331 up20180642
int16_t        (basic_sprite_get_v0) (const basic_sprite_t *p);
58
59
/**
60
 * @}
61
 */
62
63
#endif //BASIC_SPRITE_H_INCLUDED