| 1 |
|
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "Vector2.hpp" |
| 5 |
|
| 6 |
namespace msdfgen { |
| 7 |
|
| 8 |
|
| 9 |
class Projection { |
| 10 |
|
| 11 |
public: |
| 12 |
Projection(); |
| 13 |
Projection(const Vector2 &scale, const Vector2 &translate); |
| 14 |
|
| 15 |
Point2 project(const Point2 &coord) const; |
| 16 |
|
| 17 |
Point2 unproject(const Point2 &coord) const; |
| 18 |
|
| 19 |
Vector2 projectVector(const Vector2 &vector) const; |
| 20 |
|
| 21 |
Vector2 unprojectVector(const Vector2 &vector) const; |
| 22 |
|
| 23 |
double projectX(double x) const; |
| 24 |
|
| 25 |
double projectY(double y) const; |
| 26 |
|
| 27 |
double unprojectX(double x) const; |
| 28 |
|
| 29 |
double unprojectY(double y) const; |
| 30 |
|
| 31 |
private: |
| 32 |
Vector2 scale; |
| 33 |
Vector2 translate; |
| 34 |
|
| 35 |
}; |
| 36 |
|
| 37 |
} |