The OverlayPanel class is an implementation of the OverlayPanel control. The OverlayPanel is a special type of panel which is used to specify a region where the developer can playback video or camera preview. It is called an overlay because it is possible to overlay other graphics and controls on top of the panel. The OverlayPanel consists of two layers, the foreground panel and background buffer which supports H/W accelerated rendering. Due to the hardware accelerated nature, there is a limitation with an OverlayPanel. The Form that houses an OverlayPanel can only have a black, opaque background. The overlay panel can manipulate the rotation, the aspect ratio and the size of input buffer.
Example: Please refer to the camera preview example of Osp::Media::Camera
Public Types | |
enum | BufferPixelFormat { BUFFER_PIXEL_FORMAT_ARGB8888, BUFFER_PIXEL_FORMAT_RGB565, BUFFER_PIXEL_FORMAT_YCbCr420_PLANAR } |
enum | Rotation { ROTATION_NONE, ROTATION_90, ROTATION_180, ROTATION_270, ROTATION_NONE_LR, ROTATION_NONE_UD, ROTATION_90_LR, ROTATION_90_UD, ROTATION_180_LR, ROTATION_180_UD, ROTATION_270_LR, ROTATION_270_UD } |
Public Member Functions | |
result | Construct (const Osp::Graphics::Rectangle &rect) |
result | GetBackgroundBufferInfo (Osp::Graphics::BufferInfo &info) const |
Osp::Graphics::Color | GetMaskingColor (void) const |
OverlayPanel (void) | |
result | SetInputBuffer (const Osp::Graphics::Dimension &destDim, const Osp::Base::ByteBuffer &srcBuffer, const Osp::Graphics::Dimension &srcDim, BufferPixelFormat srcFormat) |
void | SetRendererAspectRatio (bool fix) |
void | SetRendererRotation (OverlayPanel::Rotation rotation) |
void | SetRendererSize (Osp::Graphics::Dimension &dim) |
virtual | ~OverlayPanel (void) |
Defines the pixel formats.
Defines the various rotation options.
Osp::Ui::Controls::OverlayPanel::OverlayPanel | ( | void | ) |
This is the default constructor for this class.
virtual Osp::Ui::Controls::OverlayPanel::~OverlayPanel | ( | void | ) | [virtual] |
This is the destructor for this class.
result Osp::Ui::Controls::OverlayPanel::Construct | ( | const Osp::Graphics::Rectangle & | rect | ) |
Initializes this instance of OverlayPanel at the specified rectangle.
[in] | rect | The location and size of the OverlayPanel control The maximum size is 480 x 800 on a WVGA screen, or 240 x 400 on a WQVGA screen. The minimum size of this control is 32 x 32 on a WVGA screen. |
E_SUCCESS | The method is successful. |
E_INVALID_STATE | This instance has already been constructed. |
E_INVALID_ARG | A specified input parameter is invalid. |
E_OUT_OF_MEMORY | The memory is insufficient. |
E_SYSTEM | A system error has occurred. |
0
. result Osp::Ui::Controls::OverlayPanel::GetBackgroundBufferInfo | ( | Osp::Graphics::BufferInfo & | info | ) | const |
Gets the information of the background buffer.
[out] | info | The information of the background buffer |
E_SUCCESS | The method is successful. |
E_OPERATION_FAILED | The operation has failed. |
E_INVALID_STATE | This instance has not been constructed as yet. |
null
. Osp::Graphics::Color Osp::Ui::Controls::OverlayPanel::GetMaskingColor | ( | void | ) | const |
Gets the masking color of this control.
result Osp::Ui::Controls::OverlayPanel::SetInputBuffer | ( | const Osp::Graphics::Dimension & | destDim, |
const Osp::Base::ByteBuffer & | srcBuffer, | ||
const Osp::Graphics::Dimension & | srcDim, | ||
BufferPixelFormat | srcFormat | ||
) |
Sets the input buffer.
[in] | destDim | The dimension of the window to be drawn |
[in] | srcBuffer | The source buffer |
[in] | srcDim | The source dimension |
[in] | srcFormat | The pixel format of buffer data |
E_SUCCESS | The method is successful. |
E_INVALID_ARG | A specified input parameter is invalid. |
E_SYSTEM | A system error has occurred. |
E_UNSUPPORTED_FORMAT | The specified pixel format is not supported. |
E_INVALID_STATE | This instance has not been constructed as yet. |
void Osp::Ui::Controls::OverlayPanel::SetRendererAspectRatio | ( | bool | fix | ) |
Sets the aspect ratio of the renderer.
[in] | fix | Set to true if the renderer will display the aspect ratio of the input buffer even if the renderer and input data have different aspect ratios, else false |
void Osp::Ui::Controls::OverlayPanel::SetRendererRotation | ( | OverlayPanel::Rotation | rotation | ) |
Sets the rotation of the input buffer.
All the rotations are clock-wise.
[in] | rotation | The rotation |
void Osp::Ui::Controls::OverlayPanel::SetRendererSize | ( | Osp::Graphics::Dimension & | dim | ) |
Changes the size of the displayed renderer.
[in] | dim | The dimension of the window to draw |