17777dab0Sopenharmony_ci/*
27777dab0Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
37777dab0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
47777dab0Sopenharmony_ci * you may not use this file except in compliance with the License.
57777dab0Sopenharmony_ci * You may obtain a copy of the License at
67777dab0Sopenharmony_ci *
77777dab0Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
87777dab0Sopenharmony_ci *
97777dab0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
107777dab0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
117777dab0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
127777dab0Sopenharmony_ci * See the License for the specific language governing permissions and
137777dab0Sopenharmony_ci * limitations under the License.
147777dab0Sopenharmony_ci */
157777dab0Sopenharmony_ci
167777dab0Sopenharmony_ci#ifndef C_INCLUDE_DRAWING_POINT_H
177777dab0Sopenharmony_ci#define C_INCLUDE_DRAWING_POINT_H
187777dab0Sopenharmony_ci
197777dab0Sopenharmony_ci/**
207777dab0Sopenharmony_ci * @addtogroup Drawing
217777dab0Sopenharmony_ci * @{
227777dab0Sopenharmony_ci *
237777dab0Sopenharmony_ci * @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
247777dab0Sopenharmony_ci *
257777dab0Sopenharmony_ci * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
267777dab0Sopenharmony_ci *
277777dab0Sopenharmony_ci * @since 11
287777dab0Sopenharmony_ci * @version 1.0
297777dab0Sopenharmony_ci */
307777dab0Sopenharmony_ci
317777dab0Sopenharmony_ci/**
327777dab0Sopenharmony_ci * @file drawing_point.h
337777dab0Sopenharmony_ci *
347777dab0Sopenharmony_ci * @brief Declares functions related to the <b>point</b> object in the drawing module.
357777dab0Sopenharmony_ci *
367777dab0Sopenharmony_ci * @kit ArkGraphics2D
377777dab0Sopenharmony_ci * @library libnative_drawing.so
387777dab0Sopenharmony_ci * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
397777dab0Sopenharmony_ci * @since 11
407777dab0Sopenharmony_ci * @version 1.0
417777dab0Sopenharmony_ci */
427777dab0Sopenharmony_ci
437777dab0Sopenharmony_ci#include "drawing_error_code.h"
447777dab0Sopenharmony_ci#include "drawing_types.h"
457777dab0Sopenharmony_ci
467777dab0Sopenharmony_ci#ifdef __cplusplus
477777dab0Sopenharmony_ciextern "C" {
487777dab0Sopenharmony_ci#endif
497777dab0Sopenharmony_ci
507777dab0Sopenharmony_ci/**
517777dab0Sopenharmony_ci * @brief Creates an <b>OH_Drawing_Point</b> object.
527777dab0Sopenharmony_ci *
537777dab0Sopenharmony_ci * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
547777dab0Sopenharmony_ci * @param x Indicates the x-axis coordinates of the point.
557777dab0Sopenharmony_ci * @param y Indicates the y-axis coordinates of the point.
567777dab0Sopenharmony_ci * @return Returns the pointer to the <b>OH_Drawing_Point</b> object created.
577777dab0Sopenharmony_ci * @since 11
587777dab0Sopenharmony_ci * @version 1.0
597777dab0Sopenharmony_ci */
607777dab0Sopenharmony_ciOH_Drawing_Point* OH_Drawing_PointCreate(float x, float y);
617777dab0Sopenharmony_ci
627777dab0Sopenharmony_ci/**
637777dab0Sopenharmony_ci * @brief Gets the x-axis coordinate of the point.
647777dab0Sopenharmony_ci *
657777dab0Sopenharmony_ci * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
667777dab0Sopenharmony_ci * @param point Indicates the pointer to an <b>OH_Drawing_Point</b> object.
677777dab0Sopenharmony_ci * @param x Indicates the x-axis coordinate of the point.
687777dab0Sopenharmony_ci * @return Returns the error code.
697777dab0Sopenharmony_ci *         Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
707777dab0Sopenharmony_ci *         Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if point or x is nullptr.
717777dab0Sopenharmony_ci * @since 12
727777dab0Sopenharmony_ci * @version 1.0
737777dab0Sopenharmony_ci */
747777dab0Sopenharmony_ciOH_Drawing_ErrorCode OH_Drawing_PointGetX(const OH_Drawing_Point* point, float* x);
757777dab0Sopenharmony_ci
767777dab0Sopenharmony_ci/**
777777dab0Sopenharmony_ci * @brief Gets the y-axis coordinate of the point.
787777dab0Sopenharmony_ci *
797777dab0Sopenharmony_ci * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
807777dab0Sopenharmony_ci * @param point Indicates the pointer to an <b>OH_Drawing_Point</b> object.
817777dab0Sopenharmony_ci * @param y Indicates the y-axis coordinate of the point.
827777dab0Sopenharmony_ci * @return Returns the error code.
837777dab0Sopenharmony_ci *         Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
847777dab0Sopenharmony_ci *         Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if point or y is nullptr.
857777dab0Sopenharmony_ci * @since 12
867777dab0Sopenharmony_ci * @version 1.0
877777dab0Sopenharmony_ci */
887777dab0Sopenharmony_ciOH_Drawing_ErrorCode OH_Drawing_PointGetY(const OH_Drawing_Point* point, float* y);
897777dab0Sopenharmony_ci
907777dab0Sopenharmony_ci/**
917777dab0Sopenharmony_ci * @brief Sets the x-axis and y-axis coordinates of the point.
927777dab0Sopenharmony_ci *
937777dab0Sopenharmony_ci * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
947777dab0Sopenharmony_ci * @param point Indicates the pointer to an <b>OH_Drawing_Point</b> object.
957777dab0Sopenharmony_ci * @param x Indicates the x-axis coordinate of the point.
967777dab0Sopenharmony_ci * @param y Indicates the y-axis coordinate of the point.
977777dab0Sopenharmony_ci * @return Returns the error code.
987777dab0Sopenharmony_ci *         Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
997777dab0Sopenharmony_ci *         Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if point is nullptr.
1007777dab0Sopenharmony_ci * @since 12
1017777dab0Sopenharmony_ci * @version 1.0
1027777dab0Sopenharmony_ci */
1037777dab0Sopenharmony_ciOH_Drawing_ErrorCode OH_Drawing_PointSet(OH_Drawing_Point* point, float x, float y);
1047777dab0Sopenharmony_ci
1057777dab0Sopenharmony_ci/**
1067777dab0Sopenharmony_ci * @brief Destroys an <b>OH_Drawing_Point</b> object and reclaims the memory occupied by the object.
1077777dab0Sopenharmony_ci *
1087777dab0Sopenharmony_ci * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
1097777dab0Sopenharmony_ci * @param OH_Drawing_Point Indicates the pointer to an <b>OH_Drawing_Point</b> object.
1107777dab0Sopenharmony_ci * @since 11
1117777dab0Sopenharmony_ci * @version 1.0
1127777dab0Sopenharmony_ci */
1137777dab0Sopenharmony_civoid OH_Drawing_PointDestroy(OH_Drawing_Point*);
1147777dab0Sopenharmony_ci
1157777dab0Sopenharmony_ci#ifdef __cplusplus
1167777dab0Sopenharmony_ci}
1177777dab0Sopenharmony_ci#endif
1187777dab0Sopenharmony_ci/** @} */
1197777dab0Sopenharmony_ci#endif
120