/* * 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_BRUSH_H #define C_INCLUDE_DRAWING_BRUSH_H /** * @addtogroup Drawing * @{ * * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * * @since 8 * @version 1.0 */ /** * @file drawing_brush.h * * @brief Declares functions related to the brush object in the drawing module. * * @since 8 * @version 1.0 */ #include "drawing_types.h" #ifdef __cplusplus extern "C" { #endif /** * @brief Creates an OH_Drawing_Brush object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @return Returns the pointer to the OH_Drawing_Brush object created. * @since 8 * @version 1.0 */ OH_Drawing_Brush* OH_Drawing_BrushCreate(void); /** * @brief Destroys an OH_Drawing_Brush object and reclaims the memory occupied by the object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. * @since 8 * @version 1.0 */ void OH_Drawing_BrushDestroy(OH_Drawing_Brush*); /** * @brief Checks whether anti-aliasing is enabled for a brush. If anti-aliasing is enabled, * edges will be drawn with partial transparency. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. * @return Returns true if anti-aliasing is enabled; returns false otherwise. * @since 8 * @version 1.0 */ bool OH_Drawing_BrushIsAntiAlias(const OH_Drawing_Brush*); /** * @brief Enables or disables anti-aliasing for a brush. If anti-aliasing is enabled, * edges will be drawn with partial transparency. * * @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 * to enable anti-aliasing, and false means the opposite. * @since 8 * @version 1.0 */ void OH_Drawing_BrushSetAntiAlias(OH_Drawing_Brush*, bool); /** * @brief Obtains the color of a brush. The color is used by the brush to fill in a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. * @return Returns a 32-bit (ARGB) variable that describes the color. * @since 8 * @version 1.0 */ uint32_t OH_Drawing_BrushGetColor(const OH_Drawing_Brush*); /** * @brief Sets the color for a brush. The color will be used by the brush to fill in a shape. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. * @param color Indicates the color to set, which is a 32-bit (ARGB) variable. * @since 8 * @version 1.0 */ void OH_Drawing_BrushSetColor(OH_Drawing_Brush*, uint32_t color); #ifdef __cplusplus } #endif /** @} */ #endif