Home | History | Annotate | Download | only in graphics

Lines Matching refs:Matrix

24  * A matrix implementation overridden by the LayoutLib bridge.
26 public class Matrix extends _Original_Matrix {
31 * Create an identity matrix
33 public Matrix() {
38 * Create a matrix that is a (deep) copy of src
39 * @param src The matrix to copy into this matrix
41 public Matrix(Matrix src) {
46 * Creates a Matrix object from the float array. The array becomes the internal storage
50 private Matrix(float[] data) {
58 * Adds the given transformation to the current Matrix
59 * <p/>This in effect does this = this*matrix
60 * @param matrix
62 private void addTransform(float[] matrix) {
66 tmp[0] = matrix[0] * mValues[0] + matrix[1] * mValues[3] + matrix[2] * mValues[6];
67 tmp[1] = matrix[0] * mValues[1] + matrix[1] * mValues[4] + matrix[2] * mValues[7];
68 tmp[2] = matrix[0] * mValues[2] + matrix[1] * mValues[5] + matrix[2] * mValues[8];
71 tmp[3] = matrix[3] * mValues[0] + matrix[4] * mValues[3] + matrix[5] * mValues[6];
72 tmp[4] = matrix[3] * mValues[1] + matrix[4] * mValues[4] + matrix[5] * mValues[7];
73 tmp[5] = matrix[3] * mValues[2] + matrix[4] * mValues[5] + matrix[5] * mValues[8];
76 tmp[6] = matrix[6] * mValues[0] + matrix[7] * mValues[3] + matrix[8] * mValues[6];
77 tmp[7] = matrix[6] * mValues[1] + matrix[7] * mValues[4] + matrix[8] * mValues[7];
78 tmp[8] = matrix[6] * mValues[2] + matrix[7] * mValues[5] + matrix[8] * mValues[8];
86 // for a matrix [ 0 1 2 ]
100 * Returns true if the matrix is identity.
118 * true if the matrix is identity, scale-only, or rotates a multiple of 90
127 * (deep) copy the src matrix into this matrix. If src is null, reset this
128 * matrix to the identity matrix.
130 public void set(Matrix src) {
143 /** Returns true if obj is a Matrix and its values equal our values.
147 if (obj != null && obj instanceof Matrix) {
148 Matrix matrix = (Matrix)obj;
150 if (mValues[i] != matrix.mValues[i]) {
161 /** Set the matrix to identity */
171 /** Set the matrix to translate by (dx, dy). */
186 * Set the matrix to scale by sx and sy, with a pivot point at (px, py).
211 /** Set the matrix to scale by sx and sy. */
226 * Set the matrix to rotate by the specified number of degrees, with a pivot
255 * Set the matrix to rotate about (0,0) by the specified number of degrees.
275 * Set the matrix to rotate by the specified sine and cosine values, with a
300 /** Set the matrix to rotate by the specified sine and cosine values. */
315 * Set the matrix to skew by sx and sy, with a pivot point at (px, py).
340 /** Set the matrix to skew by sx and sy. */
355 * Set the matrix to the concatenation of the two specified matrices,
357 * matrices may also be the target matrix. this = a * b
359 public boolean setConcat(Matrix a, Matrix b) {
365 Matrix tmp = new Matrix(b);
379 * Preconcats the matrix with the specified translation.
384 // create a matrix that will be multiply by this
385 Matrix m = new Matrix(new float[] { 1, 0, dx, 0, 1, dy, 0, 0, 1 });
393 * Preconcats the matrix with the specified scale.
398 Matrix m = new Matrix();
407 * Preconcats the matrix with the specified scale.
412 Matrix m = new Matrix();
421 * Preconcats the matrix with the specified rotation.
426 Matrix m = new Matrix();
435 * Preconcats the matrix with the specified rotation.
440 Matrix m = new Matrix();
449 * Preconcats the matrix with the specified skew.
454 Matrix m = new Matrix();
463 * Preconcats the matrix with the specified skew.
468 Matrix m = new Matrix();
477 * Preconcats the matrix with the specified matrix.
480 public boolean preConcat(Matrix other) {
481 Matrix m = new Matrix(other);
494 * Postconcats the matrix with the specified translation.
504 * Postconcats the matrix with the specified scale.
521 * Postconcats the matrix with the specified scale.
531 * Postconcats the matrix with the specified rotation.
551 * Postconcats the matrix with the specified rotation.
565 * Postconcats the matrix with the specified skew.
582 * Postconcats the matrix with the specified skew.
593 * Postconcats the matrix with the specified matrix.
596 public boolean postConcat(Matrix other) {
645 * Set the matrix to the scale and translate values that map the source
652 * @return true if the matrix can be represented by the rectangle mapping.
722 * Set the matrix such that the specified src points would map to the
731 * @return true if the matrix was set to the specified transformation
745 * If this matrix can be inverted, return true and if inverse is not null,
746 * set inverse to be the inverse of this matrix. If this matrix cannot be
749 public boolean invert(Matrix inverse) {
776 * Apply this matrix to the array of 2D points specified by src, and write
806 * Apply this matrix to the array of 2D vectors specified by src, and write
824 * Apply this matrix to the array of 2D points specified by src, and write
840 * Apply this matrix to the array of 2D vectors specified by src, and write
856 * Apply this matrix to the array of 2D points, and write the transformed
867 * Apply this matrix to the array of 2D vectors, and write the transformed
877 * Apply this matrix to the src rectangle, and write the transformed
913 * Apply this matrix to the rectangle, and write the transformed rectangle
927 * this matrix. NOTE: in perspective this value assumes the circle
935 /** Copy 9 values from the matrix into the array.
945 /** Copy 9 values from the array into the matrix.
946 Depending on the implementation of Matrix, these may be
947 transformed into 16.16 integers in the Matrix, such that
961 private final static int kTranslate_Mask = 0x01; //!< set if the matrix has translation
962 private final static int kScale_Mask = 0x02; //!< set if the matrix has X or Y scale
963 private final static int kAffine_Mask = 0x04; //!< set if the matrix skews or rotates
964 private final static int kPerspective_Mask = 0x08; //!< set if the matrix is in perspective