Get world scale more faster
[platform/core/uifw/dali-core.git] / dali / public-api / rendering / sampler.h
1 #ifndef DALI_SAMPLER_H
2 #define DALI_SAMPLER_H
3
4 /*
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/actors/sampling.h>
23 #include <dali/public-api/object/handle.h> // Dali::Handle
24
25 namespace Dali
26 {
27 /**
28  * @addtogroup dali_core_rendering_effects
29  * @{
30  */
31
32 namespace Internal DALI_INTERNAL
33 {
34 class Sampler;
35 }
36
37 /**
38  * @brief Sampler is a handle to an object that can be used to provide the sampling parameters to sample textures.
39  *
40  * @SINCE_1_1.43
41  */
42 class DALI_CORE_API Sampler : public BaseHandle
43 {
44 public:
45   /**
46    * @brief Creates a new Sampler object.
47    *
48    * @SINCE_1_1.43
49    * @return A handle to the Sampler
50    */
51   static Sampler New();
52
53   /**
54    * @brief Default constructor, creates an empty handle.
55    *
56    * @SINCE_1_1.43
57    */
58   Sampler();
59
60   /**
61    * @brief Destructor.
62    *
63    * @SINCE_1_1.43
64    */
65   ~Sampler();
66
67   /**
68    * @brief Copy constructor, creates a new handle to the same object.
69    *
70    * @SINCE_1_1.43
71    * @param[in] handle Handle to an object
72    */
73   Sampler(const Sampler& handle);
74
75   /**
76    * @brief Downcasts to a sampler handle.
77    * If not, the returned handle is left uninitialized.
78    *
79    * @SINCE_1_1.43
80    * @param[in] handle Handle to an object
81    * @return Handle or an uninitialized handle
82    */
83   static Sampler DownCast(BaseHandle handle);
84
85   /**
86    * @brief Assignment operator, changes this handle to point at the same object.
87    *
88    * @SINCE_1_1.43
89    * @param[in] handle Handle to an object
90    * @return Reference to the assigned object
91    */
92   Sampler& operator=(const Sampler& handle);
93
94   /**
95    * @brief Move constructor.
96    *
97    * @SINCE_1_9.22
98    * @param[in] rhs A reference to the moved handle
99    */
100   Sampler(Sampler&& rhs);
101
102   /**
103    * @brief Move assignment operator.
104    *
105    * @SINCE_1_9.22
106    * @param[in] rhs A reference to the moved handle
107    * @return A reference to this handle
108    */
109   Sampler& operator=(Sampler&& rhs);
110
111   /**
112    * @brief Sets the filter modes for this sampler.
113    * Calling this function sets the properties MINIFICATION_FILTER and MAGNIFICATION_FILTER.
114    *
115    * @SINCE_1_1.43
116    * @param[in] minFilter The minification filter that will be used
117    * @param[in] magFilter The magnification filter that will be used
118    */
119   void SetFilterMode(FilterMode::Type minFilter, FilterMode::Type magFilter);
120
121   /**
122    * @brief Sets the wrap modes for this sampler.
123    *
124    * @SINCE_1_1.43
125    * @param[in] uWrap Wrap mode for u coordinates
126    * @param[in] vWrap Wrap mode for v coordinates
127    */
128   void SetWrapMode(WrapMode::Type uWrap, WrapMode::Type vWrap);
129
130   /**
131    * @brief Sets the wrap modes for this sampler.
132    *
133    * @SINCE_1_1.43
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
137    */
138   void SetWrapMode(WrapMode::Type rWrap, WrapMode::Type sWrap, WrapMode::Type tWrap);
139
140 public:
141   /**
142    * @brief The constructor.
143    * @note  Not intended for application developers.
144    * @SINCE_1_1.43
145    * @param[in] pointer A pointer to a newly allocated Sampler
146    */
147   explicit DALI_INTERNAL Sampler(Internal::Sampler* pointer);
148 };
149
150 /**
151  * @}
152  */
153 } //namespace Dali
154
155 #endif // DALI_SAMPLER_H