Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-core.git] / dali / devel-api / rendering / sampler.h
1 #ifndef DALI_SAMPLER_H
2 #define DALI_SAMPLER_H
3
4 /*
5  * Copyright (c) 2015 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 class DALI_IMPORT_API Sampler : public BaseHandle
37 {
38 public:
39
40   /**
41    * @brief Creates a new Sampler object
42    *
43    * @param[in] image Image used by this sampler
44    * @param[in] uniformName String with the name of the uniform
45    */
46   static Sampler New();
47
48   /**
49    * @brief Default constructor, creates an empty handle
50    */
51   Sampler();
52
53   /**
54    * @brief Destructor
55    */
56   ~Sampler();
57
58   /**
59    * @brief Copy constructor, creates a new handle to the same object
60    *
61    * @param[in] handle Handle to an object
62    */
63   Sampler( const Sampler& handle );
64
65   /**
66    * @brief Downcast to a sampler handle.
67    *
68    * If not the returned handle is left uninitialized.
69    * @param[in] handle to An object
70    * @return handle or an uninitialized handle
71    */
72   static Sampler DownCast( BaseHandle handle );
73
74   /**
75    * @brief Assignment operator, changes this handle to point at the same object
76    *
77    * @param[in] handle Handle to an object
78    * @return Reference to the assigned object
79    */
80   Sampler& operator=( const Sampler& handle );
81
82
83   /**
84    * @brief Set the filter modes for this sampler
85    *
86    * Calling this function sets the properties MINIFICATION_FILTER
87    * and MAGNIFICATION_FILTER
88    *
89    * @param[in] minFilter The minification filter that will be used
90    * @param[in] magFilter The magnification filter that will be used
91    */
92   void SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter );
93
94   /**
95    * @brief Set the wrap modes for this sampler
96    *
97    * Calling this function sets the properties U_WRAP and V_WRAP
98    *
99    * param[in] uWrap Wrap mode for u coordinates
100    * param[in] vWrap Wrap mode for v coordinates
101    */
102   void SetWrapMode( WrapMode::Type uWrap, WrapMode::Type vWrap );
103
104 public:
105   /**
106    * @brief The constructor
107    *
108    * @param [in] pointer A pointer to a newly allocated Sampler
109    */
110   explicit DALI_INTERNAL Sampler( Internal::Sampler* pointer );
111 };
112
113 } //namespace Dali
114
115 #endif // DALI_SAMPLER_H