OHOS::Surface
Overview
Related Modules:
Description:
Defines the consumer listener used to notify consumers when the surface status is updated.
Since:
1.0
Version:
1.0
Summary
Public Member Functions
~Surface () |
A destructor used to delete the Surface instance. |
SetQueueSize (uint8_t queueSize)=0 |
Sets the number of buffers that can be allocated to the surface. The default value is 1. The value range is [1, 10]. |
GetQueueSize ()=0 |
Obtains the number of surface buffers that can be allocated to the surface. The default value is 1. The value range is [1, 10]. |
SetWidthAndHeight (uint32_t width, uint32_t height)=0 |
Sets the width and height of the surface for calculating its stride and size. The default value range of width and height is (0,7680]. |
GetWidth ()=0 |
|
GetHeight ()=0 |
|
SetFormat (uint32_t format)=0 |
Sets the pixel format of the surface. For details, see ImageFormat. The default pixel format is IMAGE_PIXEL_FORMAT_RGB565. |
GetFormat ()=0 |
Obtains the pixel format of the surface. For details, see ImageFormat. The default pixel format is IMAGE_PIXEL_FORMAT_RGB565. |
SetStrideAlignment (uint32_t strideAlignment)=0 |
|
GetStrideAlignment ()=0 |
Obtains the number of bytes for stride alignment. By default, 4-byte aligned is used. |
GetStride ()=0 |
|
SetSize (uint32_t size)=0 |
|
GetSize ()=0 |
|
SetUsage (uint32_t usage)=0 |
Sets the usage scenario of the buffer. Physically contiguous memory and virtual memory (by default) are supported. By default, virtual memory is allocated. |
GetUsage ()=0 |
Obtains the usage scenario of the buffer. Physically contiguous memory and virtual memory are supported. |
SetUserData (const std::string &key, const std::string &value)=0 |
Sets surface user data, which is stored in the format of <key, value>. |
GetUserData (const std::string &key)=0 |
|
RequestBuffer (uint8_t wait=0)=0 |
virtual SurfaceBuffer |
FlushBuffer (SurfaceBuffer buffer)=0 |
|
AcquireBuffer ()=0 |
virtual SurfaceBuffer |
ReleaseBuffer (SurfaceBuffer buffer)=0 |
|
CancelBuffer (SurfaceBuffer *buffer)=0 |
|
RegisterConsumerListener (IBufferConsumerListener &listener)=0 |
|
Static Public Member Functions
static Surface * A constructor used to create a Surface object for consumers to use. |