use 128*64
Fork of Adafruit_FeatherOLED by
Revision 14:edb3c36aa1a7, committed 2014-10-25
- Comitter:
- nkhorman
- Date:
- Sat Oct 25 20:41:38 2014 +0000
- Parent:
- 13:8f03f908f22a
- Child:
- 15:77feec1c0684
- Commit message:
- Code space optimizations;; Make simple set/getter functions inlined.; Fix ifdef around setTextSize() to be either GFX_WANT_ABSTRACTS or GFX_SIZEABLE_TEXT; ifdef drawBitmap() w/ GFX_WANT_ABSTRACTS.;
Changed in this revision
| Adafruit_GFX.cpp | Show annotated file Show diff for this revision Revisions of this file |
| Adafruit_GFX.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Adafruit_GFX.cpp Tue Oct 21 02:30:58 2014 +0000
+++ b/Adafruit_GFX.cpp Sat Oct 25 20:41:38 2014 +0000
@@ -349,7 +349,6 @@
drawFastHLine(a, y, b-a+1, color);
}
}
-#endif
void Adafruit_GFX::drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color)
{
@@ -362,6 +361,7 @@
}
}
}
+#endif
size_t Adafruit_GFX::writeChar(uint8_t c)
{
--- a/Adafruit_GFX.h Tue Oct 21 02:30:58 2014 +0000
+++ b/Adafruit_GFX.h Sat Oct 25 20:41:38 2014 +0000
@@ -119,6 +119,10 @@
* @note GFX_WANT_ABSTRACTS must be defined in Adafruit_GFX_config.h
*/
void fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);
+ /** Draw a bitmap
+ * @note GFX_WANT_ABSTRACTS must be defined in Adafruit_GFX_config.h
+ */
+ void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color);
#endif
#if defined(GFX_WANT_ABSTRACTS) || defined(GFX_SIZEABLE_TEXT)
@@ -136,37 +140,35 @@
virtual void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
#endif
- /// Draw a bitmap
- void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color);
/// Draw a text character at a specified pixel location
void drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size);
/// Draw a text character at the text cursor location
size_t writeChar(uint8_t);
/// Get the width of the display in pixels
- int16_t width(void) { return _width; };
+ inline int16_t width(void) { return _width; };
/// Get the height of the display in pixels
- int16_t height(void) { return _height; };
+ inline int16_t height(void) { return _height; };
/// Set the text cursor location, based on the size of the text
- void setTextCursor(int16_t x, int16_t y) { cursor_x = x; cursor_y = y; };
-#if defined(GFX_SIZEABLE_TEXT)
+ inline void setTextCursor(int16_t x, int16_t y) { cursor_x = x; cursor_y = y; };
+#if defined(GFX_WANT_ABSTRACTS) || defined(GFX_SIZEABLE_TEXT)
/** Set the size of the text to be drawn
* @note Make sure to enable either GFX_SIZEABLE_TEXT or GFX_WANT_ABSTRACTS
*/
- void setTextSize(uint8_t s) { textsize = (s > 0) ? s : 1; };
+ inline void setTextSize(uint8_t s) { textsize = (s > 0) ? s : 1; };
#endif
/// Set the text foreground and background colors to be the same
- void setTextColor(uint16_t c) { textcolor = c; textbgcolor = c; }
+ inline void setTextColor(uint16_t c) { textcolor = c; textbgcolor = c; }
/// Set the text foreground and background colors independantly
- void setTextColor(uint16_t c, uint16_t b) { textcolor = c; textbgcolor = b; };
+ inline void setTextColor(uint16_t c, uint16_t b) { textcolor = c; textbgcolor = b; };
/// Set text wraping mode true or false
- void setTextWrap(bool w) { wrap = w; };
+ inline void setTextWrap(bool w) { wrap = w; };
/// Set the display rotation, 1, 2, 3, or 4
void setRotation(uint8_t r);
/// Get the current rotation
- uint8_t getRotation(void) { rotation %= 4; return rotation; };
+ inline uint8_t getRotation(void) { rotation %= 4; return rotation; };
protected:
int16_t _rawWidth, _rawHeight; // this is the 'raw' display w/h - never changes
