1 /* 2 * Copyright (c) 2021-2022 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_IMAGE_H 17 #define C_INCLUDE_DRAWING_IMAGE_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 12 28 * @version 1.0 29 */ 30 31 /** 32 * @file drawing_image.h 33 * 34 * @brief Declares functions related to the <b>image</b> object in the drawing module. 35 * 36 * @since 12 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_Image</b> object. 48 * 49 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 50 * @return Returns the pointer to the <b>OH_Drawing_Image</b> object created. 51 * @since 12 52 * @version 1.0 53 */ 54 OH_Drawing_Image* OH_Drawing_ImageCreate(void); 55 56 /** 57 * @brief Destroys an <b>OH_Drawing_Image</b> object and reclaims the memory occupied by the object. 58 * 59 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 60 * @param OH_Drawing_Image Indicates the pointer to an <b>OH_Drawing_Image</b> object. 61 * @since 12 62 * @version 1.0 63 */ 64 void OH_Drawing_ImageDestroy(OH_Drawing_Image*); 65 66 /** 67 * @brief Rebuilds an <b>OH_Drawing_Image</b> object, sharing or copying bitmap pixels. 68 * 69 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 70 * @param OH_Drawing_Image Indicates the pointer to an <b>OH_Drawing_Image</b> object. 71 * @param OH_Drawing_Bitmap Indicates the pointer to an <b>OH_Drawing_Bitmap</b> object. 72 * @return Returns true if successed. 73 * @since 12 74 * @version 1.0 75 */ 76 bool OH_Drawing_ImageBuildFromBitmap(OH_Drawing_Image*, OH_Drawing_Bitmap*); 77 78 /** 79 * @brief Gets pixel count in each row of image. 80 * 81 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 82 * @param OH_Drawing_Image Indicates the pointer to an <b>OH_Drawing_Image</b> object. 83 * @return Returns the width. 84 * @since 12 85 * @version 1.0 86 */ 87 int32_t OH_Drawing_ImageGetWidth(OH_Drawing_Image*); 88 89 /** 90 * @brief Gets pixel row count of image. 91 * 92 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 93 * @param OH_Drawing_Image Indicates the pointer to an <b>OH_Drawing_Image</b> object. 94 * @return Returns the height. 95 * @since 12 96 * @version 1.0 97 */ 98 int32_t OH_Drawing_ImageGetHeight(OH_Drawing_Image*); 99 100 /** 101 * @brief Gets the image info. 102 * 103 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 104 * @param OH_Drawing_Image Indicates the pointer to an <b>OH_Drawing_Image</b> object. 105 * @param OH_Drawing_Image_Info Indicates the pointer to an <b>OH_Drawing_Image_Info</b> object. 106 * @since 12 107 * @version 1.0 108 */ 109 void OH_Drawing_ImageGetImageInfo(OH_Drawing_Image*, OH_Drawing_Image_Info*); 110 111 #ifdef __cplusplus 112 } 113 #endif 114 /** @} */ 115 #endif