This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iconv.h> | |
#include <string> | |
int convert(string input, wstring &output) | |
{ | |
char *inbuf, *iptr, *outbuf, *wptr; | |
iconv_t cd; | |
size_t nconv, inlen, avail; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "ofMain.h" | |
#include "ofxOsc.h" | |
#define OFX_RECOSC_SAVE_XML | |
#ifdef OFX_RECOSC_SAVE_XML | |
#include "ofxXmlSettings.h" | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "ofMain.h" | |
#include <tr1/array> | |
/* | |
// EXAMPLE | |
#include "testApp.h" | |
#include "ofxSimpleParticleSystem.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "testApp.h" | |
static CGLContextObj ctx; | |
static CGLPixelFormatObj pixStuff; | |
class MyThread : public ofThread | |
{ | |
public: | |
ofImage image; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline ofMatrix4x4 homography2glModelViewMatrix(const cv::Mat &homography) | |
{ | |
ofMatrix4x4 matrix; | |
matrix(0, 0) = homography.at<double>(0, 0); | |
matrix(0, 1) = homography.at<double>(1, 0); | |
matrix(0, 2) = 0; | |
matrix(0, 3) = homography.at<double>(2, 0); | |
matrix(1, 0) = homography.at<double>(0, 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void readDepthPixelsToImage(ofFloatImage &image) | |
{ | |
glPopAttrib(); | |
glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT ); | |
glPixelStorei(GL_PACK_ALIGNMENT, 1); | |
glReadPixels(0, 0, image.getWidth(), image.getHeight(), GL_DEPTH_COMPONENT, GL_FLOAT, image.getPixels()); | |
glPopClientAttrib(); | |
image.update(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env python | |
import sys, os | |
if len(sys.argv) is not 2: | |
print 'usage: ./cstringify.py [FILENAME]' | |
sys.exit(-1) | |
filename = sys.argv[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "testApp.h" | |
#include "ofxCv.h" | |
using namespace ofxCv; | |
using namespace cv; | |
#include <opencv2/flann/flann.hpp> | |
ofMesh mesh; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "ofMain.h" | |
bool loadObj(string path, ofMesh &mesh, ofImage *tex = NULL) | |
{ | |
path = ofToDataPath(path); | |
if (!ofFile::doesFileExist(path)) return false; | |
ifstream ifs(path.c_str()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <zlib.h> | |
bool zcompress(const string& input, string& output) | |
{ | |
z_stream z; | |
z.zalloc = Z_NULL; | |
z.zfree = Z_NULL; | |
z.opaque = Z_NULL; |