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/shader.h> // Dali::Shader
33 namespace Internal DALI_INTERNAL
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
42 class DALI_IMPORT_API TextureSet : public Handle
47 * @brief Creates a new TextureSet object
49 * @return A handle to a newly allocated TextureSet
51 static TextureSet New();
54 * @brief Default constructor, creates an empty handle
64 * @brief Copy constructor, creates a new handle to the same object
66 * @param[in] handle Handle to an object
68 TextureSet( const TextureSet& handle );
71 * @brief Downcast to a TextureSet handle.
73 * If handle is not a TextureSet, the returned handle is left uninitialized.
74 * @param[in] handle to an object
75 * @return TextureSet handle or an uninitialized handle
77 static TextureSet DownCast( BaseHandle handle );
80 * @brief Assignment operator, changes this handle to point at the same object
82 * @param[in] handle Handle to an object
84 TextureSet& operator=( const TextureSet& handle );
87 * @brief Set the image at position "index"
88 * @param[in] index The position in the texture set of the image
89 * @param[in] image The image
91 void SetImage( size_t index, Image image );
94 * @brief Get the image at position "index"
95 * @param[in] index The position in the texture set of the image
96 * @return A handle to the image at the the specified position
98 Image GetImage( size_t index ) const;
101 * @brief Set the sampler to be used by the image at position "index"
102 * @param[in] index The position in the texture set of the sampler
103 * @param[in] sampler The sampler to use
105 void SetSampler( size_t index, Sampler sampler );
108 * @brief Set the sampler to be used by the image at position "index"
109 * @param[in] index The position in the texture set of the image
110 * @return A handle to the sampler at the specified position
112 Sampler GetSampler( size_t index ) const;
115 * @brief Get the number of textures present in the TextureSet
117 * @return The number of textures in the TextureSet
119 size_t GetTextureCount() const;
123 * @brief The constructor
125 * @param [in] pointer A pointer to a newly allocated TextureSet
127 explicit DALI_INTERNAL TextureSet( Internal::TextureSet* pointer );
134 #endif // DALI_TEXTURE_SET_H