explicit std namespace

This commit is contained in:
themancalledjakob 2024-03-16 13:20:13 +01:00
parent efb704185f
commit e14da13d02
3 changed files with 12 additions and 12 deletions

View file

@ -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 <FontVariation> 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 <GlyphGeometry> glyphGeometries;
unordered_map <GlyphVariationKey, int> glyphGeometryMap;
std::unordered_map <GlyphVariationKey, int> glyphGeometryMap;
vector <FontVariationAxis> variationAxesAvailable;
vector <FontVariation> variationExtremes;
vector <FontVariation> variationSteps;

View file

@ -30,11 +30,11 @@ void ofxMsdfgen::toOfImage(const msdfgen::Bitmap <float, 3> bitmap,
image.update();
}
void ofxMsdfgen::toOfImage(const msdfgen::Bitmap <byte, 3> bitmap,
void ofxMsdfgen::toOfImage(const msdfgen::Bitmap <std::byte, 3> bitmap,
ofImage & image){
image.allocate(bitmap.width(), bitmap.height(), OF_IMAGE_COLOR);
image.getTexture().getTextureData().bFlipTexture = true;
memcpy(image.getPixels().getData(), static_cast <const byte *>(bitmap), bitmap.width() * bitmap.height() * 3 * sizeof(byte));
memcpy(image.getPixels().getData(), static_cast <const std::byte *>(bitmap), bitmap.width() * bitmap.height() * 3 * sizeof(std::byte));
image.update();
}

View file

@ -23,7 +23,7 @@ void toOfImage(const msdfgen::Bitmap <float, 3> bitmap,
ofFloatImage & image);
void toOfImage(const msdfgen::Bitmap <float, 3> bitmap,
ofImage & image);
void toOfImage(const msdfgen::Bitmap <byte, 3> bitmap,
void toOfImage(const msdfgen::Bitmap <std::byte, 3> bitmap,
ofImage & image);
ofImage toOfImage(const msdfgen::Bitmap <float, 3>);
}