Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (1.65 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

    
14
/**
15
 * @brief Basic sprite.
16
 */
17
typedef struct basic_sprite basic_sprite_t;
18

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

    
63
/**
64
 * @}
65
 */
66

    
67
#endif //BASIC_SPRITE_H_INCLUDED