diff --git a/example/bin/data/quadwarp.xml b/example/bin/data/quadwarp.xml new file mode 100644 index 0000000..c70b184 --- /dev/null +++ b/example/bin/data/quadwarp.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/example/ofxQuadWarpExample.xcodeproj/project.pbxproj b/example/ofxQuadWarpExample.xcodeproj/project.pbxproj index d43d724..71b7c4f 100644 --- a/example/ofxQuadWarpExample.xcodeproj/project.pbxproj +++ b/example/ofxQuadWarpExample.xcodeproj/project.pbxproj @@ -901,6 +901,7 @@ "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)", "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_52)", ); + MACOSX_DEPLOYMENT_TARGET = 10.10; PREBINDING = NO; PRODUCT_NAME = ofxQuadWarpExampleDebug; WRAPPER_EXTENSION = app; @@ -988,6 +989,7 @@ "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_50)", "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)", ); + MACOSX_DEPLOYMENT_TARGET = 10.10; PREBINDING = NO; PRODUCT_NAME = ofxQuadWarpExample; WRAPPER_EXTENSION = app; diff --git a/example/ofxQuadWarpExample.xcodeproj/project.xcworkspace/xcshareddata/ofxQuadWarpExample.xccheckout b/example/ofxQuadWarpExample.xcodeproj/project.xcworkspace/xcshareddata/ofxQuadWarpExample.xccheckout index c8f858a..cb9b522 100644 --- a/example/ofxQuadWarpExample.xcodeproj/project.xcworkspace/xcshareddata/ofxQuadWarpExample.xccheckout +++ b/example/ofxQuadWarpExample.xcodeproj/project.xcworkspace/xcshareddata/ofxQuadWarpExample.xccheckout @@ -10,26 +10,30 @@ ofxQuadWarpExample IDESourceControlProjectOriginsDictionary + 14B8AC792BB3E433FAB0B60E4B728B5F7967140B + github.com:julapy/ofxQuadWarp.git 7A1153F4-82DE-49F1-BC06-5BFDA0261534 https://github.com/julapy/ofxQuadWarp.git C4622832-A4AC-476E-8C39-53A491E37455 https://github.com/julapy/openFrameworks.git IDESourceControlProjectPath - addons/ofxQuadWarp/example/ofxQuadWarpExample.xcodeproj/project.xcworkspace + example/ofxQuadWarpExample.xcodeproj IDESourceControlProjectRelativeInstallPathDictionary - 7A1153F4-82DE-49F1-BC06-5BFDA0261534 + 14B8AC792BB3E433FAB0B60E4B728B5F7967140B ../../.. + 7A1153F4-82DE-49F1-BC06-5BFDA0261534 + ../../../.. C4622832-A4AC-476E-8C39-53A491E37455 - ../../../../.. + ../../../../openFrameworks IDESourceControlProjectURL - https://github.com/julapy/ofxQuadWarp.git + github.com:julapy/ofxQuadWarp.git IDESourceControlProjectVersion - 110 + 111 IDESourceControlProjectWCCIdentifier - C4622832-A4AC-476E-8C39-53A491E37455 + 14B8AC792BB3E433FAB0B60E4B728B5F7967140B IDESourceControlProjectWCConfigurations @@ -38,6 +42,14 @@ IDESourceControlWCCIdentifierKey 7A1153F4-82DE-49F1-BC06-5BFDA0261534 IDESourceControlWCCName + + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 14B8AC792BB3E433FAB0B60E4B728B5F7967140B + IDESourceControlWCCName ofxQuadWarp diff --git a/example/src/ofApp.cpp b/example/src/ofApp.cpp index 5b40de9..637a090 100644 --- a/example/src/ofApp.cpp +++ b/example/src/ofApp.cpp @@ -28,16 +28,20 @@ void ofApp::setup() { //-------------------------------------------------------------- void ofApp::update() { - if(ofGetFrameNum() % 5 != 0) { - // only update every 5 frames. - return; - } +// if(ofGetFrameNum() % 5 != 0) { +// // only update every 5 frames. +// return; +// } +// +// for(int i=0; i<10; i++) { +// // randomise points over the image area. +// points[i].x = ofRandom(img.width); +// points[i].y = ofRandom(img.height); +// } - for(int i=0; i<10; i++) { - // randomise points over the image area. - points[i].x = ofRandom(img.width); - points[i].y = ofRandom(img.height); - } + fbo.begin(); + img.draw(0, 0); + fbo.end(); } //-------------------------------------------------------------- @@ -46,9 +50,7 @@ void ofApp::draw() { //======================== draw image into fbo. - fbo.begin(); - img.draw(0, 0); - fbo.end(); + //======================== get our quad warp matrix. @@ -63,17 +65,17 @@ void ofApp::draw() { //======================== use the matrix to transform points. - ofSetLineWidth(2); - ofSetColor(ofColor::cyan); - - for(int i=0; i<9; i++) { - int j = i + 1; - - ofVec3f p1 = mat.preMult(ofVec3f(points[i].x, points[i].y, 0)); - ofVec3f p2 = mat.preMult(ofVec3f(points[j].x, points[j].y, 0)); - - ofDrawLine(p1.x, p1.y, p2.x, p2.y); - } +// ofSetLineWidth(2); +// ofSetColor(ofColor::cyan); +// +// for(int i=0; i<9; i++) { +// int j = i + 1; +// +// ofVec3f p1 = mat.preMult(ofVec3f(points[i].x, points[i].y, 0)); +// ofVec3f p2 = mat.preMult(ofVec3f(points[j].x, points[j].y, 0)); +// +// ofLine(p1.x, p1.y, p2.x, p2.y); +// } //======================== draw quad warp ui. @@ -91,11 +93,11 @@ void ofApp::draw() { //======================== info. - ofSetColor(ofColor::white); - ofDrawBitmapString("to warp the image, drag the corners of the image.", 20, 30); - ofDrawBitmapString("press 's' to toggle quad warp UI. this will also disable quad warp interaction.", 20, 50); - ofDrawBitmapString("press & hold 1, 2, 3, 4 to snap that point to the mouse", 20, 70); - ofDrawBitmapString("when a corner is selected (red), use keyboard arrow keys to nudge the corner position.", 20, 90); +// ofSetColor(ofColor::white); +// ofDrawBitmapString("to warp the image, drag the corners of the image.", 20, 30); +// ofDrawBitmapString("press 's' to toggle quad warp UI. this will also disable quad warp interaction.", 20, 50); +// ofDrawBitmapString("press & hold 1, 2, 3, 4 to snap that point to the mouse", 20, 70); +// ofDrawBitmapString("when a corner is selected (red), use keyboard arrow keys to nudge the corner position.", 20, 90); } void ofApp::exit() { diff --git a/src/ofxQuadWarp.cpp b/src/ofxQuadWarp.cpp index 2723489..5a3374f 100755 --- a/src/ofxQuadWarp.cpp +++ b/src/ofxQuadWarp.cpp @@ -504,7 +504,7 @@ void ofxQuadWarp::drawQuadOutline() { for(int i=0; i<4; i++) { int j = (i+1) % 4; - ofDrawLine(dstPoints[i].x + position.x, + ofLine(dstPoints[i].x + position.x, dstPoints[i].y + position.y, dstPoints[j].x + position.x, dstPoints[j].y + position.y); @@ -547,7 +547,7 @@ void ofxQuadWarp::drawSelectedCorner() { } void ofxQuadWarp::drawCornerAt(const ofPoint & point) { - ofDrawRectangle(point.x + position.x - anchorSizeHalf, + ofRect(point.x + position.x - anchorSizeHalf, point.y + position.y - anchorSizeHalf, anchorSize, anchorSize); }