From 7d1a43cb5eebb353bd280950cf6faadf3ea99b1a Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Fri, 2 Jun 2023 09:58:49 +0200 Subject: [PATCH] use references instead of pointer --- src/conversion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conversion.cpp b/src/conversion.cpp index 5d6f46f..797e93a 100644 --- a/src/conversion.cpp +++ b/src/conversion.cpp @@ -16,7 +16,7 @@ void ofxMsdfgen::toOfImage(const msdfgen::Bitmap bitmap, int h = bitmap.height(); for(int y = 0; y < h; y++){ for(int x = 0; x < w; x++){ - const float * rgb = bitmap(x, y); + const auto & rgb = bitmap(x, y); int index = 3 * (x + y * w); pixels.getData()[index] = (unsigned char)std::clamp(rgb[0] * 256.0, 0.0, 255.0); @@ -47,7 +47,7 @@ ofImage ofxMsdfgen::toOfImage(const msdfgen::Bitmap bitmap){ int h = bitmap.height(); for(int y = 0; y < h; y++){ for(int x = 0; x < w; x++){ - const float * rgb = bitmap(x, y); + const auto & rgb = bitmap(x, y); int index = 3 * (x + y * w); pixels.getData()[index] = (unsigned char)std::clamp(rgb[0] * 256.0, 0.0, 255.0);