VDPAU: VdpBitmapSurface; Bitmap Surface object

VDPAU

Typedefs
VdpBitmapSurface; Bitmap Surface object
Core API
Collaboration diagram for VdpBitmapSurface; Bitmap Surface object:

## Typedefs
typedef VdpStatus | VdpBitmapSurfaceQueryCapabilities(VdpDevice device, VdpRGBAFormat surface_rgba_format, VdpBool *is_supported, uint32_t *max_width, uint32_t *max_height)
| Query the implementation's VdpBitmapSurface capabilities.
typedef uint32_t | VdpBitmapSurface
| An opaque handle representing a VdpBitmapSurface object.
typedef VdpStatus | VdpBitmapSurfaceCreate(VdpDevice device, VdpRGBAFormat rgba_format, uint32_t width, uint32_t height, VdpBool frequently_accessed, VdpBitmapSurface *surface)
| Create a VdpBitmapSurface.
typedef VdpStatus | VdpBitmapSurfaceDestroy(VdpBitmapSurface surface)
| Destroy a VdpBitmapSurface.
typedef VdpStatus | VdpBitmapSurfaceGetParameters(VdpBitmapSurface surface, VdpRGBAFormat *rgba_format, uint32_t *width, uint32_t *height, VdpBool *frequently_accessed)
| Retrieve the parameters used to create a VdpBitmapSurface.
typedef VdpStatus | VdpBitmapSurfacePutBitsNative(VdpBitmapSurface surface, void const *const *source_data, uint32_t const *source_pitches, VdpRect const *destination_rect)
| Copy image data from application memory in the surface's native format to a VdpBitmapSurface.

## Detailed Description

A VdpBitmapSurface stores RGBA data in a defined format.

A VdpBitmapSurface may be filled with:

- Data provided by the CPU via the VdpBitmapSurfacePutBitsNative function.

VdpBitmapSurface content may be accessed by:

- The Hardware that implements VdpOutputSurface rendering functionality

VdpBitmapSurface objects are intended to store static read-only data, such as font glyphs, and the bitmaps used to compose an applications' user-interface.

The primary differences between VdpBitmapSurfaces and VdpOutputSurfaces are:

- You cannot render to a VdpBitmapSurface, just upload native data via the PutBits API.
- The read-only nature of a VdpBitmapSurface gives the implementation more flexibility in its choice of data storage location for the bitmap data. For example, some implementations may choose to store some/all VdpBitmapSurface objects in system memory to relieve GPU memory pressure.
- VdpBitmapSurface and VdpOutputSurface may support different subsets of all known RGBA formats.

## Typedef Documentation

## ◆ VdpBitmapSurface

typedef uint32_t VdpBitmapSurface

An opaque handle representing a VdpBitmapSurface object.

## ◆ VdpBitmapSurfaceCreate

typedef VdpStatus VdpBitmapSurfaceCreate(VdpDevice device, VdpRGBAFormat rgba_format, uint32_t width, uint32_t height, VdpBool frequently_accessed, VdpBitmapSurface *surface)

Create a VdpBitmapSurface.

Parameters

  [in] | device | The device that will contain the surface.
  [in] | rgba_format | The format of the new surface.
  [in] | width | The width of the new surface.
  [in] | height | The height of the new surface.
  [in] | frequently_accessed | Is this bitmap used frequently, or infrequently, by compositing options? Implementations may use this as a hint to determine how to allocate the underlying storage for the surface.
  [out] | surface | The new surface's handle.

Returns
  VdpStatus The completion status of the operation.

The memory backing the surface may not be initialized during creation. Applications are expected initialize any region that they use, via VdpBitmapSurfacePutBitsNative.

## ◆ VdpBitmapSurfaceDestroy

typedef VdpStatus VdpBitmapSurfaceDestroy(VdpBitmapSurface surface)

Destroy a VdpBitmapSurface.

Parameters

  [in] | surface | The surface's handle.

Returns
  VdpStatus The completion status of the operation.

## ◆ VdpBitmapSurfaceGetParameters

typedef VdpStatus VdpBitmapSurfaceGetParameters(VdpBitmapSurface surface, VdpRGBAFormat *rgba_format, uint32_t *width, uint32_t *height, VdpBool *frequently_accessed)

Retrieve the parameters used to create a VdpBitmapSurface.

Parameters

  [in] | surface | The surface's handle.
  [out] | rgba_format | The format of the surface.
  [out] | width | The width of the surface.
  [out] | height | The height of the surface.
  [out] | frequently_accessed | The frequently_accessed state of the surface.

Returns
  VdpStatus The completion status of the operation.

## ◆ VdpBitmapSurfacePutBitsNative

typedef VdpStatus VdpBitmapSurfacePutBitsNative(VdpBitmapSurface surface, void const *const *source_data, uint32_t const *source_pitches, VdpRect const *destination_rect)

Copy image data from application memory in the surface's native format to a VdpBitmapSurface.

Parameters

  [in] | surface | The surface's handle.
  [in] | source_data | Pointers to the application data buffers from which the image data will be copied. Note that this is an array of pointers, one per plane. The source_format parameter will define how many planes are required.
  [in] | source_pitches | Pointers to the pitch values for the application data buffers. Note that this is an array of pointers, one per plane. The source_format parameter will define how many planes are required.
  [in] | destination_rect | The sub-rectangle of the surface to fill with application data. If NULL, the entire surface will be updated.

Returns
  VdpStatus The completion status of the operation.

## ◆ VdpBitmapSurfaceQueryCapabilities

typedef VdpStatus VdpBitmapSurfaceQueryCapabilities(VdpDevice device, VdpRGBAFormat surface_rgba_format, VdpBool *is_supported, uint32_t *max_width, uint32_t *max_height)

Query the implementation's VdpBitmapSurface capabilities.

Parameters

  [in] | device | The device to query.
  [in] | surface_rgba_format | The surface format for which information is requested.
  [out] | is_supported | Is this surface format supported?
  [out] | max_width | The maximum supported surface width for this chroma type.
  [out] | max_height | The maximum supported surface height for this chroma type.

Returns
  VdpStatus The completion status of the operation.