1 #ifndef DALI_TEXTURE_DEVEL_H
2 #define DALI_TEXTURE_DEVEL_H
5 * Copyright (c) 2022 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 <dali/public-api/rendering/texture.h>
26 namespace DevelTexture
29 * @brief Function to determine if a texture is backed by a native image.
31 * @return True if the texture is a native image.
33 bool DALI_CORE_API IsNative(Dali::Texture texture);
36 * @brief Converts shader for native image.
38 * Applies any specific native shader prefix and sampler code to the
41 * @param[in] texture The texture the shader will apply to
42 * @param[in] shader The fragment shader code to modify
43 * @return True if the shader code was modified
45 bool DALI_CORE_API ApplyNativeFragmentShader(Dali::Texture texture, std::string& shader);
48 * @brief Uploads data to the texture from a PixelData object.
49 * @note Compressed type doesn't support this API.
50 * @note Upload does not upsample or downsample pixel data to fit the specified rectangular area in the texture.
53 * @param[in] texture The texture will be uploaded
54 * @param[in] pixelData The pixelData object
55 * @param[in] dataXOffset Specifies an horizontal offset of the rectangular area in the pixelData that will be updated
56 * @param[in] dataYOffset Specifies a vertical offset of the rectangular area in the pixelData that will be updated
57 * @param[in] dataWidth Specifies the width of the rectangular area in the pixelData that will be updated
58 * @param[in] dataHeight Specifies the height of the rectangular area in the pixelData that will be updated
59 * @return True if the PixelData object has compatible pixel format and fits within the texture, false otherwise
61 bool DALI_CORE_API UploadSubPixelData(Dali::Texture texture,
62 Dali::PixelData pixelData,
69 * @brief Uploads data to the texture from a PixelData object.
70 * @note Compressed type doesn't support this API.
71 * @note Upload does not upsample or downsample pixel data to fit the specified rectangular area in the texture.
74 * @param[in] texture The texture will be uploaded
75 * @param[in] pixelData The pixelData object
76 * @param[in] dataXOffset Specifies an horizontal offset of the rectangular area in the pixelData that will be updated
77 * @param[in] dataYOffset Specifies a vertical offset of the rectangular area in the pixelData that will be updated
78 * @param[in] dataWidth Specifies the width of the rectangular area in the pixelData that will be updated
79 * @param[in] dataHeight Specifies the height of the rectangular area in the pixelData that will be updated
80 * @param[in] layer Specifies the layer of a cube map or array texture (Unused for 2D textures). @see CubeMapLayer
81 * @param[in] mipmap Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image
82 * @param[in] xOffset Specifies an horizontal offset of the rectangular area in the texture that will be updated
83 * @param[in] yOffset Specifies a vertical offset of the rectangular area in the texture that will be updated
84 * @param[in] width Specifies the width of the rectangular area in the texture that will be updated
85 * @param[in] height Specifies the height of the rectangular area in the texture that will be updated
86 * @return True if the PixelData object has compatible pixel format and fits within the texture, false otherwise
88 bool DALI_CORE_API UploadSubPixelData(Dali::Texture texture,
89 Dali::PixelData pixelData,
101 } // namespace DevelTexture
104 #endif // DALI_TEXTURE_DEVEL_H