Maxim Integrated / Mbed OS MAXREFDES155#

Dependencies:   MaximInterface

Revision:
8:a0d75dff3c9b
Parent:
0:33d4e66780c0
Child:
10:71359af61af8
--- a/Image.hpp	Thu Mar 09 11:38:33 2017 -0600
+++ b/Image.hpp	Thu Apr 06 15:16:30 2017 -0500
@@ -39,23 +39,13 @@
 class Image : public Graphic
 {
 public:
-    explicit Image(const Bitmap & bitmap, Graphic * parent = NULL) :
-        Graphic(parent), m_bitmap(bitmap)
-    {
-        // Graphic dimensions default to the bitmap dimensions.
-        setWidth(preferredWidth());
-        setHeight(preferredHeight());
-    }
+    explicit Image(const Bitmap & bitmap) : m_bitmap(bitmap) { }
     
-    virtual int preferredWidth() const { return m_bitmap.width(); }
-    virtual int preferredHeight() const { return m_bitmap.height(); }
+    int preferredWidth() const { return m_bitmap.width(); }
+    int preferredHeight() const { return m_bitmap.height(); }
     
-    virtual Bitmap render() const
-    {
-        Bitmap bitmap(width(), height());
-        bitmap.overlay(m_bitmap, 0, 0);
-        return bitmap;
-    }
+protected:
+    virtual void doRender(Bitmap & bitmap) const;
 
 private:
     Bitmap m_bitmap;