summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim <tim@Admins-Mac-Pro-2.local>2013-06-19 14:18:35 +0100
committerTim <tim@Admins-Mac-Pro-2.local>2013-06-19 14:18:35 +0100
commit24bd98136d3c946ca5e5738cf990e20fd13b95dc (patch)
tree0e3cd90ebb2c4b9532ff111b12da22eb34d07039 /src
parentd035816f49ad9d8d7ae42d5e1aec7207cd84820e (diff)
MakfileHEADmaster
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp2
-rw-r--r--src/testApp.cpp32
-rw-r--r--src/testApp.h23
3 files changed, 31 insertions, 26 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 29b0a27..3cabbad 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4,7 +4,7 @@
//========================================================================
int main( ){
- ofSetupOpenGL(1024,768, OF_FULLSCREEN); // <-------- setup the GL context
+ ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context
diff --git a/src/testApp.cpp b/src/testApp.cpp
index 9aff6c9..7c97e53 100644
--- a/src/testApp.cpp
+++ b/src/testApp.cpp
@@ -117,19 +117,19 @@ void testApp::setup(){
camWidth=720;
camHeight=576;
grabber.initGrabber(camWidth,camHeight);
- gammamap=new unsigned char[256];
- line1=new unsigned char[camWidth];
- line2=new unsigned char[camWidth];
- outBuffer=new unsigned char[camWidth*camHeight*3];
-
- whitePt=0.9;
- blackPt=0.3;
+ gammamap=new unsigned char[256];
+ line1=new unsigned char[camWidth];
+ line2=new unsigned char[camWidth];
+ outBuffer=new unsigned char[camWidth*camHeight*3];
+
+ whitePt=0.9;
+ blackPt=0.3;
gamma=1.0;
//calc gamma map
- for (int i=0;i<256;i++){
- float ewp=max(whitePt,blackPt+0.1f); //limit range to 0.1
- gammamap[i]=(unsigned char)(pow(min(1.0f,max(0.0f,(((float(i)/255.0f)-blackPt)/(ewp-blackPt)))),gamma)*255.0);
+ for (int i=0;i<256;i++){
+ float ewp=max(whitePt,blackPt+0.1f); //limit range to 0.1
+ gammamap[i]=(unsigned char)(pow(min(1.0f,max(0.0f,(((float(i)/255.0f)-blackPt)/(ewp-blackPt)))),gamma)*255.0);
}
outTexture.allocate(camWidth,camHeight, GL_RGB);
@@ -140,7 +140,7 @@ void testApp::setup(){
// blanker.loadImage("black.png");
-
+ fullScreen=false;
setMidiState();
}
@@ -304,8 +304,8 @@ void testApp::draw(){
if (B_glitch) {
- //glEnable(GL_BLEND);
- //glBlendFunc(GL_CONSTANT_COLOR,GL_ONE);
+ //glEnable(GL_BLEND);
+ //glBlendFunc(GL_CONSTANT_COLOR,GL_ONE);
//glBlendColor(1.0f,1.0f,1.0f,0.9f);
//blanker.draw(0,0,ofGetWidth(),ofGetHeight());
}
@@ -533,6 +533,10 @@ void testApp::keyPressed (int key){
if(key == 'f'){
showFPS=!showFPS;
}
+ if(key == ' '){
+ fullScreen=!fullScreen;
+ ofSetFullscreen(fullScreen);
+ }
}
//--------------------------------------------------------------
@@ -819,7 +823,7 @@ void testApp::setMidiState(){
}
/*
-void sendNoteOn(int channel, int id, int value);
+void sendNoteOn(int channel, int id, int value);
void sendNoteOff(int channel, int id, int value);
void sendControlChange(int channel, int id, int value);
*/
diff --git a/src/testApp.h b/src/testApp.h
index 43540c6..3038e09 100644
--- a/src/testApp.h
+++ b/src/testApp.h
@@ -88,6 +88,7 @@ class testApp : public ofBaseApp, public ofxMidiListener{
ofShader maskShader;
bool showFPS;
+ bool fullScreen;
ofImage testImage;
@@ -129,23 +130,23 @@ class testApp : public ofBaseApp, public ofxMidiListener{
ofVideoGrabber grabber;
- unsigned char *gammamap;
- unsigned char *line1;
- unsigned char *line2;
+ unsigned char *gammamap;
+ unsigned char *line1;
+ unsigned char *line2;
unsigned char *outBuffer;
- int camWidth,camHeight;
-
- float whitePt;
- float blackPt;
+ int camWidth,camHeight;
+
+ float whitePt;
+ float blackPt;
float gamma;
- bool field2; //flag that there is a 2nd field waiting to be processed
- bool use2fields;
- int frameTime,grabTime; //keep track of field timing
+ bool field2; //flag that there is a 2nd field waiting to be processed
+ bool use2fields;
+ int frameTime,grabTime; //keep track of field timing
- bool deInterlace;
+ bool deInterlace;
ofTexture outTexture;
float F_movieSpeed;