Fixing the remaining exports from public API
[platform/core/uifw/dali-core.git] / dali / public-api / images / frame-buffer-image.h
1 #ifndef __DALI_FRAME_BUFFER_IMAGE_H__
2 #define __DALI_FRAME_BUFFER_IMAGE_H__
3
4 /*
5  * Copyright (c) 2014 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/images/image.h>
23 #include <dali/public-api/math/rect.h>
24
25 namespace Dali
26 {
27
28 namespace Internal DALI_INTERNAL
29 {
30 class FrameBufferImage;
31 }
32
33 /**
34  * @brief FrameBufferImage represents a GLES Frame Buffer Object and contains the result
35  * of an 'off screen' render pass of a RenderTask.
36  * The FrameBufferImage can then be used with an ImageActor (with optional shader
37  * effects) and rendered to the screen.
38  */
39 class DALI_IMPORT_API FrameBufferImage : public Image
40 {
41 public:
42   /**
43    * @brief Constructor which creates an uninitialized FrameBufferImage object.
44    *
45    * Use Image::New(...) to create an initialised object.
46    */
47   FrameBufferImage();
48
49   /**
50    * @brief Create a new FrameBufferImage.
51    *
52    * The maximum size of the image is limited by GL_MAX_TEXTURE_SIZE.
53    * The ReleasePolicy defaults to Dali::Image::Never.
54    * @param [in] width       The width in pixels. Setting to zero will use the width of the stage.
55    * @param [in] height      The height in pixels. Setting to zero will use the height of the stage.
56    * @param [in] pixelformat The pixel format (rgba 32 bit by default)
57    * @post When the FrameBufferImage is first used as a render target, an exception may be thrown if pixelFormat is not supported on the hardware platform.
58    * @return A handle to a new instance of a FrameBufferImage.
59    */
60   static FrameBufferImage New(unsigned int width = 0, unsigned int height = 0, Pixel::Format pixelformat = Pixel::RGBA8888);
61
62   /**
63    * @brief Create a new FrameBufferImage.
64    *
65    * The maximum size of the image is limited by GL_MAX_TEXTURE_SIZE.
66    * @param [in] width       The width in pixels. Setting to zero will use the width of the stage.
67    * @param [in] height      The height in pixels. Setting to zero will use the height of the stage.
68    * @param [in] pixelformat The pixel format.
69    * @param [in] releasePolicy The ReleasePolicy to apply to the FrameBufferImage.
70    *
71    * Note that there is no need for a LoadPolicy - by definition it is always OnDemand, since there is no point in the FrameBufferImage existing unless someone is rendering to
72    * it, or it is being used as an input (e.g. ShaderEffect / ImageActor).
73    *
74    * @post When the FrameBufferImage is first used as a render target, an exception may be thrown if pixelFormat is not supported on the hardware platform.
75    * @return A handle to a new instance of a FrameBufferImage.
76    */
77   static FrameBufferImage New(unsigned int width, unsigned int height, Pixel::Format pixelformat, ReleasePolicy releasePolicy );
78
79   /**
80    * @brief Create a new FrameBufferImage.
81    *
82    * The maximum size of the image is limited by GL_MAX_TEXTURE_SIZE.
83    * @param [in] image       The native image.
84    *
85    * Note that there is no need for a LoadPolicy - by definition it is always OnDemand, since there is no point in the FrameBufferImage existing unless someone is rendering to
86    * it, or it is being used as an input (e.g. ShaderEffect / ImageActor).
87    *
88    * @post When the FrameBufferImage is first used as a render target, an exception may be thrown if the NativeImage cannot be mapped to a texture.
89    * @return A handle to a new instance of a FrameBufferImage.
90    */
91   static FrameBufferImage New(NativeImage& image);
92
93   /**
94    * @brief Create a new FrameBufferImage.
95    *
96    * The maximum size of the image is limited by GL_MAX_TEXTURE_SIZE.
97    * @param [in] image       The native image.
98    * @param [in] releasePolicy The ReleasePolicy to apply to the FrameBufferImage.
99    *
100    * Note that there is no need for a LoadPolicy - by definition it is always OnDemand, since there is no point in the FrameBufferImage existing unless someone is rendering to
101    * it, or it is being used as an input (e.g. ShaderEffect / ImageActor).
102    *
103    * @post When the FrameBufferImage is first used as a render target, an exception may be thrown if the NativeImage cannot be mapped to a texture.
104    * @return A handle to a new instance of a FrameBufferImage.
105    */
106   static FrameBufferImage New(NativeImage& image, ReleasePolicy releasePolicy);
107
108   /**
109    * @brief Downcast an Object handle to FrameBufferImage handle.
110    *
111    * If handle points to a FrameBufferImage object the
112    * downcast produces valid handle. If not the returned handle is left uninitialized.
113    * @param[in] handle to An object
114    * @return handle to a FrameBufferImage object or an uninitialized handle
115    */
116   static FrameBufferImage DownCast( BaseHandle handle );
117
118   /**
119    * @brief Destructor
120    *
121    * This is non-virtual since derived Handle types must not contain data or virtual methods.
122    */
123   ~FrameBufferImage();
124
125   /**
126    * @brief This copy constructor is required for (smart) pointer semantics.
127    *
128    * @param [in] handle A reference to the copied handle
129    */
130   FrameBufferImage(const FrameBufferImage& handle);
131
132   /**
133    * @brief This assignment operator is required for (smart) pointer semantics.
134    *
135    * @param [in] rhs  A reference to the copied handle
136    * @return A reference to this
137    */
138   FrameBufferImage& operator=(const FrameBufferImage& rhs);
139
140   /**
141    * @brief This method is defined to allow assignment of the NULL value,
142    * and will throw an exception if passed any other value.
143    *
144    * Assigning to NULL is an alias for Reset().
145    * @param [in] rhs  A NULL pointer
146    * @return A reference to this handle
147    */
148   FrameBufferImage& operator=(BaseHandle::NullType* rhs);
149
150 public: // Not intended for application developers
151
152   explicit DALI_INTERNAL FrameBufferImage(Internal::FrameBufferImage*);
153 }; //class FrameBufferImage
154
155 } // namespace Dali
156
157 #endif // __DALI_FRAME_BUFFER_IMAGE_H__