mirror of
https://github.com/adafruit/Adafruit-GFX-Library.git
synced 2024-10-03 18:18:46 -04:00
Make canvas buffers protected instead of private members
A use case came up where it was helpful to be able to alter the buffer pointer in a subclass. This is esoteric and should be used with care.
This commit is contained in:
parent
91d916deeb
commit
740677a733
@ -328,10 +328,9 @@ protected:
|
|||||||
bool getRawPixel(int16_t x, int16_t y) const;
|
bool getRawPixel(int16_t x, int16_t y) const;
|
||||||
void drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
|
void drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
|
||||||
void drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
|
void drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
|
||||||
|
uint8_t *buffer; // protected (no longer private) for subclass flexibility
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint8_t *buffer;
|
|
||||||
|
|
||||||
#ifdef __AVR__
|
#ifdef __AVR__
|
||||||
// Bitmask tables of 0x80>>X and ~(0x80>>X), because X>>Y is slow on AVR
|
// Bitmask tables of 0x80>>X and ~(0x80>>X), because X>>Y is slow on AVR
|
||||||
static const uint8_t PROGMEM GFXsetBit[], GFXclrBit[];
|
static const uint8_t PROGMEM GFXsetBit[], GFXclrBit[];
|
||||||
@ -360,9 +359,7 @@ protected:
|
|||||||
uint8_t getRawPixel(int16_t x, int16_t y) const;
|
uint8_t getRawPixel(int16_t x, int16_t y) const;
|
||||||
void drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
|
void drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
|
||||||
void drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
|
void drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
|
||||||
|
uint8_t *buffer; // protected (no longer private) for subclass flexibility
|
||||||
private:
|
|
||||||
uint8_t *buffer;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A GFX 16-bit canvas context for graphics
|
/// A GFX 16-bit canvas context for graphics
|
||||||
@ -388,9 +385,7 @@ protected:
|
|||||||
uint16_t getRawPixel(int16_t x, int16_t y) const;
|
uint16_t getRawPixel(int16_t x, int16_t y) const;
|
||||||
void drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
|
void drawFastRawVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
|
||||||
void drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
|
void drawFastRawHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
|
||||||
|
uint16_t *buffer; // protected (no longer private) for subclass flexibility
|
||||||
private:
|
|
||||||
uint16_t *buffer;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _ADAFRUIT_GFX_H
|
#endif // _ADAFRUIT_GFX_H
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name=Adafruit GFX Library
|
name=Adafruit GFX Library
|
||||||
version=1.11.3
|
version=1.11.4
|
||||||
author=Adafruit
|
author=Adafruit
|
||||||
maintainer=Adafruit <info@adafruit.com>
|
maintainer=Adafruit <info@adafruit.com>
|
||||||
sentence=Adafruit GFX graphics core library, this is the 'core' class that all our other graphics libraries derive from.
|
sentence=Adafruit GFX graphics core library, this is the 'core' class that all our other graphics libraries derive from.
|
||||||
|
Loading…
Reference in New Issue
Block a user