I’d like to process my drawing pitcture with blur effect.
For the reason, drawing figures in ofFbo and convert ofFbo memory to ofxCvColorImage.
But, drawing ofxCvColorImage cause curious figures.
#include "ofApp.h"
ofFbo buffer;
ofxTrueTypeFontUC font;
ofPixels pixels;
ofImage image;
ofxCvColorImage colorImage;
//--------------------------------------------------------------
void ofApp::setup(){
ofSetWindowShape(1280, 720);
ofSetFrameRate(30);
ofBackground(0, 0, 0);
font.loadFont("Meiryo.ttf", 48);
buffer.allocate(800, 800, GL_RGBA);
colorImage.allocate(800, 800);
buffer.begin();
{
ofBackground(0, 0, 0);
ofSetColor(255, 255, 255, 255);
ofCircle(50,50, 50);
font.drawString("hoge", 200, 200);
}
buffer.end();
buffer.readToPixels(pixels);
image.setFromPixels(pixels);
}
//--------------------------------------------------------------
void ofApp::update(){}
//--------------------------------------------------------------
void ofApp::draw(){
colorImage.setFromPixels(image.getPixelsRef());
colorImage.blurGaussian(5);
colorImage.draw(0, 0);
}