Skip to content

Instantly share code, notes, and snippets.

View stephanschulz's full-sized avatar

Stephan Schulz stephanschulz

View GitHub Profile
/*
* Copyright (c) 2013 Dan Wilcox <danomatika@gmail.com>
*
* BSD Simplified License.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
*
* See https://github.com/danomatika/ofxMidi for documentation
*
*/
#include "ofApp.h"
int speakerStates[10];
//--------------------------------------------------------------
void ofApp::setup(){
for(int i=0; i<10;i++){
speakerStates[i] = 0;
}
}
@stephanschulz
stephanschulz / adblockers.eml
Created January 8, 2018 01:19 — forked from kevinr/adblockers.eml
Subject: Ad blockers
Here are the two ad blockers I use and recommend:
Adblock Plus:
https://chrome.google.com/webstore/detail/adblock-plus/cfhdojbkjhnklbpkdaibdccddilifddb?hl=en-US
uBlock Origin:
https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm?hl=en-US
(Be aware that there are scammy ad-blockers with very similar names. These are the trustworthy ones.)
//--------------------------------------------------------------
void ofApp::update(){
ofSetWindowTitle(ofToString(ofGetFrameRate()));
int x = ofGetMouseX();
int y = 400;
int z = ofGetMouseY();//400;
ray.set(ofPoint(0,0,0), ofPoint(x,y,z));
}
//--------------------------------------------------------------
void ofApp::update(){
ofSetWindowTitle(ofToString(ofGetFrameRate()));
int x = ofGetMouseX();
int y = 400;
int z = ofGetMouseY();//400;
ray.set(ofPoint(0,0,0), ofPoint(x,y,z));
}
#include "ofxThreadedImageLoader.h"
#include <sstream>
ofxThreadedImageLoader::ofxThreadedImageLoader(){
nextID = 0;
ofAddListener(ofEvents().update, this, &ofxThreadedImageLoader::update);
ofAddListener(ofURLResponseEvent(),this,&ofxThreadedImageLoader::urlResponse);
startThread();
lastUpdate = 0;
}
@stephanschulz
stephanschulz / ofApp.cpp
Created September 7, 2017 15:39
openframeworks openCV cvRemap
#include "ofApp.h"
float latency;
//https://forum.openframeworks.cc/t/copying-a-row-of-pixels-to-another-row-with-sub-pixel-accuracy/7610/3
//--------------------------------------------------------------
void ofApp::setup(){
cameraWidth = 640; //320; //640;
cameraHeight = 480; //405; //480;
cameraWidth2 = cameraWidth; // /2;
@stephanschulz
stephanschulz / ofApp.cpp
Last active August 15, 2017 19:42
ofxTextureRecorder - memory build up
#include "ofApp.h"
ofTexture frames[60];
int counter;
bool bDone;
//--------------------------------------------------------------
void ofApp::setup(){
fbo.allocate(ofGetWidth(), ofGetHeight(), GL_RGB);
ofxTextureRecorder::Settings settings(fbo.getTexture());
/*
Based on code by Memo from this thread:
http://forum.openframeworks.cc/index.php?topic=1687.0
*/
#include "ofMain.h"
typedef struct {
%YAML:1.0
cameraMatrix: !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [ 4.2709379348170005e+03, 0., 9.5950000000000000e+02, 0.,
4.2709379348170005e+03, 5.3950000000000000e+02, 0., 0., 1. ]
imageSize_width: 1920
imageSize_height: 1080
sensorSize_width: 0