[3.0] Update doxygen comments
[platform/core/uifw/dali-core.git] / dali / public-api / rendering / texture-set.h
1 #ifndef DALI_TEXTURE_SET_H
2 #define DALI_TEXTURE_SET_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 // EXTERNAL INCLUDES
22 #include <cstddef> // std::size_t
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/object/handle.h>     // Dali::Handle
26 #include <dali/public-api/rendering/sampler.h> // Dali::Sampler
27 #include <dali/public-api/rendering/shader.h>  // Dali::Shader
28 #include <dali/public-api/rendering/texture.h> // Dali::Texture
29
30 namespace Dali
31 {
32
33 namespace Internal DALI_INTERNAL
34 {
35 class TextureSet;
36 }
37
38 /**
39  * @brief TextureSet is a handle to an object that specifies the set of images used as textures by a renderer.
40  * The images have to be ordered in the same order they are declared in the shader.
41  * @SINCE_1_1.43
42  */
43 class DALI_IMPORT_API TextureSet : public BaseHandle
44 {
45 public:
46
47   /**
48    * @brief Creates a new TextureSet object.
49    *
50    * @SINCE_1_1.43
51    * @return A handle to a newly allocated TextureSet
52    */
53   static TextureSet New();
54
55   /**
56    * @brief Default constructor, creates an empty handle.
57    *
58    * @SINCE_1_1.43
59    */
60   TextureSet();
61
62   /**
63    * @brief Destructor.
64    *
65    * @SINCE_1_1.43
66    */
67   ~TextureSet();
68
69   /**
70    * @brief Copy constructor, creates a new handle to the same object.
71    *
72    * @SINCE_1_1.43
73    * @param[in] handle Handle to an object
74    */
75   TextureSet( const TextureSet& handle );
76
77   /**
78    * @brief Downcasts to a TextureSet handle.
79    * If handle is not a TextureSet, the returned handle is left uninitialized.
80    * @SINCE_1_1.43
81    * @param[in] handle Handle to an object
82    * @return TextureSet handle or an uninitialized handle
83    */
84   static TextureSet DownCast( BaseHandle handle );
85
86   /**
87    * @brief Assignment operator, changes this handle to point at the same object.
88    *
89    * @SINCE_1_1.43
90    * @param[in] handle Handle to an object
91    * @return A reference to this
92    */
93   TextureSet& operator=( const TextureSet& handle );
94
95   /**
96    * @brief Sets the texture at position "index".
97    *
98    * @SINCE_1_1.43
99    * @param[in] index The position in the texture set of the texture
100    * @param[in] texture The texture
101    */
102   void SetTexture( size_t index, Texture texture );
103
104   /**
105    * @brief Gets the image at position "index".
106    *
107    * @SINCE_1_1.43
108    * @param[in] index The position in the texture set of the image
109    * @return A handle to the image at the the specified position
110    */
111   Texture GetTexture( size_t index ) const;
112
113   /**
114    * @brief Sets the sampler to be used by the image at position "index".
115    *
116    * @SINCE_1_1.43
117    * @param[in] index The position in the texture set of the sampler
118    * @param[in] sampler The sampler to use
119    */
120   void SetSampler( size_t index, Sampler sampler );
121
122   /**
123    * @brief Sets the sampler to be used by the image at position "index".
124    *
125    * @SINCE_1_1.43
126    * @param[in] index The position in the texture set of the image
127    * @return A handle to the sampler at the specified position
128    */
129   Sampler GetSampler( size_t index ) const;
130
131   /**
132    * @brief Gets the number of textures present in the TextureSet.
133    *
134    * @SINCE_1_1.43
135    * @return The number of textures in the TextureSet
136    */
137   size_t GetTextureCount() const;
138
139 public:
140
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 TextureSet
146    */
147   explicit DALI_INTERNAL TextureSet( Internal::TextureSet* pointer );
148 };
149
150 } //namespace Dali
151
152
153 #endif // DALI_TEXTURE_SET_H