-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathIldaProcessor.h
More file actions
88 lines (58 loc) · 1.72 KB
/
IldaProcessor.h
File metadata and controls
88 lines (58 loc) · 1.72 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef ILDAPROCESSOR_H
#define ILDAPROCESSOR_H
#include "Arduino.h"
#include "IldaStreamReader.h"
class IldaDataReaderBase
{
public:
virtual void Init();
virtual int Read(uint8_t * buf, int bufSize);
virtual void ResetToBegin();
};
class IldaOutputBase
{
public:
virtual void Init();
virtual void SetCoords(int16_t x, int16_t y, int16_t z);
virtual void SetColor(uint8_t r, uint8_t g, uint8_t b);
virtual void SetBlank(bool value);
virtual void Out();
virtual void SetAndOut(int16_t x, int16_t y, int16_t z, uint8_t r, uint8_t g, uint8_t b, bool blank);
virtual void NoDataLed(bool newState);
};
class IldaProcessor
{
public:
IldaProcessor(
IldaDataReaderBase * ildaDataReader,
IldaOutputBase * ildaOutput,
IldaStreamReader * ildaStreamReader);
void Init();
int Process();
void Reset();
protected:
IldaDataReaderBase * _ildaDataReader;
IldaOutputBase * _ildaOutput;
IldaStreamReader * _ildaStreamReader;
int _nodatamillisStart;
int _nodatamillisCurrent;
// read and store
uint8_t * _databuf = 0;
int _dataBufSize;
int _code;
IldaFrame _frame;
uint8_t * _recordBuf = 0;
IldaRecordF2 * _colorPalette = 0;
int _colorPaletteReadID;
// output
int16_t _x;
int16_t _y;
int16_t _z;
int16_t _r;
int16_t _g;
int16_t _b;
int16_t _testx = 0;
bool _blanking;
bool _lastPoint;
};
#endif