Adafruit_GFX.h 658 B

123456789101112131415161718192021222324
  1. #pragma once
  2. // Minimal substitute for the real Adafruit GFX Library.
  3. // Rotation is always 0 (esphome rotates before gxepd2 sees the image).
  4. #include <cstdint>
  5. class Adafruit_GFX {
  6. public:
  7. Adafruit_GFX(int16_t w, int16_t h) : WIDTH(w), HEIGHT(h), width_(w), height_(h) {}
  8. virtual ~Adafruit_GFX() = default;
  9. int16_t width() const { return this->width_; }
  10. int16_t height() const { return this->height_; }
  11. uint8_t getRotation() const { return this->rotation_; }
  12. void setRotation(uint8_t r) { this->rotation_ = r % 4; }
  13. protected:
  14. const int16_t WIDTH;
  15. const int16_t HEIGHT;
  16. int16_t width_;
  17. int16_t height_;
  18. uint8_t rotation_{0};
  19. };