[Tizen] Create Texture by ResourceId + Set Texture size and format internally.
[platform/core/uifw/dali-core.git] / dali / integration-api / texture-integ.h
1 #ifndef DALI_TEXTURE_INTEG_H
2 #define DALI_TEXTURE_INTEG_H
3
4 /*
5  * Copyright (c) 2023 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 <cstdint> ///< for uint32_t
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/images/image-operations.h>
26 #include <dali/public-api/rendering/texture.h>
27
28 namespace Dali::Integration
29 {
30 /**
31  * @brief Create new Dali::Texture with resourceId that Graphics::Controller can use.
32  *
33  * @SINCE_2_2.37
34  * @param[in] type The type of the texture
35  * @param[in] resourceId The unique id of this texture combinded with Graphics::Controller.
36  * @return A handle to a newly allocated Texture
37  */
38 DALI_CORE_API Dali::Texture NewTextureWithResourceId(Dali::TextureType::Type type, uint32_t resourceId);
39
40 /**
41  * @brief Get the resource id for this texture.
42  *
43  * @SINCE_2_2.37
44  * @param[in] texture The texture to get resource id.
45  * @return The resource id what given texture has.
46  */
47 DALI_CORE_API uint32_t GetTextureResourceId(Dali::Texture texture);
48
49 /**
50  * @brief Get the type for this texture.
51  *
52  * @SINCE_2_2.37
53  * @param[in] texture The texture to get texture type.
54  * @return The texture type what given texture has.
55  */
56 DALI_CORE_API Dali::TextureType::Type GetTextureType(Dali::Texture texture);
57
58 /**
59  * @brief Set the size of texture.
60  *
61  * @SINCE_2_2.37
62  * @param[in,out] texture The texture to set size.
63  * @param[in] size The size of texture to set.
64  */
65 DALI_CORE_API void SetTextureSize(Dali::Texture texture, const Dali::ImageDimensions& size);
66
67 /**
68  * @brief Set the pixel format of texture.
69  *
70  * @SINCE_2_2.37
71  * @param[in,out] texture The texture to set format.
72  * @param[in] format The format of texture to set.
73  */
74 DALI_CORE_API void SetTexturePixelFormat(Dali::Texture texture, Dali::Pixel::Format format);
75
76 } // namespace Dali::Integration
77
78 #endif // DALI_TEXTURE_INTEG_H