flip after all TODO: fix?

This commit is contained in:
jrkb 2023-03-25 18:59:21 +01:00
parent a0af51fdb4
commit c3c58b422b

View file

@ -13,9 +13,10 @@ void ofxMsdfgen::toOfImage(const msdfgen::Bitmap <float, 3> 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);