## **Overview**
**Related Modules:**
[Surface](Surface.md)
**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 | Obtains the width of the surface. |
GetHeight ()=0 | Obtains the height of the surface. |
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 | Sets the number of bytes for stride alignment. |
GetStrideAlignment ()=0 | Obtains the number of bytes for stride alignment. By default, 4-byte aligned is used. |
GetStride ()=0 | Obtains the stride of the surface. |
SetSize (uint32_t size)=0 | Sets the size of the shared memory to allocate. |
GetSize ()=0 | Obtains the size of the shared memory to allocate. |
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 * Obtains a buffer to write data. |
FlushBuffer (SurfaceBuffer *buffer)=0 | Flushes a buffer to the dirty queue for consumers to use. |
AcquireBuffer ()=0 | virtual SurfaceBuffer * |
ReleaseBuffer (SurfaceBuffer *buffer)=0 | |
CancelBuffer (SurfaceBuffer *buffer)=0 | Releases a buffer to the free queue. |
RegisterConsumerListener (IBufferConsumerListener &listener)=0 | Registers a consumer listener. |
UnregisterConsumerListener ()=0 | Unregisters the consumer listener. |
## Static Public Member Functions
Static Public Member Function Name | |
---|---|
static Surface * A constructor used to create a Surface object for consumers to use. |