diff --git a/graphic/graphic_2d/native_drawing/BUILD.gn b/graphic/graphic_2d/native_drawing/BUILD.gn index 60e24af8d5234c31a2686e65ddefe17bc0c129ed..44f9f3218dcef5fc46550c6f659ff930ec0a5591 100644 --- a/graphic/graphic_2d/native_drawing/BUILD.gn +++ b/graphic/graphic_2d/native_drawing/BUILD.gn @@ -25,18 +25,14 @@ ohos_ndk_headers("native_drawing_header") { "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_filter.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_font.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_font_collection.h", - "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_image.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_mask_filter.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_matrix.h", - "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_memory_stream.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_path.h", - "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_path_effect.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_pen.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_point.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_rect.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_register_font.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_round_rect.h", - "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_sampling_options.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_shader_effect.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_blob.h", "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_declaration.h", @@ -62,16 +58,12 @@ ohos_ndk_library("libnative_drawing_ndk") { "native_drawing/drawing_font_collection.h", "native_drawing/drawing_mask_filter.h", "native_drawing/drawing_matrix.h", - "native_drawing/drawing_memory_stream.h", "native_drawing/drawing_path.h", - "native_drawing/drawing_path_effect.h", "native_drawing/drawing_pen.h", "native_drawing/drawing_point.h", "native_drawing/drawing_rect.h", "native_drawing/drawing_register_font.h", "native_drawing/drawing_round_rect.h", - "native_drawing/drawing_image.h", - "native_drawing/drawing_sampling_options.h", "native_drawing/drawing_shader_effect.h", "native_drawing/drawing_text_blob.h", "native_drawing/drawing_text_declaration.h", diff --git a/graphic/graphic_2d/native_drawing/drawing_brush.h b/graphic/graphic_2d/native_drawing/drawing_brush.h index dca333f2de58b6036da66f0ff346a9ebaf34202f..215a3ee3966e91b31b21204c161577cf408682de 100644 --- a/graphic/graphic_2d/native_drawing/drawing_brush.h +++ b/graphic/graphic_2d/native_drawing/drawing_brush.h @@ -21,7 +21,7 @@ * @{ * * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. - * + * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * * @since 8 @@ -81,7 +81,7 @@ bool OH_Drawing_BrushIsAntiAlias(const OH_Drawing_Brush*); * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. - * @param bool Specifies whether to enable anti-aliasing. The value true means + * @param bool Specifies whether to enable anti-aliasing. The value true means * to enable anti-aliasing, and false means the opposite. * @since 8 * @version 1.0 @@ -154,17 +154,6 @@ void OH_Drawing_BrushSetShaderEffect(OH_Drawing_Brush*, OH_Drawing_ShaderEffect* */ void OH_Drawing_BrushSetFilter(OH_Drawing_Brush*, OH_Drawing_Filter*); -/** - * @brief Sets a blender that implements the specified blendmode enum for a brush. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Brush object. - * @param OH_Drawing_BlendMode Indicates the blend mode. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_BrushSetBlendMode(OH_Drawing_Brush*, OH_Drawing_BlendMode); - #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_canvas.h b/graphic/graphic_2d/native_drawing/drawing_canvas.h index 8d882ecc4a4b6f1fcb6ebf0cb4e21214109c36bb..cc37815899750dae0d247397f59ebc3db6e23256 100644 --- a/graphic/graphic_2d/native_drawing/drawing_canvas.h +++ b/graphic/graphic_2d/native_drawing/drawing_canvas.h @@ -21,7 +21,7 @@ * @{ * * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. - * + * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * * @since 8 @@ -64,7 +64,7 @@ OH_Drawing_Canvas* OH_Drawing_CanvasCreate(void); void OH_Drawing_CanvasDestroy(OH_Drawing_Canvas*); /** - * @brief Binds a bitmap to a canvas so that the content drawn on the canvas + * @brief Binds a bitmap to a canvas so that the content drawn on the canvas * is output to the bitmap (this process is called CPU rendering). * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @@ -87,7 +87,7 @@ void OH_Drawing_CanvasBind(OH_Drawing_Canvas*, OH_Drawing_Bitmap*); void OH_Drawing_CanvasAttachPen(OH_Drawing_Canvas*, const OH_Drawing_Pen*); /** - * @brief Detaches the pen from a canvas so that the canvas will not use the style + * @brief Detaches the pen from a canvas so that the canvas will not use the style * and color of the pen to outline a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @@ -129,19 +129,6 @@ void OH_Drawing_CanvasDetachBrush(OH_Drawing_Canvas*); */ void OH_Drawing_CanvasSave(OH_Drawing_Canvas*); -/** - * @brief Saves matrix and clip, and allocates a bitmap for subsequent drawing. - * Calling restore discards changes to matrix and clip, and draws the bitmap. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasSaveLayer(OH_Drawing_Canvas*, const OH_Drawing_Rect*, const OH_Drawing_Brush*); - /** * @brief Restores the canvas status (canvas matrix) saved on the top of the stack. * @@ -285,7 +272,7 @@ void OH_Drawing_CanvasDrawTextBlob(OH_Drawing_Canvas*, const OH_Drawing_TextBlob /** * @brief Enumerates clip op. - * + * * @since 11 * @version 1.0 */ @@ -365,107 +352,6 @@ void OH_Drawing_CanvasTranslate(OH_Drawing_Canvas*, float dx, float dy); */ void OH_Drawing_CanvasScale(OH_Drawing_Canvas*, float sx, float sy); -/** - * @brief Get the width of a canvas. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @since 12 - * @version 1.0 - */ -int32_t OH_Drawing_CanvasGetWidth(OH_Drawing_Canvas*); - -/** - * @brief Get the height of a canvas. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @since 12 - * @version 1.0 - */ -int32_t OH_Drawing_CanvasGetHeight(OH_Drawing_Canvas*); - -/** - * @brief Get the bounds of clip of a canvas. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @return The pointer to an OH_Drawing_Rect object, represents the boundar of clip, - * transformed by inverse of matrix. - * @since 12 - * @version 1.0 - */ -OH_Drawing_Rect* OH_Drawing_CanvasGetLocalClipBounds(OH_Drawing_Canvas*); - -/** - * @brief Get a 3x3 matrix of the transform from local coordinates to 'device' - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @return The pointer to an OH_Drawing_Matrix object. - * @since 12 - * @version 1.0 - */ -OH_Drawing_Matrix* OH_Drawing_CanvasGetLocalToDevice(OH_Drawing_Canvas*); - -/** - * @brief Use the passed matrix to transforming the geometry, then use existing matrix. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object, - * represents the matrix which is passed. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasConcatMatrix(OH_Drawing_Canvas*, OH_Drawing_Matrix*); - -/** - * @brief Enumerates of shadow flags. - * - * @since 12 - * @version 1.0 - */ -typedef enum { - /** - * Use no shadow flags. - */ - SHADOW_FLAGS_NONE, - /** - * The occluding object is transparent. - */ - SHADOW_FLAGS_TRANSPARENT_OCCLUDER, - /** - * No need to analyze shadows. - */ - SHADOW_FLAGS_GEOMETRIC_ONLY, - /** - * Use all shadow falgs. - */ - SHADOW_FLAGS_ALL, -} OH_Drawing_CanvasShadowFlags; - -/** - * @brief Use circular light to draw an offset spot shadow and outlining ambient shadow for the given path. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object, use to generate shadows. - * @param OH_Drawing_Point3 Indicates the pointer to an OH_Drawing_Point3 object. - * represents the value of the function which returns Z offset of the occluder from the canvas based on x and y. - * @param OH_Drawing_Point3 Indicates the pointer to an OH_Drawing_Point3 object. - * represents the position of the light relative to the canvas. - * @param lightRadius The radius of the circular light. - * @param ambientColor Ambient shadow's color. - * @param spotColor Spot shadow's color. - * @param flag Indicates the flag to control opaque occluder, shadow, and light position. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawShadow(OH_Drawing_Canvas*, OH_Drawing_Path*, OH_Drawing_Point3*, - OH_Drawing_Point3*, float lightRadius, uint32_t ambientColor, uint32_t spotColor, - OH_Drawing_CanvasShadowFlags flag); - /** * @brief Clears a canvas by using a specified color. * @@ -477,45 +363,6 @@ void OH_Drawing_CanvasDrawShadow(OH_Drawing_Canvas*, OH_Drawing_Path*, OH_Drawin */ void OH_Drawing_CanvasClear(OH_Drawing_Canvas*, uint32_t color); -/** - * @brief Sets matrix of canvas. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Canvas object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasSetMatrix(OH_Drawing_Canvas*, OH_Drawing_Matrix*); - -/** - * @brief Draws the specified source rectangle of the image onto the canvas, - * scaled and translated to the destination rectangle. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Image object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. - * @param OH_Drawing_SamplingOptions Indicates the pointer to an OH_Drawing_SamplingOptions object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawImageRect(OH_Drawing_Canvas*, OH_Drawing_Image*, OH_Drawing_Rect* dst, OH_Drawing_SamplingOptions*); - -/** - * @brief Read pixels data to a bitmap from canvas. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. - * @param srcX offset into SkCanvas writable pixels on x-axis. - * @param srcY offset into SkCanvas writable pixels on y-axis. - * @return true if pixels are copied to dstBitmap. - * @since 12 - * @version 1.0 - */ -bool OH_Drawing_CanvasReadPixelsToBitmap(OH_Drawing_Canvas*, OH_Drawing_Bitmap*, int32_t srcX, int32_t srcY); - #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index 437326df78421a7daa60b1e4148a4fa6e2162008..5c02a704d0b24f8fc6aaa4051878280e0643edea 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -64,28 +64,6 @@ OH_Drawing_Font* OH_Drawing_FontCreate(void); */ void OH_Drawing_FontSetTypeface(OH_Drawing_Font*, OH_Drawing_Typeface*); -/** - * @brief Gets an OH_Drawing_Typeface object from the OH_Drawing_Typeface object. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. - * @return OH_Drawing_Typeface Indicates the pointer to an OH_Drawing_Typeface object. - * @since 12 - * @version 1.0 - */ -OH_Drawing_Typeface* OH_Drawing_FontGetTypeface(OH_Drawing_Font*); - -/** - * @brief Set Font and glyph metrics should ignore hinting and rounding. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. - * @param bool Should ignore hinting and rounding. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_FontSetLinearMetrics(OH_Drawing_Font*, bool); - /** * @brief Sets text size for an OH_Drawing_Font object. * @@ -140,37 +118,6 @@ void OH_Drawing_FontSetFakeBoldText(OH_Drawing_Font*, bool isFakeBoldText); */ void OH_Drawing_FontDestroy(OH_Drawing_Font*); -/** - * @brief Defines a run, supplies storage for the metrics of an SkFont. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - /** storage for top in font metrics */ - float top; - /** storage for ascent in font metrics */ - float ascent; - /** storage for descent in font metrics */ - float descent; - /** storage for bottom in font metrics */ - float bottom; - /** storage for leading in font metrics */ - float leading; -} OH_Drawing_Font_Metrics; - -/** - * @brief Obtains the metrics of a font. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. - * @param OH_Drawing_Font_Metrics Indicates the pointer to an OH_Drawing_Font_Metrics object. - * @return Returns a float variable that recommended spacing between lines. - * @since 12 - * @version 1.0 - */ -float OH_Drawing_FontGetMetrics(OH_Drawing_Font*, OH_Drawing_Font_Metrics*); - #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_image.h b/graphic/graphic_2d/native_drawing/drawing_image.h deleted file mode 100644 index bf96b7b34b1ba1192e9f595252a5bb15e27f160b..0000000000000000000000000000000000000000 --- a/graphic/graphic_2d/native_drawing/drawing_image.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef C_INCLUDE_DRAWING_IMAGE_H -#define C_INCLUDE_DRAWING_IMAGE_H - -/** - * @addtogroup Drawing - * @{ - * - * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * - * @since 12 - * @version 1.0 - */ - -/** - * @file drawing_image.h - * - * @brief Declares functions related to the image object in the drawing module. - * - * @since 12 - * @version 1.0 - */ - -#include "drawing_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Creates an OH_Drawing_Image object. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @return Returns the pointer to the OH_Drawing_Image object created. - * @since 12 - * @version 1.0 - */ -OH_Drawing_Image* OH_Drawing_ImageCreate(void); - -/** - * @brief Destroys an OH_Drawing_Image object and reclaims the memory occupied by the object. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Image Indicates the pointer to an OH_Drawing_Image object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_ImageDestroy(OH_Drawing_Image*); - -/** - * @brief Rebuilds an OH_Drawing_Image object, sharing or copying bitmap pixels. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Image Indicates the pointer to an OH_Drawing_Image object. - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. - * @return Returns true if successed. - * @since 12 - * @version 1.0 - */ -bool OH_Drawing_ImageBuildFromBitmap(OH_Drawing_Image*, OH_Drawing_Bitmap*); - -/** - * @brief Gets pixel count in each row of image. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Image Indicates the pointer to an OH_Drawing_Image object. - * @return Returns the width. - * @since 12 - * @version 1.0 - */ -int32_t OH_Drawing_ImageGetWidth(OH_Drawing_Image*); - -/** - * @brief Gets pixel row count of image. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Image Indicates the pointer to an OH_Drawing_Image object. - * @return Returns the height. - * @since 12 - * @version 1.0 - */ -int32_t OH_Drawing_ImageGetHeight(OH_Drawing_Image*); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/graphic/graphic_2d/native_drawing/drawing_matrix.h b/graphic/graphic_2d/native_drawing/drawing_matrix.h index 1aa849bcd2a019aec8a742a61d9747be379f04d8..8ae3da4c2e141737926d18b59c7ca4e3c851e741 100644 --- a/graphic/graphic_2d/native_drawing/drawing_matrix.h +++ b/graphic/graphic_2d/native_drawing/drawing_matrix.h @@ -53,49 +53,6 @@ extern "C" { */ OH_Drawing_Matrix* OH_Drawing_MatrixCreate(void); -/** - * @brief Creates an OH_Drawing_Matrix object with rotation. Sets matrix to - * rotate by degrees about a pivot point at (px, py). - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. - * @param deg angle of axes relative to upright axes - * @param x pivot on x-axis. - * @param y pivot on y-axis. - * @since 12 - * @version 1.0 - */ -OH_Drawing_Matrix* OH_Drawing_MatrixCreateRotation(float deg, float x, float y); - -/** - * @brief Creates an OH_Drawing_Matrix object with scale. Sets matrix to scale - * by sx and sy, about a pivot point at (px, py). - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. - * @param sx horizontal scale factor. - * @param sy vertical scale factor. - * @param px pivot on x-axis. - * @param py pivot on y-axis. - * @return Returns the pointer to the OH_Drawing_Matrix object created. - * @since 12 - * @version 1.0 - */ -OH_Drawing_Matrix* OH_Drawing_MatrixCreateScale(float sx, float sy, float px, float py); - -/** - * @brief Creates an OH_Drawing_Matrix object with translation. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. - * @param dx horizontal translation. - * @param dy vertical translation. - * @return Returns the pointer to the OH_Drawing_Matrix object created. - * @since 12 - * @version 1.0 - */ -OH_Drawing_Matrix* OH_Drawing_MatrixCreateTranslation(float dx, float dy); - /** * @brief Sets the params for a matrix. * @@ -116,103 +73,6 @@ OH_Drawing_Matrix* OH_Drawing_MatrixCreateTranslation(float dx, float dy); void OH_Drawing_MatrixSetMatrix(OH_Drawing_Matrix*, float scaleX, float skewX, float transX, float skewY, float scaleY, float transY, float persp0, float persp1, float persp2); -/** - * @brief Sets matrix to matrix multiplied by matrix other. - * Given: - * | A B C | | J K L | - * Matrix = | D E F |, other = | M N O | - * | G H I | | P Q R | - * sets Matrix to: - * - * | A B C | | J K L | | AJ+BM+CP AK+BN+CQ AL+BO+CR | - * Matrix * other = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR | - * | G H I | | P Q R | | GJ+HM+IP GK+HN+IQ GL+HO+IR | - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. - * @param other Indicates the pointer to an OH_Drawing_Matrix object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_MatrixPreConcat(OH_Drawing_Matrix*, OH_Drawing_Matrix* other); - -/** - * @brief Sets matrix to rotate by degrees about a pivot point at (px, py). The pivot point is unchanged - * when mapped with matrix. Positive degrees rotates clockwise. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_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 - */ -void OH_Drawing_MatrixRotate(OH_Drawing_Matrix*, float degree, float px, float py); - -/** - * @brief Sets matrix to translate by (dx, dy) - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. - * @param dx Indicates the horizontal translation. - * @param dy Indicates the vertical translation. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_MatrixTranslate(OH_Drawing_Matrix*, float dx, float dy); - -/** - * @brief Sets matrix to scale by sx and sy, about a pivot point at (px, py). - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. - * @param sx Indicates the horizontal scale factor. - * @param sy Indicates the vertical scale factor. - * @param px Indicates the pivot on x-axis. - * @param py Indicates the pivot on y-axis. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_MatrixScale(OH_Drawing_Matrix*, float sx, float sy, float px, float py); - -/** - * @brief Sets inverse to reciprocal matrix, returning true if matrix can be inverted. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. - * @param inverse Indicates the pointer to an OH_Drawing_Matrix object. - * @return Returns true if matrix can be inverted, or flase. - * @since 12 - * @version 1.0 - */ -bool OH_Drawing_MatrixInvert(OH_Drawing_Matrix*, OH_Drawing_Matrix* inverse); - -/** - * @brief Returns true if the first matrix equals the second matrix. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. - * @param other Indicates the pointer to an OH_Drawing_Matrix object. - * @return Returns true if the two matrices are equal, or flase. - * @since 12 - * @version 1.0 - */ -bool OH_Drawing_MatrixIsEqual(OH_Drawing_Matrix*, OH_Drawing_Matrix* other); - -/** - * @brief Returns true if matrix is identity. - * Identity matrix is : | 1 0 0 | - * | 0 1 0 | - * | 0 0 1 | - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. - * @return Returns true if matrix is identity, or flase. - * @since 12 - * @version 1.0 - */ -bool OH_Drawing_MatrixIsIdentity(OH_Drawing_Matrix*); - /** * @brief Destroys an OH_Drawing_Matrix object and reclaims the memory occupied by the object. * diff --git a/graphic/graphic_2d/native_drawing/drawing_memory_stream.h b/graphic/graphic_2d/native_drawing/drawing_memory_stream.h deleted file mode 100644 index 4abafe9fe36464cb34aaf7ff54dfeecedc2fa6c3..0000000000000000000000000000000000000000 --- a/graphic/graphic_2d/native_drawing/drawing_memory_stream.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef C_INCLUDE_DRAWING_MEMORY_STREAM_H -#define C_INCLUDE_DRAWING_MEMORY_STREAM_H - -/** - * @addtogroup Drawing - * @{ - * - * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * - * @since 12 - * @version 1.0 - */ - -/** - * @file drawing_memory_stream.h - * - * @brief Declares functions related to the memoryStream object in the drawing module. - * - * @since 12 - * @version 1.0 - */ - -#include "drawing_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Creates a OH_Drawing_MemoryStream object. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @return Returns the pointer to the OH_Drawing_MemoryStream object created. - * @param data file path. - * @param length Data length. - * @param copyData Copy data or not. - * @since 12 - * @version 1.0 - */ -OH_Drawing_MemoryStream* OH_Drawing_MemoryStreamCreate(const void* data, size_t length, bool copyData); - -/** - * @brief Destroys an OH_Drawing_MemoryStream object and reclaims the memory occupied by the object. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_MemoryStream Indicates the pointer to an OH_Drawing_MemoryStream object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_MemoryStreamDestroy(OH_Drawing_MemoryStream*); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/graphic/graphic_2d/native_drawing/drawing_path.h b/graphic/graphic_2d/native_drawing/drawing_path.h index 104ecbb9f4ecf1fde0498181c0e75574f0d04fda..5f5e34a1a12d6f17be39477e7000656e0a7ba2c1 100644 --- a/graphic/graphic_2d/native_drawing/drawing_path.h +++ b/graphic/graphic_2d/native_drawing/drawing_path.h @@ -43,36 +43,6 @@ extern "C" { #endif -/** - * @brief Direction for adding closed contours. - * - * @since 11 - * @version 1.0 - */ -typedef enum { - /** clockwise direction for adding closed contours */ - PATH_DIRECTION_CW, - /** counter-clockwise direction for adding closed contours */ - PATH_DIRECTION_CCW, -} OH_Drawing_PathDirection; - -/** - * @brief FillType of path - * - * @since 11 - * @version 1.0 - */ -typedef enum { - /** Specifies that "inside" is computed by a non-zero sum of signed edge crossings */ - PATH_FILL_TYPE_WINDING, - /** Specifies that "inside" is computed by an odd number of edge crossings */ - PATH_FILL_TYPE_EVEN_ODD, - /** Same as Winding, but draws outside of the path, rather than inside */ - PATH_FILL_TYPE_INVERSE_WINDING, - /** Same as EvenOdd, but draws outside of the path, rather than inside */ - PATH_FILL_TYPE_INVERSE_EVEN_ODD, -} OH_Drawing_PathFillType; - /** * @brief Creates an OH_Drawing_Path object. * @@ -83,17 +53,6 @@ typedef enum { */ OH_Drawing_Path* OH_Drawing_PathCreate(void); -/** - * @brief Creates an OH_Drawing_Path copy object. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Rect object. - * @return Returns the pointer to the OH_Drawing_Path object created. - * @since 12 - * @version 1.0 - */ -OH_Drawing_Path* OH_Drawing_PathCopy(OH_Drawing_Path*); - /** * @brief Destroys an OH_Drawing_Path object and reclaims the memory occupied by the object. * @@ -180,99 +139,6 @@ void OH_Drawing_PathQuadTo(OH_Drawing_Path*, float ctrlX, float ctrlY, float end void OH_Drawing_PathCubicTo( OH_Drawing_Path*, float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY); -/** - * @brief Adds a new contour to the path, defined by the rect, and wound in the specified direction. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. - * @param left Indicates the left coordinate of the upper left corner of the rectangle. - * @param top Indicates the top coordinate of the upper top corner of the rectangle. - * @param right Indicates the right coordinate of the lower right corner of the rectangle. - * @param bottom Indicates the bottom coordinate of the lower bottom corner of the rectangle. - * @param OH_Drawing_PathDirection Indicates the path direction. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_PathAddRect(OH_Drawing_Path*, float left, float top, float right, float bottom, OH_Drawing_PathDirection); - -/** - * @brief Adds a new contour to the path, defined by the round rect, and wound in the specified direction. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_RoundRect Indicates the pointer to an OH_Drawing_RoundRect object. - * @param OH_Drawing_PathDirection Indicates the path direction. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_PathAddRoundRect(OH_Drawing_Path*, const OH_Drawing_RoundRect* roundRect, OH_Drawing_PathDirection); - -/** - * @brief Appends arc to path, as the start of new contour.Arc added is part of ellipse bounded by oval, - * from startAngle through sweepAngle. Both startAngle and sweepAngle are measured in degrees, where zero degrees - * is aligned with the positive x-axis, and positive sweeps extends arc clockwise.If sweepAngle <= -360, or - * sweepAngle >= 360; and startAngle modulo 90 is nearly zero, append oval instead of arc. Otherwise, sweepAngle - * values are treated modulo 360, and arc may or may not draw depending on numeric rounding. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. - * @param startAngle Indicates the starting angle of arc in degrees. - * @param sweepAngle Indicates the sweep, in degrees. Positive is clockwise. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_PathAddArc(OH_Drawing_Path*, const OH_Drawing_Rect*, float startAngle, float sweepAngle); - -/** - * @brief Appends src path to path, transformed by matrix. Transformed curves may have different verbs, - * point, and conic weights. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. - * @param src Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_Matrix Indicates the length of the OH_Drawing_Matrix object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_PathAddPath(OH_Drawing_Path*, const OH_Drawing_Path* src, const OH_Drawing_Matrix*); - -/** - * @brief Return the status that point (x, y) is contained by path. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. - * @param x Indicates the x-axis value of containment test. - * @param y Indicates the y-axis value of containment test. - * @return Returns true if the point (x, y) is contained by path. - * @since 12 - * @version 1.0 - */ -bool OH_Drawing_PathContains(OH_Drawing_Path*, float x, float y); - -/** - * @brief Transforms verb array, point array, and weight by matrix. transform may change verbs - * and increase their number. path is replaced by transformed data. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_Matrix Indicates the pointer to an OH_Drawing_Matrix object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_PathTransform(OH_Drawing_Path*, const OH_Drawing_Matrix*); - -/** - * @brief Sets FillType, the rule used to fill path. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object. - * @param OH_Drawing_PathFillType Indicates the add path's fill type. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_SetFillStyle(OH_Drawing_Path*, OH_Drawing_PathFillType); - /** * @brief Closes a path. A line segment from the start point to the last point of the path is added. * diff --git a/graphic/graphic_2d/native_drawing/drawing_path_effect.h b/graphic/graphic_2d/native_drawing/drawing_path_effect.h deleted file mode 100644 index 90aee6f3ac2a3087ea0fa2b94a91c8fb4cf7c3cd..0000000000000000000000000000000000000000 --- a/graphic/graphic_2d/native_drawing/drawing_path_effect.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef C_INCLUDE_DRAWING_PATH_EFFECT_H -#define C_INCLUDE_DRAWING_PATH_EFFECT_H - -/** - * @addtogroup Drawing - * @{ - * - * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * - * @since 12 - * @version 1.0 - */ - -/** - * @file drawing_path_effect.h - * - * @brief Declares functions related to the pathEffect object in the drawing module. - * - * @since 12 - * @version 1.0 - */ - -#include "drawing_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Creates an OH_Drawing_PathEffect object. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param intervals Indicates a array which contain an even number of entries. - * @param count Indicates the number of elements of the intervals array. - * @param phase Indicates the offset into intervals array. - * @return Returns the pointer to the OH_Drawing_PathEffect object created. - * @since 12 - * @version 1.0 - */ -OH_Drawing_PathEffect* OH_Drawing_CreateDashPathEffect(float* intervals, int count, float phase); - -/** - * @brief Destroys an OH_Drawing_PathEffect object and reclaims the memory occupied by the object. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_PathEffect Indicates the pointer to an OH_Drawing_PathEffect object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_PathEffectDestroy(OH_Drawing_PathEffect*); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/graphic/graphic_2d/native_drawing/drawing_pen.h b/graphic/graphic_2d/native_drawing/drawing_pen.h index e94fcb24b91c04ed2254c09365ac5a66ec81be4e..220e5723d12d8ede702f020b1c2dd9c2efd2ecea 100644 --- a/graphic/graphic_2d/native_drawing/drawing_pen.h +++ b/graphic/graphic_2d/native_drawing/drawing_pen.h @@ -21,7 +21,7 @@ * @{ * * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. - * + * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * * @since 8 @@ -183,9 +183,9 @@ float OH_Drawing_PenGetMiterLimit(const OH_Drawing_Pen*); void OH_Drawing_PenSetMiterLimit(OH_Drawing_Pen*, float miter); /** - * @brief Enumerates line cap styles of a pen. The line cap style defines + * @brief Enumerates line cap styles of a pen. The line cap style defines * the style of both ends of a line segment drawn by the pen. - * + * * @since 8 * @version 1.0 */ @@ -231,7 +231,7 @@ void OH_Drawing_PenSetCap(OH_Drawing_Pen*, OH_Drawing_PenLineCapStyle); /** * @brief Enumerates pen line join styles. The line join style defines * the shape of the joints of a polyline segment drawn by the pen. - * + * * @since 8 * @version 1.0 */ @@ -291,17 +291,6 @@ void OH_Drawing_PenSetShaderEffect(OH_Drawing_Pen*, OH_Drawing_ShaderEffect*); */ void OH_Drawing_PenSetFilter(OH_Drawing_Pen*, OH_Drawing_Filter*); -/** - * @brief Sets a blender that implements the specified blendmode enum for a pen. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. - * @param OH_Drawing_BlendMode Indicates the blend mode. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_PenSetBlendMode(OH_Drawing_Pen*, OH_Drawing_BlendMode); - #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_point.h b/graphic/graphic_2d/native_drawing/drawing_point.h index 53c828604da8cbc73a8966afd3e1121c33a6fc03..f63faf78d885ee6a432dfb677b524e3f1934fdb1 100644 --- a/graphic/graphic_2d/native_drawing/drawing_point.h +++ b/graphic/graphic_2d/native_drawing/drawing_point.h @@ -65,29 +65,6 @@ OH_Drawing_Point* OH_Drawing_PointCreate(float x, float y); */ void OH_Drawing_PointDestroy(OH_Drawing_Point*); -/** - * @brief Creates an OH_Drawing_Point3 object. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param x Indicates the x-axis coordinates of the point. - * @param y Indicates the y-axis coordinates of the point. - * @param z Indicates the z-axis coordinates of the point. - * @return Returns the pointer to the OH_Drawing_Point3 object created. - * @since 12 - * @version 1.0 - */ -OH_Drawing_Point3* OH_Drawing_Point3Create(float x, float y, float z); - -/** - * @brief Destroys an OH_Drawing_Point3 object and reclaims the memory occupied by the object. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Point3 Indicates the pointer to an OH_Drawing_Point3 object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_Point3Destroy(OH_Drawing_Point3*); - #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_sampling_options.h b/graphic/graphic_2d/native_drawing/drawing_sampling_options.h deleted file mode 100644 index d29649408b93d0dc8f84d1b438ead95876b22826..0000000000000000000000000000000000000000 --- a/graphic/graphic_2d/native_drawing/drawing_sampling_options.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef C_INCLUDE_DRAWING_SAMPLING_OPTIONS_H -#define C_INCLUDE_DRAWING_SAMPLING_OPTIONS_H - -/** - * @addtogroup Drawing - * @{ - * - * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * - * @since 12 - * @version 1.0 - */ - -/** - * @file drawing_sampling_options.h - * - * @brief Declares functions related to the sampling options object in the drawing module. - * - * @since 12 - * @version 1.0 - */ - -#include "drawing_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Enumerates storage filter mode. - * - * @since 12 - * @version 1.0 - */ -typedef enum { - /** single sample point (nearest neighbor) */ - FILTER_MODE_NEAREST, - /** interporate between 2x2 sample points (bilinear interpolation) */ - FILTER_MODE_LINEAR, -} OH_Drawing_FilterMode; - -/** - * @brief Enumerates storage formats mipmap mode. - * - * @since 12 - * @version 1.0 - */ -typedef enum { - /** ignore mipmap levels, sample from the "base" */ - MIPMAP_MODE_NONE, - /** sample from the nearest level */ - MIPMAP_MODE_NEAREST, - /** interpolate between the two nearest levels */ - MIPMAP_MODE_LINEAR, -} OH_Drawing_MipmapMode; - -/** - * @brief Creates an OH_Drawing_SamplingOptions object. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FilterMode sampling filter mode. - * @param OH_Drawing_MipmapMode sampling mipmap mode.. - * @return Returns the pointer to the OH_Drawing_SamplingOptions object created. - * @since 12 - * @version 1.0 - */ -OH_Drawing_SamplingOptions* OH_Drawing_SamplingOptionsCreate(OH_Drawing_FilterMode, OH_Drawing_MipmapMode); - -/** - * @brief Destroys an OH_Drawing_SamplingOptions object and reclaims the memory occupied by the object. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_SamplingOptions Indicates the pointer to an OH_Drawing_SamplingOptions object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_SamplingOptionsDestroy(OH_Drawing_SamplingOptions*); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/graphic/graphic_2d/native_drawing/drawing_text_blob.h b/graphic/graphic_2d/native_drawing/drawing_text_blob.h index 5993b89eb220b932b8d13a8a070d9ead4d594122..73325b032013affd46f05212499dcf3f6d30f9c0 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_blob.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_blob.h @@ -43,22 +43,6 @@ extern "C" { #endif -/** - * @brief Enumerates text encoding. - * @since 12 - * @version 1.0 - */ -typedef enum { - /** uses bytes to represent UTF-8 or ASCII */ - TEXT_ENCODING_UTF8, - /** uses two byte words to represent most of Unicode */ - TEXT_ENCODING_UTF16, - /** uses four byte words to represent all of Unicode */ - TEXT_ENCODING_UTF32, - /** uses two byte words to represent glyph indices */ - TEXT_ENCODING_GLYPH_ID, -} OH_Drawing_TextEncoding; - /** * @brief Creates an OH_Drawing_TextBlobBuilder object. * @@ -69,62 +53,6 @@ typedef enum { */ OH_Drawing_TextBlobBuilder* OH_Drawing_TextBlobBuilderCreate(void); -/** - * @brief Creates an OH_Drawing_TextBlob object from text. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param text Indicates the the pointer to text. - * @param byteLength Indicates the text length. - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. - * @param OH_Drawing_TextEncoding Indicates the pointer to an OH_Drawing_TextEncoding object. - * @return Returns the pointer to the OH_Drawing_TextBlob object created. - * @since 12 - * @version 1.0 - */ -OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromText(const void* text, size_t byteLength, - const OH_Drawing_Font*, OH_Drawing_TextEncoding); - -/** - * @brief Creates an OH_Drawing_TextBlob object from pos text. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param text Indicates the the pointer to text. - * @param byteLength Indicates the text length. - * @param OH_Drawing_Point Indicates the points. - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. - * @param OH_Drawing_TextEncoding Indicates the pointer to an OH_Drawing_TextEncoding object. - * @return Returns the pointer to the OH_Drawing_TextBlob object created. - * @since 12 - * @version 1.0 - */ -OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromPosText(const void* text, size_t byteLength, - OH_Drawing_Point* points, const OH_Drawing_Font*, OH_Drawing_TextEncoding); - -/** - * @brief Creates an OH_Drawing_TextBlob object from pos text. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param str Indicates the the pointer to text. - * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. - * @param OH_Drawing_TextEncoding Indicates the pointer to an OH_Drawing_TextEncoding object. - * @return Returns the pointer to the OH_Drawing_TextBlob object created. - * @since 12 - * @version 1.0 - */ -OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromString(const char* str, - const OH_Drawing_Font*, OH_Drawing_TextEncoding); - -/** - * @brief Gets the bounds of textblob, assigned to the pointer to an OH_Drawing_Rect object. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextBlob Indicates the pointer to an OH_Drawing_TextBlob object. - * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_TextBlobGetBounds(OH_Drawing_TextBlob*, OH_Drawing_Rect*); - /** * @brief Defines a run, supplies storage for glyphs and positions. * diff --git a/graphic/graphic_2d/native_drawing/drawing_typeface.h b/graphic/graphic_2d/native_drawing/drawing_typeface.h index 9498b5a1cee64dc0741f7d30b0543fa4f5673abe..a484d70f2d560d9865122a46c2fd1d68a32be856 100644 --- a/graphic/graphic_2d/native_drawing/drawing_typeface.h +++ b/graphic/graphic_2d/native_drawing/drawing_typeface.h @@ -53,32 +53,6 @@ extern "C" { */ OH_Drawing_Typeface* OH_Drawing_TypefaceCreateDefault(void); -/** - * @brief Creates a OH_Drawing_Typeface object by file. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param path file path. - * @param index file index. - * @return Returns the pointer to the OH_Drawing_Typeface object created. - * @since 12 - * @version 1.0 - */ -OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromFile(const char* path, int index); - -/** - * @brief Creates a OH_Drawing_Typeface object by given a stream. If the stream is not a valid - * font file, returns nullptr. Ownership of the stream is transferred, so the caller must not reference - * it or free it again. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_MemoryStream Indicates the pointer to an OH_Drawing_MemoryStream object. - * @param index memory stream index. - * @return Returns the pointer to the OH_Drawing_Typeface object created. - * @since 12 - * @version 1.0 - */ -OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromStream(OH_Drawing_MemoryStream*, int32_t index); - /** * @brief Destroys an OH_Drawing_Typeface object and reclaims the memory occupied by the object. * diff --git a/graphic/graphic_2d/native_drawing/drawing_types.h b/graphic/graphic_2d/native_drawing/drawing_types.h index f3d927d4eb1a2a1ca9ad39ffbabbf852b5d0062b..cdf7f35cc7738dc86e91aa114147e4e10c70f3ef 100644 --- a/graphic/graphic_2d/native_drawing/drawing_types.h +++ b/graphic/graphic_2d/native_drawing/drawing_types.h @@ -21,7 +21,7 @@ * @{ * * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. - * + * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * * @since 8 @@ -38,7 +38,6 @@ */ #include -#include #ifdef __cplusplus extern "C" { @@ -93,22 +92,6 @@ typedef struct OH_Drawing_Bitmap OH_Drawing_Bitmap; */ typedef struct OH_Drawing_Point OH_Drawing_Point; -/** - * @brief Defines a point of 3x3, which is used to describe the coordinate point. - * - * @since 12 - * @version 1.0 - */ -typedef struct OH_Drawing_Point3 OH_Drawing_Point3; - -/** - * @brief Defines a pathEffect, which is used to affects stroked paths. - * - * @since 12 - * @version 1.0 - */ -typedef struct OH_Drawing_PathEffect OH_Drawing_PathEffect; - /** * @brief Defines a rect, which is used to describe the rectangle. * @@ -173,14 +156,6 @@ typedef struct OH_Drawing_ColorFilter OH_Drawing_ColorFilter; */ typedef struct OH_Drawing_Font OH_Drawing_Font; -/** - * @brief Defines a memoryStream, which is used to describe the memory stream. - * - * @since 12 - * @version 1.0 - */ -typedef struct OH_Drawing_MemoryStream OH_Drawing_MemoryStream; - /** * @brief Defines a typeface, which is used to describe the typeface. * @@ -198,22 +173,6 @@ typedef struct OH_Drawing_Typeface OH_Drawing_Typeface; */ typedef struct OH_Drawing_TextBlob OH_Drawing_TextBlob; -/** - * @brief Defines a image, which is used to describe a two dimensional array of pixels to draw. - * - * @since 11 - * @version 1.0 - */ -typedef struct OH_Drawing_Image OH_Drawing_Image; - -/** - * @brief Defines a matrix, which is used to describe the transforming coordinates. - * - * @since 11 - * @version 1.0 - */ -typedef struct OH_Drawing_SamplingOptions OH_Drawing_SamplingOptions; - /** * @brief Defines a textBlobBuilder, which is used to build the textBlob. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 64d2dd988911ce65797d9989b54193e03838308d..314e98b4190bd230729f7e365372eca4559d92d7 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -9,7 +9,6 @@ { "name": "OH_Drawing_BrushDestroy" }, { "name": "OH_Drawing_BrushGetAlpha" }, { "name": "OH_Drawing_BrushSetAlpha" }, - { "name": "OH_Drawing_BrushSetBlendMode" }, { "name": "OH_Drawing_BrushIsAntiAlias" }, { "name": "OH_Drawing_BrushSetAntiAlias" }, { "name": "OH_Drawing_BrushGetColor" }, @@ -24,7 +23,6 @@ { "name": "OH_Drawing_CanvasAttachBrush" }, { "name": "OH_Drawing_CanvasDetachBrush" }, { "name": "OH_Drawing_CanvasSave" }, - { "name": "OH_Drawing_CanvasSaveLayer" }, { "name": "OH_Drawing_CanvasRestore" }, { "name": "OH_Drawing_CanvasGetSaveCount" }, { "name": "OH_Drawing_CanvasRestoreToCount" }, @@ -43,17 +41,6 @@ { "name": "OH_Drawing_CanvasTranslate" }, { "name": "OH_Drawing_CanvasScale" }, { "name": "OH_Drawing_CanvasClear" }, - { "name": "OH_Drawing_CanvasSetMatrix" }, - { "name": "OH_Drawing_CanvasDrawImageRect" }, - { "name": "OH_Drawing_CanvasReadPixelsToBitmap" }, - { "name": "OH_Drawing_CanvasGetWidth" }, - { "name": "OH_Drawing_CanvasGetHeight" }, - { "name": "OH_Drawing_CanvasGetLocalClipBounds" }, - { "name": "OH_Drawing_CanvasGetLocalToDevice" }, - { "name": "OH_Drawing_CanvasConcatMatrix" }, - { "name": "OH_Drawing_CanvasDrawShadow" }, - { "name": "OH_Drawing_CreateDashPathEffect" }, - { "name": "OH_Drawing_PathEffectDestroy" }, { "name": "OH_Drawing_ColorFilterCreateBlendMode" }, { "name": "OH_Drawing_ColorFilterCreateCompose" }, { "name": "OH_Drawing_ColorFilterCreateLinearToSrgbGamma" }, @@ -72,46 +59,24 @@ { "name": "OH_Drawing_FontSetTextSize" }, { "name": "OH_Drawing_FontSetTextSkewX" }, { "name": "OH_Drawing_FontSetTypeface" }, - { "name": "OH_Drawing_FontGetMetrics" }, - { "name": "OH_Drawing_FontGetTypeface" }, - { "name": "OH_Drawing_FontSetLinearMetrics" }, { "name": "OH_Drawing_MaskFilterCreateBlur" }, { "name": "OH_Drawing_MaskFilterDestroy" }, { "name": "OH_Drawing_MatrixCreate" }, - { "name": "OH_Drawing_MatrixCreateRotation" }, - { "name": "OH_Drawing_MatrixCreateScale" }, - { "name": "OH_Drawing_MatrixCreateTranslation" }, { "name": "OH_Drawing_MatrixSetMatrix" }, - { "name": "OH_Drawing_MatrixPreConcat" }, - { "name": "OH_Drawing_MatrixRotate" }, - { "name": "OH_Drawing_MatrixTranslate" }, - { "name": "OH_Drawing_MatrixScale" }, - { "name": "OH_Drawing_MatrixInvert" }, - { "name": "OH_Drawing_MatrixIsEqual" }, - { "name": "OH_Drawing_MatrixIsIdentity" }, { "name": "OH_Drawing_MatrixDestroy" }, { "name": "OH_Drawing_PathCreate" }, - { "name": "OH_Drawing_PathCopy" }, { "name": "OH_Drawing_PathDestroy" }, { "name": "OH_Drawing_PathMoveTo" }, { "name": "OH_Drawing_PathLineTo" }, { "name": "OH_Drawing_PathArcTo" }, { "name": "OH_Drawing_PathQuadTo" }, { "name": "OH_Drawing_PathCubicTo" }, - { "name": "OH_Drawing_PathAddRect" }, - { "name": "OH_Drawing_PathAddRoundRect" }, - { "name": "OH_Drawing_PathAddArc" }, - { "name": "OH_Drawing_PathAddPath" }, - { "name": "OH_Drawing_PathContains" }, - { "name": "OH_Drawing_PathTransform" }, - { "name": "OH_Drawing_SetFillStyle" }, { "name": "OH_Drawing_PathClose" }, { "name": "OH_Drawing_PathReset" }, { "name": "OH_Drawing_PenCreate" }, { "name": "OH_Drawing_PenDestroy" }, { "name": "OH_Drawing_PenGetAlpha" }, { "name": "OH_Drawing_PenSetAlpha" }, - { "name": "OH_Drawing_PenSetBlendMode" }, { "name": "OH_Drawing_PenIsAntiAlias" }, { "name": "OH_Drawing_PenSetAntiAlias" }, { "name": "OH_Drawing_PenGetColor" }, @@ -128,8 +93,6 @@ { "name": "OH_Drawing_PenSetShaderEffect" }, { "name": "OH_Drawing_PointCreate" }, { "name": "OH_Drawing_PointDestroy" }, - { "name": "OH_Drawing_Point3Create" }, - { "name": "OH_Drawing_Point3Destroy" }, { "name": "OH_Drawing_ColorSetArgb" }, { "name": "OH_Drawing_CreateFontCollection" }, { "name": "OH_Drawing_DestroyFontCollection" }, @@ -158,20 +121,12 @@ { "name": "OH_Drawing_ShaderEffectCreateRadialGradient" }, { "name": "OH_Drawing_ShaderEffectCreateSweepGradient" }, { "name": "OH_Drawing_ShaderEffectDestroy" }, - { "name": "OH_Drawing_TextBlobCreateFromText" }, - { "name": "OH_Drawing_TextBlobCreateFromPosText" }, - { "name": "OH_Drawing_TextBlobCreateFromString" }, - { "name": "OH_Drawing_TextBlobGetBounds" }, { "name": "OH_Drawing_TextBlobBuilderAllocRunPos" }, { "name": "OH_Drawing_TextBlobBuilderCreate" }, { "name": "OH_Drawing_TextBlobBuilderDestroy" }, { "name": "OH_Drawing_TextBlobBuilderMake" }, { "name": "OH_Drawing_TextBlobDestroy" }, - { "name": "OH_Drawing_MemoryStreamCreate" }, - { "name": "OH_Drawing_MemoryStreamDestroy" }, { "name": "OH_Drawing_TypefaceCreateDefault" }, - { "name": "OH_Drawing_TypefaceCreateFromFile" }, - { "name": "OH_Drawing_TypefaceCreateFromStream" }, { "name": "OH_Drawing_TypefaceDestroy" }, { "name": "OH_Drawing_CreateTypographyHandler" }, { "name": "OH_Drawing_DestroyTypographyHandler" }, @@ -189,13 +144,6 @@ { "name": "OH_Drawing_TypographyGetMaxIntrinsicWidth" }, { "name": "OH_Drawing_TypographyGetAlphabeticBaseline" }, { "name": "OH_Drawing_TypographyGetIdeographicBaseline" }, - { "name": "OH_Drawing_ImageCreate" }, - { "name": "OH_Drawing_ImageDestroy" }, - { "name": "OH_Drawing_ImageBuildFromBitmap" }, - { "name": "OH_Drawing_ImageGetWidth" }, - { "name": "OH_Drawing_ImageGetHeight" }, - { "name": "OH_Drawing_SamplingOptionsCreate" }, - { "name": "OH_Drawing_SamplingOptionsDestroy" }, { "first_introduced": "11", "name": "OH_Drawing_TypographyHandlerAddPlaceholder"