1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef C_INCLUDE_DRAWING_MATRIX_H 17 #define C_INCLUDE_DRAWING_MATRIX_H 18 19 /** 20 * @addtogroup Drawing 21 * @{ 22 * 23 * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. 24 * 25 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 26 * 27 * @since 11 28 * @version 1.0 29 */ 30 31 /** 32 * @file drawing_matrix.h 33 * 34 * @brief Declares functions related to the <b>matrix</b> object in the drawing module. 35 * 36 * @since 11 37 * @version 1.0 38 */ 39 40 #include "drawing_types.h" 41 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 46 /** 47 * @brief Creates an <b>OH_Drawing_Matrix</b> object. 48 * 49 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 50 * @return Returns the pointer to the <b>OH_Drawing_Matrix</b> object created. 51 * @since 11 52 * @version 1.0 53 */ 54 OH_Drawing_Matrix* OH_Drawing_MatrixCreate(void); 55 56 /** 57 * @brief Sets the params for a matrix. 58 * 59 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 60 * @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object. 61 * @param scaleX horizontal scale factor to store 62 * @param skewX horizontal skew factor to store 63 * @param transX horizontal translation to store 64 * @param skewY vertical skew factor to store 65 * @param scaleY vertical scale factor to store 66 * @param transY vertical translation to store 67 * @param persp0 input x-axis values perspective factor to store 68 * @param persp1 input y-axis values perspective factor to store 69 * @param persp2 perspective scale factor to store 70 * @since 11 71 * @version 1.0 72 */ 73 void OH_Drawing_MatrixSetMatrix(OH_Drawing_Matrix*, float scaleX, float skewX, float transX, 74 float skewY, float scaleY, float transY, float persp0, float persp1, float persp2); 75 76 /** 77 * @brief Destroys an <b>OH_Drawing_Matrix</b> object and reclaims the memory occupied by the object. 78 * 79 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 80 * @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object. 81 * @since 11 82 * @version 1.0 83 */ 84 void OH_Drawing_MatrixDestroy(OH_Drawing_Matrix*); 85 86 #ifdef __cplusplus 87 } 88 #endif 89 /** @} */ 90 #endif 91