Skip to main content

OH_Drawing_MatrixPostRotate

Function OH_Drawing_MatrixPostRotate 

Source
pub unsafe extern "C" fn OH_Drawing_MatrixPostRotate(
    matrix: *mut OH_Drawing_Matrix,
    degree: f32,
    px: f32,
    py: f32,
)
Expand description

@brief Sets matrix to matrix constructed from rotating by degrees about pivot point(px, py), multiplied by matrix, positive degrees rotates clockwise. Given:

                | J K L |                        | c -s dx |
       Matrix = | M N O |,  R(degrees, px, py) = | s  c dy |
                | P Q R |                        | 0  0  1 |

   where:

       c  = cos(degrees)
       s  = sin(degrees)
       dx =  s * py + (1 - c) * px
       dy = -s * px + (1 - c) * py

   sets Matrix to:

                                     |c -s dx| |J K L|   |cJ-sM+dx*P cK-sN+dx*Q cL-sO+dx+R|
       R(degrees, px, py) * Matrix = |s  c dy| |M N O| = |sJ+cM+dy*P sK+cN+dy*Q sL+cO+dy*R|
                                     |0  0  1| |P Q R|   |         P          Q          R|

@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @param matrix Indicates the pointer to an OH_Drawing_Matrix object. @param degree Indicates the angle of axes relative to upright axes. @param px Indicates the pivot on x-axis. @param py Indicates the pivot on y-axis. @since 12 @version 1.0