flipdot/flipcontrol_esp32/include/image.h

54 lines
1013 B
C++

#ifndef IMAGE_H
#define IMAGE_H
#include <Arduino.h>
#include "flipdot.h"
#define COLUMNS 50
#define ROWS 16
#define UPDATE_INTERVAL 5 //TODO: remove this
class Image
{
private:
Flipdot flipdot;
//buffer is 16 bit because of 16 Rows
uint16_t frontBuffer[COLUMNS]; //1 is bright dot / set dot. 0 is black / cleared
uint16_t backBuffer[COLUMNS];
bool flag_updating; //when true, display flip is in progress. frontBuffer does not match backBuffer
uint8_t update_counter; //used for keeping track of progress for updating
int countz=0;
unsigned long lastUpdateMillis; //time when last dots where started flipping
unsigned long updateInterval;
public:
Image();
void init();
bool updateByColumn(bool direction, bool clearFirst, bool optimizeClear, bool optimizeSet);
uint8_t getW(); //returns Columns
uint8_t getH(); //returns Rows
void setBuffer_solid(bool set);
void loop_testDots();
void loop_drawClearTest();
};
#endif