YAHAL
Yet Another Hardware Abstraction Library
Loading...
Searching...
No Matches
pixel_stream_rgb565.h
1/*
2 * pixel_stream_rgb565.h
3 *
4 * Created on: 13.03.2018
5 * Author: student
6 */
7
8#ifndef _PIXEL_STREAM_RGB565_H_
9#define _PIXEL_STREAM_RGB565_H_
10
11#include "lcd_interface.h"
12#include <cstdlib>
13
15{
16public:
17
18 pixel_stream_rgb565(const uint16_t *data, size_t size)
19 : _data(data), _size(size), _index(0) { }
20
21 virtual ~pixel_stream_rgb565() { }
22
23 inline color_t getColorType() override {
24 return LCD::COLORTYPE_RGB565;
25 }
26
27 inline color_t getNext() override {
28 return _data[_index++] | LCD::COLORTYPE_RGB565;
29 }
30
31 inline void reset() { _index = 0; }
32
33private:
34
35 const uint16_t * _data;
36 size_t _size;
37 size_t _index;
38};
39
40#endif /* _PIXEL_STREAM_RGB565_H_ */