/** * Given an encoded origin and the width and height of the source data, returns a matrix * that transforms the source rectangle with upper left corner at [0, 0] and origin to a correctly * oriented destination rectangle of [0, 0, w, h].
*/ staticinline SkMatrix SkEncodedOriginToMatrix(SkEncodedOrigin origin, int w, int h) { switch (origin) { case kTopLeft_SkEncodedOrigin: return SkMatrix::I(); case kTopRight_SkEncodedOrigin: return SkMatrix::MakeAll(-1, 0, w, 0, 1, 0, 0, 0, 1); case kBottomRight_SkEncodedOrigin: return SkMatrix::MakeAll(-1, 0, w, 0, -1, h, 0, 0, 1); case kBottomLeft_SkEncodedOrigin: return SkMatrix::MakeAll( 1, 0, 0, 0, -1, h, 0, 0, 1); case kLeftTop_SkEncodedOrigin: return SkMatrix::MakeAll( 0, 1, 0, 1, 0, 0, 0, 0, 1); case kRightTop_SkEncodedOrigin: return SkMatrix::MakeAll( 0, -1, w, 1, 0, 0, 0, 0, 1); case kRightBottom_SkEncodedOrigin: return SkMatrix::MakeAll( 0, -1, w, -1, 0, h, 0, 0, 1); case kLeftBottom_SkEncodedOrigin: return SkMatrix::MakeAll( 0, 1, 0, -1, 0, h, 0, 0, 1);
}
SK_ABORT("Unexpected origin");
}
/** * Return true if the encoded origin includes a 90 degree rotation, in which case the width * and height of the source data are swapped relative to a correctly oriented destination.
*/ staticinlinebool SkEncodedOriginSwapsWidthHeight(SkEncodedOrigin origin) { return origin >= kLeftTop_SkEncodedOrigin;
}
#endif// SkEncodedOrigin_DEFINED
Messung V0.5
¤ Dauer der Verarbeitung: 0.36 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.