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_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 * @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 Enumerates storage filter mode. 48 * 49 * @since 12 50 * @version 1.0 51 */ 52 typedef enum { 53 /** single sample point (nearest neighbor) */ 54 FILTER_MODE_NEAREST, 55 /** interporate between 2x2 sample points (bilinear interpolation) */ 56 FILTER_MODE_LINEAR, 57 } OH_Drawing_FilterMode; 58 59 /** 60 * @brief Enumerates storage formats mipmap mode. 61 * 62 * @since 12 63 * @version 1.0 64 */ 65 typedef enum { 66 /** ignore mipmap levels, sample from the "base" */ 67 MIPMAP_MODE_NONE, 68 /** sample from the nearest level */ 69 MIPMAP_MODE_NEAREST, 70 /** interpolate between the two nearest levels */ 71 MIPMAP_MODE_LINEAR, 72 } OH_Drawing_MipmapMode; 73 74 /** 75 * @brief Creates an <b>OH_Drawing_SamplingOptions</b> object. 76 * 77 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 78 * @param OH_Drawing_FilterMode sampling filter mode. 79 * @param OH_Drawing_MipmapMode sampling mipmap mode.. 80 * @return Returns the pointer to the <b>OH_Drawing_SamplingOptions</b> object created. 81 * @since 12 82 * @version 1.0 83 */ 84 OH_Drawing_SamplingOptions* OH_Drawing_SamplingOptionsCreate(OH_Drawing_FilterMode, OH_Drawing_MipmapMode); 85 86 /** 87 * @brief Destroys an <b>OH_Drawing_SamplingOptions</b> object and reclaims the memory occupied by the object. 88 * 89 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 90 * @param OH_Drawing_SamplingOptions Indicates the pointer to an <b>OH_Drawing_SamplingOptions</b> object. 91 * @since 12 92 * @version 1.0 93 */ 94 void OH_Drawing_SamplingOptionsDestroy(OH_Drawing_SamplingOptions*); 95 96 #ifdef __cplusplus 97 } 98 #endif 99 /** @} */ 100 #endif 101