Permalink
Browse files

added projector geometry calibrate

  • Loading branch information...
1 parent aa7b767 commit 2c7a0e4ea9928fa8d820357950fdf8c6b748248e @kylemcdonald kylemcdonald committed Feb 8, 2012
Oops, something went wrong.
@@ -0,0 +1,9 @@
+//THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT.
+//THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED
+OF_PATH = ../../..
+
+//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE
+#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"
+
+OTHER_LDFLAGS = $(OF_CORE_LIBS)
+HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) "../../../addons/ofxCv/libs/ofxCv/include/" "../../../addons/ofxCv/libs/opencv/include/"
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.openFrameworks</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+</dict>
+</plist>
@@ -0,0 +1,52 @@
+#pragma once
+
+#include "ofMain.h"
+
+class Lut {
+private:
+ ofTexture* source;
+ ofFloatImage lut;
+ ofFbo result;
+
+ ofShader lutShader;
+
+public:
+ void setupText(int width, int height, string filename) {
+ result.allocate(width, height, GL_RGB); // doesn't need a depth buffer
+ lutShader.load("", "shaders/lut.frag");
+
+ lut.allocate(256, 1, OF_IMAGE_COLOR);
+ ofFile lutFile(filename);
+ ofBuffer lutBuffer = lutFile.readToBuffer();
+ int x = 0;
+ while(!lutBuffer.isLastLine()) {
+ string curLine = lutBuffer.getNextLine();
+ vector<string> parts = ofSplitString(curLine, "\t");
+ lut.setColor(x, 0, ofFloatColor(ofToFloat(parts[0]), ofToFloat(parts[1]), ofToFloat(parts[2])));
+ x++;
+ }
+ lut.update();
+ }
+ void setup(int width, int height, string filename) {
+ result.allocate(width, height, GL_RGB); // doesn't need a depth buffer
+ lutShader.load("", "shaders/lut.frag");
+ lut.loadImage(filename);
+ }
+ void setSource(ofTexture& source) {
+ this->source = &source;
+ }
+ void update() {
+ ofPushMatrix();
+ result.begin();
+ lutShader.begin();
+ lutShader.setUniformTexture("source", *source, 0);
+ lutShader.setUniformTexture("lut", lut.getTextureReference(), 1);
+ source->draw(0, 0);
+ lutShader.end();
+ result.end();
+ ofPopMatrix();
+ }
+ ofTexture& getTextureReference() {
+ return result.getTextureReference();
+ }
+};
@@ -0,0 +1,8 @@
+#include "testApp.h"
+#include "ofAppGlutWindow.h"
+
+int main() {
+ ofAppGlutWindow window;
+ ofSetupOpenGL(&window, 1280, 1024 / 2, OF_WINDOW);
+ ofRunApp(new testApp());
+}
Oops, something went wrong.

0 comments on commit 2c7a0e4

Please sign in to comment.