Skip to content

Instantly share code, notes, and snippets.

@arturoc
arturoc / pixels.cpp
Created August 17, 2015 17:47
ofPixels range based loops
for(auto line: pixels.getLines()){
for(auto pixel: line.getPixels()){
pixel[0] // -> red channel or gray in a grayscale image
auto lineAbovePixel = pixel - pixels.getWidth();
lineAbovePixel[0] // read channel in pixel one line above
}
}
@arturoc
arturoc / gui.cpp
Created May 15, 2017 17:06
custom save gui/timeline
listeners.push_back(gui.savePressedE.newListener([this]{
auto saveTo = ofSystemSaveDialog(ofGetTimestampString() + ".json", "save settings");
if(saveTo.bSuccess){
auto path = std::filesystem::path(saveTo.getPath());
auto folder = path.parent_path();
auto basename = path.stem().filename().string();
auto extension = ofToLower(path.extension().string());
auto timelineDir = (folder / (basename + "_timeline")).string();
if(extension == ".xml"){
ofXml xml;
{
"Inflation": {
"Inflation": {
"Circle": {
"circle_pct": "0",
"inner_radius": "0.99",
"outer_radius": "1"
},
"Colors": {
"color_1": "0.956863, 0.8, 0, 1",
@arturoc
arturoc / main.cpp
Created May 16, 2017 15:07
opengles2
int main(){
ofGLESWindowSettings settings;
settings.setGLESVersion(2);
ofCreateWindow(settings);
ofRunApp(new ofApp);
}
listeners.push_back(m_bExportFrames.newListener([this](bool & record){
if(record){
auto path = ofSystemLoadDialog("Record to images:", true);
if(path.bSuccess){
auto folderPath = path.getPath();
ofxTextureRecorder::Settings settings(fbo.getTexture());
settings.imageFormat = OF_IMAGE_FORMAT_JPEG;
settings.folderPath = folderPath;
recorder.setup(settings);
}else{
int main(){
ofGLFWWindowSettings settings;
settings.decorated = false;
ofCreateWindow(settings);
ofRunApp(new ofApp);
}
float m = 0;
float Q = 1.;
float a = 1.12;
vFragColor = asinh(a * Q * (color - m)) / Q;
#include "ofMain.h"
#include "ofApp.h"
//========================================================================
int main(){
ofGLFWWindowSettings settings;
settings.setGLVersion(3,3);
ofCreateWindow(settings);
ofRunApp(new ofApp);
}
matrix:
#VisualStudio 2017 64 bit Building
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
platform: x64
TARGET: vs
VS_VER: 15
VS_NAME: 2017
ARCH: 64
#VisualStudio 2017 32 bit Building
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- RLine(vector< char >::reverse_iterator _begin, vector< char >::reverse_iterator _end) to ofBuffer::RLine
- const string & operator*() to ofBuffer::RLine
- const string * operator->() to ofBuffer::RLine
- const string & asString() to ofBuffer::RLine
- ofBuffer::RLine & operator++() to ofBuffer::RLine
- ofBuffer::RLine operator++(int ) to ofBuffer::RLine
- bool operator!=(const ofBuffer::RLine &rhs) to ofBuffer::RLine
- bool operator==(const ofBuffer::RLine &rhs) to ofBuffer::RLine
- bool empty() to ofBuffer::RLine
- ofBuffer::RLine rbegin() to ofBuffer::Lines