1 #ifndef DALI_TEXTURE_SET_H
2 #define DALI_TEXTURE_SET_H
5 * Copyright (c) 2018 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 Sets the texture at position "index".
103 * @param[in] index The position in the texture set of the texture
104 * @param[in] texture The texture
106 void SetTexture( size_t index, Texture texture );
109 * @brief Gets the image at position "index".
112 * @param[in] index The position in the texture set of the image
113 * @return A handle to the image at the the specified position
115 Texture GetTexture( size_t index ) const;
118 * @brief Sets the sampler to be used by the image at position "index".
121 * @param[in] index The position in the texture set of the sampler
122 * @param[in] sampler The sampler to use
124 void SetSampler( size_t index, Sampler sampler );
127 * @brief Sets the sampler to be used by the image at position "index".
130 * @param[in] index The position in the texture set of the image
131 * @return A handle to the sampler at the specified position
133 Sampler GetSampler( size_t index ) const;
136 * @brief Gets the number of textures present in the TextureSet.
139 * @return The number of textures in the TextureSet
141 size_t GetTextureCount() const;
146 * @brief The constructor.
147 * @note Not intended for application developers.
149 * @param[in] pointer A pointer to a newly allocated TextureSet
151 explicit DALI_INTERNAL TextureSet( Internal::TextureSet* pointer );
160 #endif // DALI_TEXTURE_SET_H