5 * Copyright (c) 2020 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.
22 #include <dali/public-api/actors/sampling.h>
23 #include <dali/public-api/object/handle.h> // Dali::Handle
28 * @addtogroup dali_core_rendering_effects
32 namespace Internal DALI_INTERNAL
38 * @brief Sampler is a handle to an object that can be used to provide the sampling parameters to sample textures.
42 class DALI_CORE_API Sampler : public BaseHandle
46 * @brief Creates a new Sampler object.
49 * @return A handle to the Sampler
54 * @brief Default constructor, creates an empty handle.
68 * @brief Copy constructor, creates a new handle to the same object.
71 * @param[in] handle Handle to an object
73 Sampler(const Sampler& handle);
76 * @brief Downcasts to a sampler handle.
77 * If not, the returned handle is left uninitialized.
80 * @param[in] handle Handle to an object
81 * @return Handle or an uninitialized handle
83 static Sampler DownCast(BaseHandle handle);
86 * @brief Assignment operator, changes this handle to point at the same object.
89 * @param[in] handle Handle to an object
90 * @return Reference to the assigned object
92 Sampler& operator=(const Sampler& handle);
95 * @brief Move constructor.
98 * @param[in] rhs A reference to the moved handle
100 Sampler(Sampler&& rhs) noexcept;
103 * @brief Move assignment operator.
106 * @param[in] rhs A reference to the moved handle
107 * @return A reference to this handle
109 Sampler& operator=(Sampler&& rhs) noexcept;
112 * @brief Sets the filter modes for this sampler.
113 * Calling this function sets the properties MINIFICATION_FILTER and MAGNIFICATION_FILTER.
116 * @param[in] minFilter The minification filter that will be used
117 * @param[in] magFilter The magnification filter that will be used
119 void SetFilterMode(FilterMode::Type minFilter, FilterMode::Type magFilter);
122 * @brief Sets the wrap modes for this sampler.
125 * @param[in] uWrap Wrap mode for u coordinates
126 * @param[in] vWrap Wrap mode for v coordinates
128 void SetWrapMode(WrapMode::Type uWrap, WrapMode::Type vWrap);
131 * @brief Sets the wrap modes for this sampler.
134 * @param[in] rWrap Wrap mode for the z direction
135 * @param[in] sWrap Wrap mode for the x direction
136 * @param[in] tWrap Wrap mode for the y direction
138 void SetWrapMode(WrapMode::Type rWrap, WrapMode::Type sWrap, WrapMode::Type tWrap);
142 * @brief The constructor.
143 * @note Not intended for application developers.
145 * @param[in] pointer A pointer to a newly allocated Sampler
147 explicit DALI_INTERNAL Sampler(Internal::Sampler* pointer);
155 #endif // DALI_SAMPLER_H