initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
This commit is contained in:
36
thirdparty/msdfgen/core/DistanceMapping.h
vendored
Normal file
36
thirdparty/msdfgen/core/DistanceMapping.h
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Range.hpp"
|
||||
|
||||
namespace msdfgen {
|
||||
|
||||
/// Linear transformation of signed distance values.
|
||||
class DistanceMapping {
|
||||
|
||||
public:
|
||||
/// Explicitly designates value as distance delta rather than an absolute distance.
|
||||
class Delta {
|
||||
public:
|
||||
double value;
|
||||
inline explicit Delta(double distanceDelta) : value(distanceDelta) { }
|
||||
inline operator double() const { return value; }
|
||||
};
|
||||
|
||||
static DistanceMapping inverse(Range range);
|
||||
|
||||
DistanceMapping();
|
||||
DistanceMapping(Range range);
|
||||
double operator()(double d) const;
|
||||
double operator()(Delta d) const;
|
||||
DistanceMapping inverse() const;
|
||||
|
||||
private:
|
||||
double scale;
|
||||
double translate;
|
||||
|
||||
inline DistanceMapping(double scale, double translate) : scale(scale), translate(translate) { }
|
||||
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user