From c3c58b422b0052fd0a327a61fa98ccd43ad1a4c7 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Sat, 25 Mar 2023 18:59:21 +0100 Subject: [PATCH] flip after all TODO: fix? --- src/conversion.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/conversion.cpp b/src/conversion.cpp index 806eda1..377e7e3 100644 --- a/src/conversion.cpp +++ b/src/conversion.cpp @@ -13,9 +13,10 @@ void ofxMsdfgen::toOfImage(const msdfgen::Bitmap bitmap, ofPixels & pixels = image.getPixels(); int w = bitmap.width(); int h = bitmap.height(); - for(int y = 0; y < h; ++y){ - for(int x = 0; x < w; ++x){ - const float * rgb = bitmap(x, y); + // TODO: why do we need to flip? + for(int y = 1; y <= h; y++){ + for(int x = 0; x < w; x++){ + const float * rgb = bitmap(x, h - y); int index = 3 * (x + y * w); pixels.getData()[index] = (unsigned char)std::clamp(rgb[0] * 256.0, 0.0, 255.0);