[dali_1.1.39] Merge branch 'devel/master'
[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   static Sampler New();
44
45   /**
46    * @brief Default constructor, creates an empty handle
47    */
48   Sampler();
49
50   /**
51    * @brief Destructor
52    */
53   ~Sampler();
54
55   /**
56    * @brief Copy constructor, creates a new handle to the same object
57    *
58    * @param[in] handle Handle to an object
59    */
60   Sampler( const Sampler& handle );
61
62   /**
63    * @brief Downcast to a sampler handle.
64    *
65    * If not the returned handle is left uninitialized.
66    * @param[in] handle to An object
67    * @return handle or an uninitialized handle
68    */
69   static Sampler DownCast( BaseHandle handle );
70
71   /**
72    * @brief Assignment operator, changes this handle to point at the same object
73    *
74    * @param[in] handle Handle to an object
75    * @return Reference to the assigned object
76    */
77   Sampler& operator=( const Sampler& handle );
78
79
80   /**
81    * @brief Set the filter modes for this sampler
82    *
83    * Calling this function sets the properties MINIFICATION_FILTER
84    * and MAGNIFICATION_FILTER
85    *
86    * @param[in] minFilter The minification filter that will be used
87    * @param[in] magFilter The magnification filter that will be used
88    */
89   void SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter );
90
91   /**
92    * @brief Set the wrap modes for this sampler
93    *
94    * param[in] uWrap Wrap mode for u coordinates
95    * param[in] vWrap Wrap mode for v coordinates
96    */
97   void SetWrapMode( WrapMode::Type uWrap, WrapMode::Type vWrap );
98
99   /**
100    * @brief Set the wrap modes for this sampler
101    *
102    * param[in] rWrap Wrap mode in the z direction
103    * param[in] sWrap Wrap mode for x direction
104    * param[in] tWrap Wrap mode for y direction
105    */
106   void SetWrapMode( WrapMode::Type rWrap, WrapMode::Type sWrap, WrapMode::Type tWrap );
107
108 public:
109   /**
110    * @brief The constructor
111    *
112    * @param [in] pointer A pointer to a newly allocated Sampler
113    */
114   explicit DALI_INTERNAL Sampler( Internal::Sampler* pointer );
115 };
116
117 } //namespace Dali
118
119 #endif // DALI_SAMPLER_H