• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023-2024 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_SAMPLING_OPTIONS_H
17 #define C_INCLUDE_DRAWING_SAMPLING_OPTIONS_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_sampling_options.h
33  *
34  * @brief Declares functions related to the <b>sampling options</b> object in the drawing module.
35  *
36  * @kit ArkGraphics2D
37  * @library libnative_drawing.so
38  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
39  * @since 12
40  * @version 1.0
41  */
42 
43 #include "drawing_types.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /**
50  * @brief Enumerates storage filter mode.
51  *
52  * @since 12
53  * @version 1.0
54  */
55 typedef enum {
56     /** single sample point (nearest neighbor) */
57     FILTER_MODE_NEAREST,
58     /** interporate between 2x2 sample points (bilinear interpolation) */
59     FILTER_MODE_LINEAR,
60 } OH_Drawing_FilterMode;
61 
62 /**
63  * @brief Enumerates storage formats mipmap mode.
64  *
65  * @since 12
66  * @version 1.0
67  */
68 typedef enum {
69     /** ignore mipmap levels, sample from the "base" */
70     MIPMAP_MODE_NONE,
71     /** sample from the nearest level */
72     MIPMAP_MODE_NEAREST,
73     /** interpolate between the two nearest levels */
74     MIPMAP_MODE_LINEAR,
75 } OH_Drawing_MipmapMode;
76 
77 /**
78  * @brief Creates an <b>OH_Drawing_SamplingOptions</b> object.
79  *
80  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
81  * @param OH_Drawing_FilterMode sampling filter mode.
82  * @param OH_Drawing_MipmapMode sampling mipmap mode..
83  * @return Returns the pointer to the <b>OH_Drawing_SamplingOptions</b> object created.
84  * @since 12
85  * @version 1.0
86  */
87 OH_Drawing_SamplingOptions* OH_Drawing_SamplingOptionsCreate(OH_Drawing_FilterMode, OH_Drawing_MipmapMode);
88 
89 /**
90  * @brief Destroys an <b>OH_Drawing_SamplingOptions</b> object and reclaims the memory occupied by the object.
91  *
92  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
93  * @param OH_Drawing_SamplingOptions Indicates the pointer to an <b>OH_Drawing_SamplingOptions</b> object.
94  * @since 12
95  * @version 1.0
96  */
97 void OH_Drawing_SamplingOptionsDestroy(OH_Drawing_SamplingOptions*);
98 
99 #ifdef __cplusplus
100 }
101 #endif
102 /** @} */
103 #endif
104