7eaeeb5fcec44aacb5c3bbfefa3dd0f807f97369
[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) 2016 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/object/handle.h>   // Dali::Handle
23 #include <dali/public-api/actors/sampling.h>
24
25 namespace Dali
26 {
27
28 namespace Internal DALI_INTERNAL
29 {
30 class Sampler;
31 }
32
33 /**
34  * @brief Sampler is a handle to an object that can be used to provide the sampling parameters to sample textures
35  *
36  * @SINCE_1_1.43
37  */
38 class DALI_IMPORT_API Sampler : public BaseHandle
39 {
40 public:
41
42   /**
43    * @brief Creates a new Sampler object
44    *
45    * @SINCE_1_1.43
46    * @return A handle to the Sampler
47    */
48   static Sampler New();
49
50   /**
51    * @brief Default constructor, creates an empty handle
52    *
53    * @SINCE_1_1.43
54    */
55   Sampler();
56
57   /**
58    * @brief Destructor
59    *
60    * @SINCE_1_1.43
61    */
62   ~Sampler();
63
64   /**
65    * @brief Copy constructor, creates a new handle to the same object
66    *
67    * @SINCE_1_1.43
68    * @param[in] handle Handle to an object
69    */
70   Sampler( const Sampler& handle );
71
72   /**
73    * @brief Downcast to a sampler handle.
74    * If not the returned handle is left uninitialized.
75    *
76    * @SINCE_1_1.43
77    * @param[in] handle Handle to an object
78    * @return Handle or an uninitialized handle
79    */
80   static Sampler DownCast( BaseHandle handle );
81
82   /**
83    * @brief Assignment operator, changes this handle to point at the same object
84    *
85    * @SINCE_1_1.43
86    * @param[in] handle Handle to an object
87    * @return Reference to the assigned object
88    */
89   Sampler& operator=( const Sampler& handle );
90
91
92   /**
93    * @brief Set the filter modes for this sampler
94    * Calling this function sets the properties MINIFICATION_FILTER and MAGNIFICATION_FILTER.
95    *
96    * @SINCE_1_1.43
97    * @param[in] minFilter The minification filter that will be used
98    * @param[in] magFilter The magnification filter that will be used
99    */
100   void SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter );
101
102   /**
103    * @brief Set the wrap modes for this sampler
104    *
105    * @SINCE_1_1.43
106    * @param[in] uWrap Wrap mode for u coordinates
107    * @param[in] vWrap Wrap mode for v coordinates
108    */
109   void SetWrapMode( WrapMode::Type uWrap, WrapMode::Type vWrap );
110
111   /**
112    * @brief Set the wrap modes for this sampler
113    *
114    * @SINCE_1_1.43
115    * @param[in] rWrap Wrap mode for the z direction
116    * @param[in] sWrap Wrap mode for the x direction
117    * @param[in] tWrap Wrap mode for the y direction
118    */
119   void SetWrapMode( WrapMode::Type rWrap, WrapMode::Type sWrap, WrapMode::Type tWrap );
120
121 public:
122
123   /**
124    * @brief The constructor
125    * @note  Not intended for application developers.
126    * @SINCE_1_1.43
127    * @param[in] pointer A pointer to a newly allocated Sampler
128    */
129   explicit DALI_INTERNAL Sampler( Internal::Sampler* pointer );
130 };
131
132 } //namespace Dali
133
134 #endif // DALI_SAMPLER_H