本文整理汇总了C++中SkMatrix::get9方法的典型用法代码示例。如果您正苦于以下问题:C++ SkMatrix::get9方法的具体用法?C++ SkMatrix::get9怎么用?C++ SkMatrix::get9使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkMatrix
的用法示例。
在下文中一共展示了SkMatrix::get9方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
template <typename T> void write_sparse_matrix(T* writer, const SkMatrix& matrix) {
SkMatrix::TypeMask tm = matrix.getType();
SkScalar tmp[9];
if (tm & SkMatrix::kPerspective_Mask) {
matrix.get9(tmp);
writer->write(tmp, 9 * sizeof(SkScalar));
} else if (tm & SkMatrix::kAffine_Mask) {
tmp[0] = matrix[SkMatrix::kMScaleX];
tmp[1] = matrix[SkMatrix::kMSkewX];
tmp[2] = matrix[SkMatrix::kMTransX];
tmp[3] = matrix[SkMatrix::kMScaleY];
tmp[4] = matrix[SkMatrix::kMSkewY];
tmp[5] = matrix[SkMatrix::kMTransY];
writer->write(tmp, 6 * sizeof(SkScalar));
} else if (tm & SkMatrix::kScale_Mask) {
tmp[0] = matrix[SkMatrix::kMScaleX];
tmp[1] = matrix[SkMatrix::kMTransX];
tmp[2] = matrix[SkMatrix::kMScaleY];
tmp[3] = matrix[SkMatrix::kMTransY];
writer->write(tmp, 4 * sizeof(SkScalar));
} else if (tm & SkMatrix::kTranslate_Mask) {
tmp[0] = matrix[SkMatrix::kMTransX];
tmp[1] = matrix[SkMatrix::kMTransY];
writer->write(tmp, 2 * sizeof(SkScalar));
}
// else write nothing for Identity
}
示例2:
static void assert9(skiatest::Reporter* reporter, const SkMatrix& m,
SkScalar a, SkScalar b, SkScalar c,
SkScalar d, SkScalar e, SkScalar f,
SkScalar g, SkScalar h, SkScalar i) {
SkScalar buffer[9];
m.get9(buffer);
REPORTER_ASSERT(reporter, buffer[0] == a);
REPORTER_ASSERT(reporter, buffer[1] == b);
REPORTER_ASSERT(reporter, buffer[2] == c);
REPORTER_ASSERT(reporter, buffer[3] == d);
REPORTER_ASSERT(reporter, buffer[4] == e);
REPORTER_ASSERT(reporter, buffer[5] == f);
REPORTER_ASSERT(reporter, buffer[6] == g);
REPORTER_ASSERT(reporter, buffer[7] == h);
REPORTER_ASSERT(reporter, buffer[8] == i);
}