summaryrefslogtreecommitdiff
path: root/dgl/NanoVG.hpp
diff options
context:
space:
mode:
authorfalkTX <falktx@gmail.com>2014-05-24 15:41:24 +0100
committerfalkTX <falktx@gmail.com>2014-05-24 15:41:24 +0100
commitc689d18ffa3059ba12cea7a4f883525edae0d500 (patch)
tree626b2143fa6f5ef907329a44196caf9facc431b6 /dgl/NanoVG.hpp
parent52a8f482389daa30a44c5fa85e80ce2aac44bf50 (diff)
Add some stuff to NanoImage to make it usable
Diffstat (limited to 'dgl/NanoVG.hpp')
-rw-r--r--dgl/NanoVG.hpp23
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
};
// -----------------------------------------------------------------------