From e14da13d02c4dff04fb69d7923469f606924e6c3 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Sat, 16 Mar 2024 13:20:13 +0100 Subject: [PATCH] explicit std namespace --- src/Atlas.h | 18 +++++++++--------- src/conversion.cpp | 4 ++-- src/conversion.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Atlas.h b/src/Atlas.h index 5f27a87..81b85bb 100644 --- a/src/Atlas.h +++ b/src/Atlas.h @@ -27,7 +27,7 @@ struct AtlasSettings { float pixelRange = 2.0; float miterLimit = 1.0; float maxInterpolationStepSize = 42.0; - string characters = "charset::ascii"; + std::string characters = "charset::ascii"; #ifdef TARGET_EMSCRIPTEN int threadCount = 1; #else @@ -35,7 +35,7 @@ struct AtlasSettings { #endif }; struct FontVariation { - string name; + std::string name; float value; bool operator==(const FontVariation & other) const { return (name == other.name @@ -43,7 +43,7 @@ struct FontVariation { } }; struct FontVariationAxis { - string name; + std::string name; float minValue; float maxValue; float defaultValue; @@ -84,8 +84,8 @@ class Atlas { public: Atlas(); ~Atlas(); - void setup(string _fontPath); - void setup(string _fontPath, AtlasSettings _settings); + void setup(std::string _fontPath); + void setup(std::string _fontPath, AtlasSettings _settings); void addVariations(vector variations); bool generate(bool useCache = true, bool saveToCache = false); @@ -106,13 +106,13 @@ class Atlas { AtlasSettings settings; msdfgen::FontHandle * font; msdfgen::FreetypeHandle * ft; - string getAtlasPathDir(); - string getAtlasPath(); + std::string getAtlasPathDir(); + std::string getAtlasPath(); private: - string fontPath; + std::string fontPath; ofImage atlasImage; vector glyphGeometries; - unordered_map glyphGeometryMap; + std::unordered_map glyphGeometryMap; vector variationAxesAvailable; vector variationExtremes; vector variationSteps; diff --git a/src/conversion.cpp b/src/conversion.cpp index 797e93a..5102ba2 100644 --- a/src/conversion.cpp +++ b/src/conversion.cpp @@ -30,11 +30,11 @@ void ofxMsdfgen::toOfImage(const msdfgen::Bitmap bitmap, image.update(); } -void ofxMsdfgen::toOfImage(const msdfgen::Bitmap bitmap, +void ofxMsdfgen::toOfImage(const msdfgen::Bitmap bitmap, ofImage & image){ image.allocate(bitmap.width(), bitmap.height(), OF_IMAGE_COLOR); image.getTexture().getTextureData().bFlipTexture = true; - memcpy(image.getPixels().getData(), static_cast (bitmap), bitmap.width() * bitmap.height() * 3 * sizeof(byte)); + memcpy(image.getPixels().getData(), static_cast (bitmap), bitmap.width() * bitmap.height() * 3 * sizeof(std::byte)); image.update(); } diff --git a/src/conversion.h b/src/conversion.h index 5a7cd39..7dc6571 100644 --- a/src/conversion.h +++ b/src/conversion.h @@ -23,7 +23,7 @@ void toOfImage(const msdfgen::Bitmap bitmap, ofFloatImage & image); void toOfImage(const msdfgen::Bitmap bitmap, ofImage & image); -void toOfImage(const msdfgen::Bitmap bitmap, +void toOfImage(const msdfgen::Bitmap bitmap, ofImage & image); ofImage toOfImage(const msdfgen::Bitmap ); }