diff options
| author | Comment <tim@gray.(none)> | 2014-02-19 11:38:01 +0000 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2014-02-19 11:38:01 +0000 |
| commit | 4ee3054aa1af56d9fe00f70b62ab107f206e19b1 (patch) | |
| tree | 1da07f5e77875da94ff676c98be280fd93c31061 /offsetProject/src/ofApp.h | |
initial commit
Diffstat (limited to 'offsetProject/src/ofApp.h')
| -rw-r--r-- | offsetProject/src/ofApp.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/offsetProject/src/ofApp.h b/offsetProject/src/ofApp.h new file mode 100644 index 0000000..57ee0d0 --- /dev/null +++ b/offsetProject/src/ofApp.h @@ -0,0 +1,51 @@ +#pragma once + +#include "ofMain.h" +#include "ofxOpenCv.h" +#include "ofxKinect.h" + +#define MIN_TILE_SIZE 4 //has to be a divisor of 320 and 240 as the tiles are centred +#define MAX_TILE_SIZE 32 //has to be a power of 2 * MIN_TILE_SIZE + +class offsetCvColorImage : public ofxCvColorImage { + public: + void extend( int w, int h ) { + //cv::copyMakeBorder(cvImage,cvImage,(h-getHeight())/2,(h-getHeight())/2,(w-getWidth())/2,(w-getWidth())/2,cv::BORDER_REPLICATE); + } +}; + +class offsetCvGrayscaleImage : public ofxCvGrayscaleImage { + public: + void extend( int w, int h ) { + //cv::copyMakeBorder(cvImage,cvImage,(h-getHeight())/2,(h-getHeight())/2,(w-getWidth())/2,(w-getWidth())/2,cv::BORDER_REPLICATE); + } +}; + +class ofApp : public ofBaseApp { +public: + + void setup(); + void update(); + void draw(); + void exit(); + + void keyPressed(int key); + void mouseDragged(int x, int y, int button); + void mousePressed(int x, int y, int button); + void mouseReleased(int x, int y, int button); + void windowResized(int w, int h); + + ofxKinect kinect; + + offsetCvColorImage colourImage; + offsetCvGrayscaleImage depthImage; + + vector<offsetCvColorImage> colourTiles; + vector<offsetCvGrayscaleImage> depthTiles; + vector<pair<int,int> > numTiles; + + int farThreshold; + int angle; + + +}; |
