Revert "[Tizen] To do not reset camera properties when OnScene"
[platform/core/uifw/dali-core.git] / dali / devel-api / rendering / frame-buffer-devel.h
1 #ifndef DALI_FRAME_BUFFER_DEVEL_H
2 #define DALI_FRAME_BUFFER_DEVEL_H
3
4 /*
5  * Copyright (c) 2020 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 // INTERNAL INCLUDES
22 #include <dali/public-api/rendering/frame-buffer.h>
23
24 namespace Dali
25 {
26 namespace DevelFrameBuffer
27 {
28 /**
29  * @brief Maximum number of color attachments supported.
30  */
31 constexpr uint8_t MAX_COLOR_ATTACHMENTS = 8;
32
33 /**
34  * @brief Attaches the base LOD of a depth texture to the frame buffer.
35  * @note This causes a depth attachment to be added.
36  *
37  * @param[in] frameBuffer A handle to the FrameBuffer
38  * @param[in] texture The texture that will be used as output when rendering
39  * @note The size of the texture has to be same as that of the frame buffer.
40  * Otherwise, it won't be attached.
41  */
42 DALI_CORE_API void AttachDepthTexture(FrameBuffer frameBuffer, Texture& texture);
43
44 /**
45  * @brief Attaches a depth texture to the frame buffer.
46  * @note This causes a depth attachment to be added.
47  *
48  * @param[in] frameBuffer A handle to the FrameBuffer
49  * @param[in] texture The texture that will be used as output when rendering
50  * @param[in] mipmapLevel The mipmap of the texture to be attached
51  * @note The size of the mipmapped texture has to be same as that of the frame buffer.
52  * Otherwise, it won't be attached.
53  */
54 DALI_CORE_API void AttachDepthTexture(FrameBuffer frameBuffer, Texture& texture, uint32_t mipmapLevel);
55
56 /**
57  * @brief Attaches the base LOD of a stencil texture to the frame buffer.
58  * @note This causes a stencil attachment to be added.
59  *
60  * @param[in] frameBuffer A handle to the FrameBuffer
61  * @param[in] texture The texture that will be used as output when rendering
62  * @note The size of the texture has to be same as that of the frame buffer.
63  * Otherwise, it won't be attached.
64  */
65 DALI_CORE_API void AttachDepthStencilTexture(FrameBuffer frameBuffer, Texture& texture);
66
67 /**
68  * @brief Attaches a depth/stencil texture to the frame buffer.
69  * @note This causes a depth/stencil attachment to be added.
70  *
71  * @param[in] frameBuffer A handle to the FrameBuffer
72  * @param[in] texture The texture that will be used as output when rendering
73  * @param[in] mipmapLevel The mipmap of the texture to be attached
74  * @note The size of the mipmapped texture has to be same as that of the frame buffer.
75  * Otherwise, it won't be attached.
76  */
77 DALI_CORE_API void AttachDepthStencilTexture(FrameBuffer frameBuffer, Texture& texture, uint32_t mipmapLevel);
78
79 /**
80  * @brief Gets the color texture at the given @a index used as output in the frame buffer.
81  *
82  * @param[in] frameBuffer A handle to the FrameBuffer
83  * @param[in] index The index required
84  *
85  * @return A handle to the texture used as color output, or an uninitialized handle
86  *
87  * @note A maximum of 8 color attachments are supported. Passing an invalid index will return
88  * an uninitialized handle.
89  */
90 DALI_CORE_API Texture GetColorTexture(const FrameBuffer frameBuffer, uint8_t index);
91
92 /**
93  * @brief Gets the depth texture used as output in the frame buffer.
94  *
95  * @param[in] frameBuffer The FrameBuffer handle
96  *
97  * @return A handle of the texture used as depth output, or an uninitialized handle
98  */
99 DALI_CORE_API Texture GetDepthTexture(FrameBuffer frameBuffer);
100
101 /**
102  * @brief Gets the depth/stencil texture used as output in the frame buffer.
103  *
104  * @param[in] frameBuffer The FrameBuffer handle
105  *
106  * @return A handle of the texture used as depth/stencil output, or an uninitialized handle
107  */
108 DALI_CORE_API Texture GetDepthStencilTexture(FrameBuffer frameBuffer);
109
110 } // namespace DevelFrameBuffer
111
112 } // namespace Dali
113
114 #endif // DALI_FRAME_BUFFER_DEVEL_H