Discuss in detail the differences between set, pre and post of matrix in Android

Before talking about the difference between set, pre and post, let's talk about matrix.

Matrix contains a 3 x 3 matrix, which is specially used for image transformation and matching.

Matrix provides four operations:

• translate

• rotate

• scale

• skew

In other words, these four operations are to set the value of the 3 x 3 matrix to achieve the effect of transformation.

Matrix has no structure. It must be initialized through reset or set methods.

OK, after introducing the matrix, let's take a look at the differences between set, pre and post.

Pre is inserted at the front of the queue, post is added at the back of the queue, and set empties the queue before adding (this is also the reason why "the matrix has no structure, it must be initialized through reset or set methods" mentioned above).

Here are some examples:

Execution order: translate (5,0) - > scale (2f, 1F) - > scale (0.2f, 1F) - > translate (0.5f, 0f)

Execution order: translate (0.5f, 0f) - > scale (1F, 1F) - > scale (5F, 1)

The difference between set, pre and post of matrix in Android is all the content shared by Xiaobian. I hope it can give you a reference and support more programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>