Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (1.62 KB)

1
#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
/**
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
basic_sprite_t* (basic_sprite_ctor)(const char *const *xpm, int16_t u0, int16_t v0);
23
/**
24
 * @brief Destruct basic sprite.
25
 * @param   p   Pointer to basic sprite to destruct.
26
 */
27
void            (basic_sprite_dtor)(basic_sprite_t *p);
28
/**
29
 * @brief Get basic sprite map (pixels).
30
 * @param   p   Pointer to basic sprite
31
 * @return  Pixel map
32
 */
33
const uint8_t* (basic_sprite_get_map)(const basic_sprite_t *p);
34
/**
35
 * @brief Get width.
36
 * @param   p   Pointer to basic sprite
37
 * @return      Width
38
 */
39
uint16_t       (basic_sprite_get_w)  (const basic_sprite_t *p);
40
/**
41
 * @brief Get height.
42
 * @param   p   Pointer to basic sprite
43
 * @return      Height
44
 */
45
uint16_t       (basic_sprite_get_h)  (const basic_sprite_t *p);
46
/**
47
 * @brief Get X-center of the basic sprite.
48
 * @param   p   Pointer to basic sprite
49
 * @return      X-center
50
 */
51
int16_t        (basic_sprite_get_u0) (const basic_sprite_t *p);
52
/**
53
 * @brief Get Y-center of the basic sprite.
54
 * @param   p   Pointer to basic sprite
55
 * @return      Y-center
56
 */
57
int16_t        (basic_sprite_get_v0) (const basic_sprite_t *p);
58

    
59
/**
60
 * @}
61
 */
62

    
63
#endif //BASIC_SPRITE_H_INCLUDED