61 float mat10,
float mat11,
float mat12)
noexcept;
74 template <
typename ValueType>
78 x =
static_cast<ValueType
> (mat00 * oldX + mat01 * y + mat02);
79 y =
static_cast<ValueType
> (mat10 * oldX + mat11 * y + mat12);
87 template <
typename ValueType>
89 ValueType& x2, ValueType& y2)
const noexcept
91 auto oldX1 = x1, oldX2 = x2;
92 x1 =
static_cast<ValueType
> (mat00 * oldX1 + mat01 *
y1 + mat02);
93 y1 =
static_cast<ValueType
> (mat10 * oldX1 + mat11 *
y1 + mat12);
94 x2 =
static_cast<ValueType
> (mat00 * oldX2 + mat01 * y2 + mat02);
95 y2 =
static_cast<ValueType
> (mat10 * oldX2 + mat11 * y2 + mat12);
103 template <
typename ValueType>
105 ValueType& x2, ValueType& y2,
106 ValueType& x3, ValueType& y3)
const noexcept
108 auto oldX1 = x1, oldX2 = x2, oldX3 = x3;
109 x1 =
static_cast<ValueType
> (mat00 * oldX1 + mat01 *
y1 + mat02);
110 y1 =
static_cast<ValueType
> (mat10 * oldX1 + mat11 *
y1 + mat12);
111 x2 =
static_cast<ValueType
> (mat00 * oldX2 + mat01 * y2 + mat02);
112 y2 =
static_cast<ValueType
> (mat10 * oldX2 + mat11 * y2 + mat12);
113 x3 =
static_cast<ValueType
> (mat00 * oldX3 + mat01 * y3 + mat02);
114 y3 =
static_cast<ValueType
> (mat10 * oldX3 + mat11 * y3 + mat12);
120 float deltaY)
const noexcept;
123 template <
typename Po
intType>
126 return translated ((
float) delta.x, (
float) delta.y);
131 float deltaY)
noexcept;
134 template <
typename Po
intType>
137 return translation ((
float) delta.x, (
float) delta.y);
142 float translationY)
const noexcept;
158 float pivotY)
const noexcept;
166 float pivotY)
noexcept;
172 float factorY)
const noexcept;
183 float pivotX,
float pivotY)
const noexcept;
187 float factorY)
noexcept;
194 float pivotX,
float pivotY)
noexcept;
223 float x10,
float y10,
224 float x01,
float y01) noexcept;
227 static
AffineTransform fromTargetPoints (
float sourceX1,
float sourceY1,
float targetX1,
float targetY1,
228 float sourceX2,
float sourceY2,
float targetX2,
float targetY2,
229 float sourceX3,
float sourceY3,
float targetX3,
float targetY3) noexcept;
232 template <typename PointType>
234 PointType source2, PointType target2,
235 PointType source3, PointType target3) noexcept
237 return fromTargetPoints (source1.x, source1.y, target1.x, target1.y,
238 source2.x, source2.y, target2.x, target2.y,
239 source3.x, source3.y, target3.x, target3.y);
247 bool isIdentity() const noexcept;
250 bool isSingularity() const noexcept;
254 bool isOnlyTranslation() const noexcept;
259 float getTranslationX() const noexcept {
return mat02; }
267 float getDeterminant() const noexcept;
284 [[deprecated (
"This method produces incorrect values for transforms containing rotations. "
285 "See the method docs for a code example on how to calculate the correct scale factor.")]]
286 float getScaleFactor() const noexcept;
288 [[deprecated ("If you need an identity transform, just use
AffineTransform() or {}.
")]]
289 static const AffineTransform identity;
292 //==============================================================================
293 /* The transform matrix is:
299 float mat00 { 1.0f }, mat01 { 0.0f }, mat02 { 0.0f };
300 float mat10 { 0.0f }, mat11 { 1.0f }, mat12 { 0.0f };
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...