blob: 3b3acadfc4d1eb9bcd73ccfdca66fd1a15bedb7d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#ifndef CAMERA_H__
#define CAMERA_H__
/* *******************************************************************
* Includes
* ******************************************************************/
#include "Cursor.h"
#include <stdint.h>
#include <stdbool.h>
/* *******************************************************************
* Defines
* ******************************************************************/
/* *******************************************************************
* Global types definition
* ******************************************************************/
/* Forward declaration. */
class Cursor;
/* *******************************************************************
* Global variables declaration
* ******************************************************************/
/* *******************************************************************
* Global functions declaration
* ******************************************************************/
/* *******************************************************************
* Class definition
* ******************************************************************/
class Camera
{
public:
Camera(void);
void adjustLock(const bool bLock);
bool isLocked(void) const;
int16_t getX(const uint16_t x) const;
int16_t getY(const uint16_t y) const;
uint16_t getRealX(const int16_t x) const;
uint16_t getRealY(const int16_t y) const;
/* Event handlers. */
void onLeftBtnPressed(Cursor& cursor);
void onRightBtnPressed(Cursor& cursor);
void onUpBtnPressed(Cursor& cursor);
void onDownBtnPressed(Cursor& cursor);
private:
bool _bLocked;
int16_t _xOffset;
int16_t _yOffset;
uint8_t _speedTimer;
};
#endif /* CAMERA_H__ */
|