Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (1.65 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 339 up20180642
14
/**
15
 * @brief Basic sprite.
16
 */
17 331 up20180642
typedef struct basic_sprite basic_sprite_t;
18
19 333 up20180642
/**
20
 * @brief Construct basic sprite.
21
 * @param   xpm     XPM array to build the basic sprite from
22
 * @param   u0      X-center of the XPM.
23
 * @param   v0      Y-center of the XPM.
24
 * @return  Pointer to created basic_sprite_t, or NULL if fails
25
 */
26 331 up20180642
basic_sprite_t* (basic_sprite_ctor)(const char *const *xpm, int16_t u0, int16_t v0);
27 333 up20180642
/**
28
 * @brief Destruct basic sprite.
29
 * @param   p   Pointer to basic sprite to destruct.
30
 */
31 331 up20180642
void            (basic_sprite_dtor)(basic_sprite_t *p);
32 333 up20180642
/**
33
 * @brief Get basic sprite map (pixels).
34
 * @param   p   Pointer to basic sprite
35
 * @return  Pixel map
36
 */
37 331 up20180642
const uint8_t* (basic_sprite_get_map)(const basic_sprite_t *p);
38 333 up20180642
/**
39
 * @brief Get width.
40
 * @param   p   Pointer to basic sprite
41
 * @return      Width
42
 */
43 331 up20180642
uint16_t       (basic_sprite_get_w)  (const basic_sprite_t *p);
44 333 up20180642
/**
45
 * @brief Get height.
46
 * @param   p   Pointer to basic sprite
47
 * @return      Height
48
 */
49 331 up20180642
uint16_t       (basic_sprite_get_h)  (const basic_sprite_t *p);
50 333 up20180642
/**
51
 * @brief Get X-center of the basic sprite.
52
 * @param   p   Pointer to basic sprite
53
 * @return      X-center
54
 */
55 331 up20180642
int16_t        (basic_sprite_get_u0) (const basic_sprite_t *p);
56 333 up20180642
/**
57
 * @brief Get Y-center of the basic sprite.
58
 * @param   p   Pointer to basic sprite
59
 * @return      Y-center
60
 */
61 331 up20180642
int16_t        (basic_sprite_get_v0) (const basic_sprite_t *p);
62
63
/**
64
 * @}
65
 */
66
67
#endif //BASIC_SPRITE_H_INCLUDED