1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-11-09 09:46:18 +01:00
doorlockd-mirror/doorlockd/epaper.h

43 lines
881 B
C
Raw Normal View History

2015-05-11 00:18:22 +02:00
#ifndef EPAPER_H
#define EPAPER_H
#include <string>
#include <array>
#include "logger.h"
2015-05-21 13:35:30 +02:00
/*
* The "Epaper" class.
*
* Wrapper for the epaper third Party library.
*
* Exists as singleton, as only one display may exist.
*/
2015-05-11 00:18:22 +02:00
class Epaper {
public:
static Epaper &get();
~Epaper();
2015-05-21 13:35:30 +02:00
// This function will draw template.png to the display and
// convert the uri to a QR-Code and paste it on top of template.png
// using imagemagick
2015-05-11 00:18:22 +02:00
void draw(const std::string &uri);
private:
2015-05-21 13:35:30 +02:00
constexpr static int _HEIGHT = 176; // In Pixel
constexpr static int _WIDTH = 33; // In Byte
constexpr static int _ARRAY_SIZE = _HEIGHT * _WIDTH;
2015-05-11 00:18:22 +02:00
Epaper();
2015-05-21 13:35:30 +02:00
// The old image is needed when updating the Epaper display
// It informs the display which pixels have to be flipped
uint8_t _prevImg[_ARRAY_SIZE];
2015-05-11 00:18:22 +02:00
const Logger &_logger;
};
#endif