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