1 #ifndef DALI_TEXTURE_SET_H
2 #define DALI_TEXTURE_SET_H
5 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <cstddef> // std::size_t
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
33 * @addtogroup dali_core_rendering_effects
37 namespace Internal DALI_INTERNAL
43 * @brief TextureSet is a handle to an object that specifies the set of images used as textures by a renderer.
44 * The images have to be ordered in the same order they are declared in the shader.
47 class DALI_CORE_API TextureSet : public BaseHandle
52 * @brief Creates a new TextureSet object.
55 * @return A handle to a newly allocated TextureSet
57 static TextureSet New();
60 * @brief Default constructor, creates an empty handle.
74 * @brief Copy constructor, creates a new handle to the same object.
77 * @param[in] handle Handle to an object
79 TextureSet( const TextureSet& handle );
82 * @brief Downcasts to a TextureSet handle.
83 * If handle is not a TextureSet, the returned handle is left uninitialized.
85 * @param[in] handle Handle to an object
86 * @return TextureSet handle or an uninitialized handle
88 static TextureSet DownCast( BaseHandle handle );
91 * @brief Assignment operator, changes this handle to point at the same object.
94 * @param[in] handle Handle to an object
95 * @return A reference to this
97 TextureSet& operator=( const TextureSet& handle );
100 * @brief Move constructor.
103 * @param[in] rhs A reference to the moved handle
105 TextureSet( TextureSet&& rhs );
108 * @brief Move assignment operator.
111 * @param[in] rhs A reference to the moved handle
112 * @return A reference to this handle
114 TextureSet& operator=( TextureSet&& rhs );
117 * @brief Sets the texture at position "index".
120 * @param[in] index The position in the texture set of the texture
121 * @param[in] texture The texture
123 void SetTexture( size_t index, Texture texture );
126 * @brief Gets the image at position "index".
129 * @param[in] index The position in the texture set of the image
130 * @return A handle to the image at the the specified position
132 Texture GetTexture( size_t index ) const;
135 * @brief Sets the sampler to be used by the image at position "index".
138 * @param[in] index The position in the texture set of the sampler
139 * @param[in] sampler The sampler to use
141 void SetSampler( size_t index, Sampler sampler );
144 * @brief Sets the sampler to be used by the image at position "index".
147 * @param[in] index The position in the texture set of the image
148 * @return A handle to the sampler at the specified position
150 Sampler GetSampler( size_t index ) const;
153 * @brief Gets the number of textures present in the TextureSet.
156 * @return The number of textures in the TextureSet
158 size_t GetTextureCount() const;
163 * @brief The constructor.
164 * @note Not intended for application developers.
166 * @param[in] pointer A pointer to a newly allocated TextureSet
168 explicit DALI_INTERNAL TextureSet( Internal::TextureSet* pointer );
177 #endif // DALI_TEXTURE_SET_H