summaryrefslogtreecommitdiff
path: root/Camera.h
blob: 6ff30459ba0840991dee092ee3cf43ec035183dd (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
#ifndef CAMERA_H__
#define CAMERA_H__

/* *************************************
 *  Includes
 * *************************************/

#include "Cursor.h"
#include <stdint.h>
#include <stdbool.h>

/* *************************************
 *  Defines
 * *************************************/

/* *************************************
 *  Structs and enums
 * *************************************/

/* *************************************
 *  Class definition
 * *************************************/

class Camera
{
    public:
        Camera(void);
        void adjustLock(const bool bLock);
        bool isLocked(void) const;
        uint8_t getX(const uint8_t x) const;
        uint8_t getY(const uint8_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__ */