Example #1
0
void ParticleTrace :: saveFBO ( ofxFBOTexture& fbo )
{
    int y = ofGetYear();
    int m = ofGetMonth();
    int d = ofGetDay();
    int r = ofGetHours();
    int n = ofGetMinutes();
    int s = ofGetSeconds();
    
    char str[255];
    sprintf( str, "screengrab_lrg/image_%02d%02d%02d_%02d%02d%02d.png", y % 1000, m, d, r, n, s );
    
    int w = fbo.getWidth();
    int h = fbo.getHeight();
    
	ofxCvColorImage imgTemp;
	imgTemp.allocate( w, h );
	imgTemp.setFromPixels( (unsigned char*)fbo.getPixels(), w, h );
	imgTemp.mirror( true, false );

	ofImage imgSave;
    imgSave.allocate( w, h, OF_IMAGE_COLOR );
    imgSave.setFromPixels( imgTemp.getPixels(), w, h, OF_IMAGE_COLOR );
    imgSave.saveImage( str );
    
	imgTemp.clear();
    imgSave.clear();
}
void FboMaskManager::setup(ofxFBOTexture& worldFbo, string filepath){
	this->worldFbo = &worldFbo;
	this->loadPath = filepath;
	maskFbo.allocate(worldFbo.getWidth(), worldFbo.getHeight(), false);
	fbo2.allocate(worldFbo.getWidth(), worldFbo.getHeight(), false);
	maskImage.allocate(worldFbo.getWidth(), worldFbo.getHeight(), OF_IMAGE_COLOR_ALPHA);
	
	shaderH.loadShader("shaders/simpleBlurHorizontal");
	shaderV.loadShader("shaders/simpleBlurVertical");
	
	noPasses = 1;
	blurDistance = 2.0;
}