2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiCtrlOverlayPanel.h
20 * @brief This is the header file for the %OverlayPanel class.
22 * This header file contains the declarations of the %OverlayPanel class.
24 #ifndef _FUI_CTRL_OVERLAY_PANEL_H_
25 #define _FUI_CTRL_OVERLAY_PANEL_H_
27 #include <FBaseTypes.h>
28 #include <FGrpCanvas.h>
29 #include <FUiCtrlPanel.h>
31 namespace Tizen { namespace Ui { namespace Controls
36 * @brief <i> [Deprecated] </i> This class is an implementation of %OverlayPanel.
38 * @deprecated This class is deprecated. Instead of using this class, use the OverlayRegion class, that supports video playback and camera preview.
41 * @remarks The %OverlayPanel control can only be attached to a %Form control by using Tizen::Ui::Container::AddControl method, because of its native
42 * characteristics. Since %OverlayPanel inherits a Panel control, it can be used as a container if needed.
44 * The %OverlayPanel class is an implementation of the %OverlayPanel control.
45 * The %OverlayPanel is a special type of panel which is used to specify a region where the developer
46 * can playback video or camera preview. It is called an overlay because it is possible to overlay
47 * other graphics and controls on top of the panel.
48 * The %OverlayPanel consists of two layers, the foreground panel and background buffer which supports
49 * H/W accelerated rendering. Due to the hardware accelerated nature, there is a limitation with an
50 * %OverlayPanel. The Form that houses an %OverlayPanel can only have a black, opaque background.
51 * The overlay panel can manipulate the rotation, the aspect ratio and the size of input buffer.
53 * Example: Please refer to the camera preview example of Tizen::Media::Camera
57 class _OSP_EXPORT_ OverlayPanel
58 : public Tizen::Ui::Controls::Panel
65 * Defines the various rotation options.
67 * @brief <i> [Deprecated] </i>
68 * @deprecated This enumerator is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera
75 ROTATION_NONE, /**< @if OSPDEPREC No rotation @endif */
76 ROTATION_90, /**< @if OSPDEPREC The 90 degree rotation @endif */
77 ROTATION_180, /**< @if OSPDEPREC The 180 degree rotation @endif */
78 ROTATION_270, /**< @if OSPDEPREC The 270 degree rotation @endif */
79 ROTATION_NONE_LR, /**< @if OSPDEPREC The horizontal mirroring @endif */
80 ROTATION_NONE_UD, /**< @if OSPDEPREC The vertical mirroring @endif */
81 ROTATION_90_LR, /**< @if OSPDEPREC The 90 degree rotation with horizontal mirroring @endif */
82 ROTATION_90_UD, /**< @if OSPDEPREC The 90 degree rotation with vertical mirroring @endif */
83 ROTATION_180_LR, /**< @if OSPDEPREC The 180 degree rotation with horizontal mirroring @endif */
84 ROTATION_180_UD, /**< @if OSPDEPREC The 180 degree rotation with vertical mirroring @endif */
85 ROTATION_270_LR, /**< @if OSPDEPREC The 270 degree rotation with horizontal mirroring @endif */
86 ROTATION_270_UD, /**< @if OSPDEPREC The 270 degree rotation with vertical mirroring @endif */
92 * @enum BufferPixelFormat
94 * Defines the pixel formats.
96 * @brief <i> [Deprecated] </i>
97 * @deprecated This enumerator is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
101 enum BufferPixelFormat
105 * The ARGB8888 pixel format
110 BUFFER_PIXEL_FORMAT_ARGB8888,
114 * The RGB565 pixel format
119 BUFFER_PIXEL_FORMAT_RGB565,
123 * The 8 bit Y plane followed by 8 bit 2 X 2 subsampled U and V planes
128 BUFFER_PIXEL_FORMAT_YCbCr420_PLANAR
133 * This is the default constructor for this class.
134 * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
136 * @brief <i> [Deprecated] </i>
137 * @deprecated This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
145 * This is the destructor for this class.
147 * @brief <i> [Deprecated] </i>
148 * @deprecated This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
152 virtual ~OverlayPanel(void);
156 * Initializes this instance of %OverlayPanel at the specified rectangle.
158 * @brief <i> [Deprecated] </i>
159 * @deprecated This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
162 * @return An error code
163 * @param[in] rect The location and size of the %OverlayPanel control @n
164 * The maximum size is 480 x 800 on a WVGA screen, or 240 x 400 on a WQVGA screen. @n
165 * The minimum size of this control is 32 x 32 on a WVGA screen.
166 * @exception E_SUCCESS The method is successful.
167 * @exception E_INVALID_ARG A specified input parameter is invalid.
168 * @exception E_SYSTEM A system error has occurred.
169 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
170 * @remarks Do not use %OverlayPanel in combination with %OverlayRegion. If used, %OverlayPanel may not work as expected.
171 * @see Tizen::Ui::Container
174 result Construct(const Tizen::Graphics::Rectangle& rect);
178 * Sets the rotation of the input buffer. @n
179 * All the rotations are clock-wise.
181 * @brief <i> [Deprecated] </i>
182 * @deprecated This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
185 * @param[in] rotation The rotation
189 void SetRendererRotation(OverlayPanel::Rotation rotation);
193 * Changes the size of the displayed renderer.
195 * @brief <i> [Deprecated] </i>
196 * @deprecated This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
199 * @param[in] dim The dimension of the window to draw
203 void SetRendererSize(Tizen::Graphics::Dimension& dim);
207 * Sets the aspect ratio of the renderer.
209 * @brief <i> [Deprecated] </i>
210 * @deprecated This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
213 * @param[in] fix Set to @c true if the renderer will display the aspect ratio of the input buffer even if the renderer and input data have
214 * different aspect ratios, @n
218 void SetRendererAspectRatio(bool fix);
222 * Sets the input buffer.
224 * @brief <i> [Deprecated] </i>
225 * @deprecated This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
228 * @param[in] destDim The dimension of the window to be drawn
229 * @param[in] srcBuffer The source buffer
230 * @param[in] srcDim The source dimension
231 * @param[in] srcFormat The pixel format of buffer data
232 * @exception E_SUCCESS The method is successful.
233 * @exception E_INVALID_ARG A specified input parameter is invalid.
234 * @exception E_SYSTEM A system error has occurred.
235 * @exception E_UNSUPPORTED_FORMAT The specified pixel format is not supported.
236 * @remarks BUFFER_PIXEL_FORMAT_ARGB8888, and BUFFER_PIXEL_FORMAT_RGB565 are not supported. @n
237 * Control::Invalidate() methods must be called to properly display the input buffer.
241 result SetInputBuffer(const Tizen::Graphics::Dimension& destDim, const Tizen::Base::ByteBuffer& srcBuffer, const Tizen::Graphics::Dimension& srcDim, BufferPixelFormat srcFormat);
245 * Gets the information of the background buffer.
247 * @brief <i> [Deprecated] </i>
248 * @deprecated This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
251 * @return An error code
252 * @param[out] info The information of the background buffer
253 * @exception E_SUCCESS The method is successful.
254 * @exception E_OPERATION_FAILED The operation has failed.
255 * @remarks Currently, this function provides buffer information except the pointer of the RGB color buffer. @n
256 * Therefore, info.pPixels is always assigned @c null.
259 result GetBackgroundBufferInfo(Tizen::Graphics::BufferInfo& info) const;
263 * Gets the masking color of this control.
265 * @brief <i> [Deprecated] </i>
266 * @deprecated This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
269 * @return The pixel color format
272 Tizen::Graphics::Color GetMaskingColor(void) const;
275 friend class _OverlayPanelImpl;
279 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
281 OverlayPanel(const OverlayPanel& rhs);
284 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
286 OverlayPanel& operator =(const OverlayPanel& rhs);
290 }}} // Tizen::Ui::Controls
292 #endif // _FUI_CTRL_OVERLAY_PANEL_H_