summaryrefslogtreecommitdiff
path: root/rotord/src/Pixels.h
diff options
context:
space:
mode:
authorComment <tim@gray.(none)>2013-07-26 22:46:17 +0100
committerComment <tim@gray.(none)>2013-07-26 22:46:17 +0100
commitf4170d6bfb763ad0af4002277a37dcd1692534d5 (patch)
treedb32d9753de780063e3afeb64764e13e5c4f5087 /rotord/src/Pixels.h
parent3d7eea02aa7a155b84c8c74ecbfd55a1941a9297 (diff)
tidy files
Diffstat (limited to 'rotord/src/Pixels.h')
-rw-r--r--rotord/src/Pixels.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/rotord/src/Pixels.h b/rotord/src/Pixels.h
new file mode 100644
index 0000000..b6f5865
--- /dev/null
+++ b/rotord/src/Pixels.h
@@ -0,0 +1,28 @@
+#include <stdint.h>
+#include <algorithm>
+//for now always uint8_t* rather than templated
+
+class Pixels{
+ public:
+ Pixels();
+ ~Pixels();
+ void allocate(int w, int h, int channels);
+ bool isAllocated() const;
+ void setFromExternalPixels(uint8_t * newPixels,int w, int h, int channels);
+ uint8_t * getPixels();
+ int getWidth() const;
+ int getHeight() const;
+ void clear();
+ void swap(Pixels & pix);
+ int getBytesPerPixel() const;
+ int getNumChannels() const;
+ void set(uint8_t val);
+ private:
+ uint8_t * pixels;
+ int width;
+ int height;
+ int channels;
+ bool bAllocated;
+ bool pixelsOwner; // if set from external data don't delete it
+};
+