diff options
| author | Comment <tim@gray.(none)> | 2014-02-26 10:58:43 +0000 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2014-02-26 10:58:43 +0000 |
| commit | 8740fb5e6b9084ea548f11d1ab1944fa653a82d7 (patch) | |
| tree | 94534bd1788d1f967c7859d379bc351d29a6e4ee /offsetProject | |
| parent | 4043777c902b5f4297b133a0435be91083f3f02a (diff) | |
changes
Diffstat (limited to 'offsetProject')
| -rw-r--r-- | offsetProject/src/ofApp.cpp | 11 | ||||
| -rw-r--r-- | offsetProject/src/ofApp.h | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/offsetProject/src/ofApp.cpp b/offsetProject/src/ofApp.cpp index 144512c..ab02ea2 100644 --- a/offsetProject/src/ofApp.cpp +++ b/offsetProject/src/ofApp.cpp @@ -113,7 +113,7 @@ void ofApp::update() { void ofApp::checktile(int level,int x,int y,int size){ int levels_factor=255/levels; - if (depthTiles[level].getPixels()[y*((int)depthTiles[level].getHeight())+x]>level*levels_factor&&level>0){ + if (depthTiles[level].getPixels()[y*((int)depthTiles[level].getWidth())+x]>level*levels_factor&&level>0){ for (int i=0;i<2;i++){ for (int j=0;j<2;j++){ checktile(level-1,x*2+i,y*2+j,size/2); @@ -121,9 +121,9 @@ void ofApp::checktile(int level,int x,int y,int size){ } } else { - ofSetColor(depthTiles[level].getPixels()[(y*((int)depthTiles[level].getHeight())+x)*3], - depthTiles[level].getPixels()[(y*((int)depthTiles[level].getHeight())+x)*3+1], - depthTiles[level].getPixels()[(y*((int)depthTiles[level].getHeight())+x)*3+2]); + ofSetColor(colourTiles[level].getPixels()[(y*((int)colourTiles[level].getWidth())+x)*3], + colourTiles[level].getPixels()[(y*((int)colourTiles[level].getWidth())+x)*3+1], + colourTiles[level].getPixels()[(y*((int)colourTiles[level].getWidth())+x)*3+2]); ofRect(x*size,y*size,size,size); } } @@ -135,7 +135,8 @@ void ofApp::draw() { //recursively draw pixels - int pixelsize=ofGetWidth()/MAX_TILE_SIZE; + int pixelsize=ofGetWidth()/colourTiles[levels-1].getWidth(); + //int yoffset= for (int i=0;i<colourTiles[levels-1].getWidth();i++){ for (int j=0;j<colourTiles[levels-1].getHeight();j++){ diff --git a/offsetProject/src/ofApp.h b/offsetProject/src/ofApp.h index 599ee5e..6188611 100644 --- a/offsetProject/src/ofApp.h +++ b/offsetProject/src/ofApp.h @@ -4,8 +4,8 @@ #include "ofxOpenCv.h" #include "ofxKinect.h" -#define MIN_TILE_SIZE 8 //has to be a divisor of 320 and 240 as the tiles are centred -#define MAX_TILE_SIZE 64 //has to be a power of 2 * MIN_TILE_SIZE +#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: |
