int main()
{
- VInterpolator ip({0.667, 1}, {0.333 , 0});
- for (float i = 0.0 ; i < 1.0 ; i+=0.05) {
- std::cout<<ip.value(i)<<"\t";
- }
- std::cout<<std::endl;
return 0;
}
#include <vglobal.h>
#include <cassert>
#include <cmath>
-#include <cstring>
V_BEGIN_NAMESPACE
}
return {x, y};
}
-static std::string type_helper(VMatrix::MatrixType t)
-{
- switch (t) {
- case VMatrix::MatrixType::None:
- return "MatrixType::None";
- break;
- case VMatrix::MatrixType::Translate:
- return "MatrixType::Translate";
- break;
- case VMatrix::MatrixType::Scale:
- return "MatrixType::Scale";
- break;
- case VMatrix::MatrixType::Rotate:
- return "MatrixType::Rotate";
- break;
- case VMatrix::MatrixType::Shear:
- return "MatrixType::Shear";
- break;
- case VMatrix::MatrixType::Project:
- return "MatrixType::Project";
- break;
- }
- return "";
-}
-std::ostream &operator<<(std::ostream &os, const VMatrix &o)
-{
- os << "[Matrix: "
- << "type =" << type_helper(o.type()) << ", Data : " << o.m11 << " "
- << o.m12 << " " << o.m13 << " " << o.m21 << " " << o.m22 << " " << o.m23
- << " " << o.mtx << " " << o.mty << " " << o.m33 << " "
- << "]" << std::endl;
- return os;
-}
V_END_NAMESPACE
bool operator==(const VMatrix &) const;
bool operator!=(const VMatrix &) const;
bool fuzzyCompare(const VMatrix &) const;
- friend std::ostream &operator<<(std::ostream &os, const VMatrix &o);
-
private:
friend struct VSpanData;
float m11{1}, m12{0}, m13{0};