diff options
author | falkTX <falktx@gmail.com> | 2014-05-24 15:41:24 +0100 |
---|---|---|
committer | falkTX <falktx@gmail.com> | 2014-05-24 15:41:24 +0100 |
commit | c689d18ffa3059ba12cea7a4f883525edae0d500 (patch) | |
tree | 626b2143fa6f5ef907329a44196caf9facc431b6 /dgl/NanoVG.hpp | |
parent | 52a8f482389daa30a44c5fa85e80ce2aac44bf50 (diff) |
Add some stuff to NanoImage to make it usable
Diffstat (limited to 'dgl/NanoVG.hpp')
-rw-r--r-- | dgl/NanoVG.hpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/dgl/NanoVG.hpp b/dgl/NanoVG.hpp index 666bd023..37caa475 100644 --- a/dgl/NanoVG.hpp +++ b/dgl/NanoVG.hpp @@ -38,11 +38,21 @@ class NanoImage { public: /** + Constructor for null image. + */ + NanoImage() noexcept; + + /** Destructor. */ ~NanoImage(); /** + Check if this is a valid image. + */ + bool isValid() const noexcept; + + /** Get size. */ Size<int> getSize() const; @@ -52,6 +62,12 @@ public: */ void updateImage(const uchar* data); + /** + Operator =. + Takes the image data from @a img, invalidating it. + */ + NanoImage operator=(NanoImage img) noexcept; + protected: /** Constructors are protected. @@ -62,12 +78,9 @@ protected: NanoImage(int w, int h, const uchar* data); private: - NVGcontext* const fContext; - const int fImageId; + NVGcontext* fContext; + int fImageId; friend class NanoVG; - - DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(NanoImage) - DISTRHO_PREVENT_HEAP_ALLOCATION }; // ----------------------------------------------------------------------- |