From fee40e908f8e5afd9ee1b3bf37fe3dc31fbfc70e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=BC=9F?= Date: Wed, 21 Feb 2024 15:38:37 +0800 Subject: [PATCH] add matrix setpoly and bitmap add getimageinfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘伟 Change-Id: I571e5879df715cf3c0659dbca0cd8b92a9c6990c --- .../graphic_2d/native_drawing/drawing_bitmap.h | 11 +++++++++++ .../graphic_2d/native_drawing/drawing_matrix.h | 16 ++++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 8 ++++++++ 3 files changed, 35 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_bitmap.h b/graphic/graphic_2d/native_drawing/drawing_bitmap.h index 89f5fcdca..2540c24fb 100644 --- a/graphic/graphic_2d/native_drawing/drawing_bitmap.h +++ b/graphic/graphic_2d/native_drawing/drawing_bitmap.h @@ -139,6 +139,17 @@ uint32_t OH_Drawing_BitmapGetHeight(OH_Drawing_Bitmap*); */ void* OH_Drawing_BitmapGetPixels(OH_Drawing_Bitmap*); +/** + * @brief Gets the image info. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param OH_Drawing_Image_Info Indicates the pointer to an OH_Drawing_Image_Info object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_BitmapGetImageInfo(OH_Drawing_Bitmap*, OH_Drawing_Image_Info*); + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_matrix.h b/graphic/graphic_2d/native_drawing/drawing_matrix.h index 89548745b..1a1bc0255 100644 --- a/graphic/graphic_2d/native_drawing/drawing_matrix.h +++ b/graphic/graphic_2d/native_drawing/drawing_matrix.h @@ -199,6 +199,22 @@ void OH_Drawing_MatrixScale(OH_Drawing_Matrix*, float sx, float sy, float px, fl */ bool OH_Drawing_MatrixInvert(OH_Drawing_Matrix*, OH_Drawing_Matrix* inverse); +/** + * @brief Sets the params of matrix to map src to dst. + * Count must greater than or equal to zero, and less than or equal to four. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. + * @param src Points to map from. + * @param dst Points to map to. + * @param count Number of point in src and dst. + * @return Returns true if matrix is constructed successfully. + * @since 12 + * @version 1.0 + */ +bool OH_Drawing_MatrixSetPolyToPoly(OH_Drawing_Matrix*, const OH_Drawing_Point2D* src, + const OH_Drawing_Point2D* dst, uint32_t count); + /** * @brief Returns true if the first matrix equals the second matrix. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index e916a8a3f..481d25809 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -5,6 +5,10 @@ { "name": "OH_Drawing_BitmapCreateFromPixels" }, { "name": "OH_Drawing_BitmapGetWidth" }, { "name": "OH_Drawing_BitmapGetHeight" }, + { + "first_introduced": "12", + "name": "OH_Drawing_BitmapGetImageInfo" + }, { "name": "OH_Drawing_BitmapGetPixels" }, { "name": "OH_Drawing_BrushCreate" }, { "name": "OH_Drawing_BrushDestroy" }, @@ -90,6 +94,10 @@ { "name": "OH_Drawing_MatrixRotate" }, { "name": "OH_Drawing_MatrixTranslate" }, { "name": "OH_Drawing_MatrixScale" }, + { + "first_introduced": "12", + "name": "OH_Drawing_MatrixSetPolyToPoly" + }, { "name": "OH_Drawing_MatrixInvert" }, { "name": "OH_Drawing_MatrixIsEqual" }, { "name": "OH_Drawing_MatrixIsIdentity" }, -- Gitee