diff --git a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h index 6fcca10..c5df926 100644 --- a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h +++ b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h @@ -571,6 +571,11 @@ public: void drawPixel(int16_t x, int16_t y, CRGB color); #endif +#ifdef NO_GFX + inline int16_t width() const { return m_cfg.mx_width * m_cfg.chain_length; } + inline int16_t height() const { return m_cfg.mx_height; } +#endif + void drawIcon(int *ico, int16_t x, int16_t y, int16_t cols, int16_t rows); // Colour 444 is a 4 bit scale, so 0 to 15, colour 565 takes a 0-255 bit value, so scale up by 255/15 (i.e. 17)! diff --git a/src/ESP32-VirtualMatrixPanel-I2S-DMA.h b/src/ESP32-VirtualMatrixPanel-I2S-DMA.h index 2738599..a6b9d15 100644 --- a/src/ESP32-VirtualMatrixPanel-I2S-DMA.h +++ b/src/ESP32-VirtualMatrixPanel-I2S-DMA.h @@ -124,6 +124,11 @@ public: void drawPixel(int16_t x, int16_t y, CRGB color); #endif +#ifdef NO_GFX + inline int16_t width() const { return _virtualResX; } + inline int16_t height() const { return _virtualResY; } +#endif + uint16_t color444(uint8_t r, uint8_t g, uint8_t b) { return display->color444(r, g, b); @@ -479,6 +484,9 @@ inline void VirtualMatrixPanel::setRotation(uint8_t rotate) // Change the _width and _height variables used by the underlying adafruit gfx library. // Actual pixel rotation / mapping is done in the getCoords function. +#ifdef NO_GFX + int8_t rotation; +#endif rotation = (rotate & 3); switch (rotation) { case 0: // nothing