1 #ifndef DALI_TEXTURE_SET_H
2 #define DALI_TEXTURE_SET_H
5 * Copyright (c) 2016 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/images/image.h> // Dali::Image
26 #include <dali/public-api/object/handle.h> // Dali::Handle
27 #include <dali/devel-api/rendering/sampler.h> // Dali::Sampler
28 #include <dali/devel-api/rendering/texture.h> // Dali::Texture
29 #include <dali/devel-api/rendering/shader.h> // Dali::Shader
34 namespace Internal DALI_INTERNAL
40 * @brief TextureSet is a handle to an object that specifies the set of images used as textures by a renderer
41 * The images have to be ordered in the same order they are declared in the shader
43 class DALI_IMPORT_API TextureSet : public BaseHandle
48 * @brief Creates a new TextureSet object
50 * @return A handle to a newly allocated TextureSet
52 static TextureSet New();
55 * @brief Default constructor, creates an empty handle
65 * @brief Copy constructor, creates a new handle to the same object
67 * @param[in] handle Handle to an object
69 TextureSet( const TextureSet& handle );
72 * @brief Downcast to a TextureSet handle.
74 * If handle is not a TextureSet, the returned handle is left uninitialized.
75 * @param[in] handle to an object
76 * @return TextureSet handle or an uninitialized handle
78 static TextureSet DownCast( BaseHandle handle );
81 * @brief Assignment operator, changes this handle to point at the same object
83 * @param[in] handle Handle to an object
85 TextureSet& operator=( const TextureSet& handle );
88 * @brief Set the image at position "index"
89 * @param[in] index The position in the texture set of the image
90 * @param[in] image The image
92 void SetImage( size_t index, Image image );
95 * @brief Set the texture at position "index"
96 * @param[in] index The position in the texture set of the texture
97 * @param[in] texture The texture
99 void SetTexture( size_t index, Texture texture );
102 * @brief Get the image at position "index"
103 * @param[in] index The position in the texture set of the image
104 * @return A handle to the image at the the specified position
106 Image GetImage( size_t index ) const;
109 * @brief Get the image at position "index"
110 * @param[in] index The position in the texture set of the image
111 * @return A handle to the image at the the specified position
113 Texture GetTexture( size_t index ) const;
116 * @brief Set the sampler to be used by the image at position "index"
117 * @param[in] index The position in the texture set of the sampler
118 * @param[in] sampler The sampler to use
120 void SetSampler( size_t index, Sampler sampler );
123 * @brief Set the sampler to be used by the image at position "index"
124 * @param[in] index The position in the texture set of the image
125 * @return A handle to the sampler at the specified position
127 Sampler GetSampler( size_t index ) const;
130 * @brief Get the number of textures present in the TextureSet
132 * @return The number of textures in the TextureSet
134 size_t GetTextureCount() const;
138 * @brief The constructor
140 * @param [in] pointer A pointer to a newly allocated TextureSet
142 explicit DALI_INTERNAL TextureSet( Internal::TextureSet* pointer );
149 #endif // DALI_TEXTURE_SET_H