1 #ifndef DALI_GRAPHICS_SAMPLER_CREATE_INFO_H
2 #define DALI_GRAPHICS_SAMPLER_CREATE_INFO_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
25 #include "graphics-sampler.h"
26 #include "graphics-types.h"
33 * @brief Interface class for SamplerCreateInfo types in the graphics API.
35 struct SamplerCreateInfo
38 * @brief Sets pointer to the extension
40 * The pointer to the extension must be set either to nullptr
41 * or to the valid structure. The structures may create
42 * a chain. The last structure in a chain must point at
45 * @param[in] value pointer to the valid extension structure
46 * @return reference to this structure
48 auto& SetNextExtension(ExtensionCreateInfo* value)
50 nextExtension = value;
55 * @brief Sets address mode U
57 * @param[in] value Address mode
58 * @return reference to this structure
60 auto& SetAddressModeU(SamplerAddressMode value)
67 * @brief Sets address mode V
69 * @param[in] value Address mode
70 * @return reference to this structure
72 auto& SetAddressModeV(SamplerAddressMode value)
79 * @brief Sets address mode W
81 * @param[in] value Address mode
82 * @return reference to this structure
84 auto& SetAddressModeW(SamplerAddressMode value)
91 * @brief Sets minification filter
93 * @param[in] value filter mode
94 * @return reference to this structure
96 auto& SetMinFilter(SamplerFilter value)
103 * @brief Sets magnification filter
105 * @param[in] value filter mode
106 * @return reference to this structure
108 auto& SetMagFilter(SamplerFilter value)
115 * @brief Sets mipmap mode
117 * @param[in] value mipmap mode
118 * @return reference to this structure
120 auto& SetMipMapMode(SamplerMipmapMode value)
127 * @brief Enables/disables anisotropy
129 * @param[in] value true to enable, false otherwise
130 * @return reference to this structure
132 auto& SetAnisotropyEnable(bool value)
134 anisotropyEnable = value;
139 * @brief Sets maximum anisotropy level
141 * @param[in] value maximum anisotropy level
142 * @return reference to this structure
144 auto& SetMaxAnisotropy(float value)
146 maxAnisotropy = value;
151 * @brief Sets minimum LOD
153 * @param[in] value LOD value
154 * @return reference to this structure
156 auto& SetMinLod(float value)
163 * @brief Sets maximum LOD
165 * @param[in] value LOD value
166 * @return reference to this structure
168 auto& SetMaxLod(float value)
175 * @brief Sets using unnormalized coordinates
177 * @param[in] value true to use unnormalized coordinates
178 * @return reference to this structure
180 auto& SetUnnormalizeCoordinates(bool value)
182 unnormalizeCoordinates = value;
187 * @brief Enables sample compare operations
189 * @param[in] value true to enable
190 * @return reference to this structure
192 auto& SetCompareEnable(bool value)
194 compareEnable = value;
199 * @brief Sets allocation callbacks which will be used when object is created
202 * @param[in] value Valid reference to AllocationCallbacksStructure
203 * @return reference to this structure
205 auto& SetAllocationCallbacks(const AllocationCallbacks& value)
207 allocationCallbacks = &value;
211 GraphicsStructureType type{GraphicsStructureType::SAMPLER_CREATE_INFO_STRUCT};
212 ExtensionCreateInfo* nextExtension{nullptr};
214 SamplerAddressMode addressModeU{};
215 SamplerAddressMode addressModeV{};
216 SamplerAddressMode addressModeW{};
217 SamplerFilter minFilter{};
218 SamplerFilter magFilter{};
219 SamplerMipmapMode mipMapMode{};
220 bool anisotropyEnable{false};
221 float maxAnisotropy{0.0f};
224 bool unnormalizeCoordinates{false};
225 bool compareEnable{false};
226 CompareOp compareOp{};
228 const AllocationCallbacks* allocationCallbacks{nullptr};
231 } // namespace Graphics
234 #endif // DALI_GRAPHICS_SAMPLER_CREATE_INFO