VDPAU
Data Structures | Macros | Typedefs | Enumerations
VdpOutputSurface Rendering Functionality
Collaboration diagram for VdpOutputSurface Rendering Functionality:

Data Structures

struct  VdpOutputSurfaceRenderBlendState
 Complete blending operation definition. More...
 

Macros

#define VDP_OUTPUT_SURFACE_RENDER_BLEND_STATE_VERSION   0
 
#define VDP_OUTPUT_SURFACE_RENDER_ROTATE_0
 Do not rotate source_surface prior to compositing.
 
#define VDP_OUTPUT_SURFACE_RENDER_ROTATE_90
 Rotate source_surface 90 degrees clockwise prior to compositing.
 
#define VDP_OUTPUT_SURFACE_RENDER_ROTATE_180
 Rotate source_surface 180 degrees prior to compositing.
 
#define VDP_OUTPUT_SURFACE_RENDER_ROTATE_270
 Rotate source_surface 270 degrees clockwise prior to compositing.
 
#define VDP_OUTPUT_SURFACE_RENDER_COLOR_PER_VERTEX
 A separate color is used for each vertex of the smooth-shaded quad. Hence, colors array contains 4 elements rather than 1. See description of colors array.
 

Typedefs

typedef VdpStatus VdpOutputSurfaceRenderOutputSurface(VdpOutputSurface destination_surface, VdpRect const *destination_rect, VdpOutputSurface source_surface, VdpRect const *source_rect, VdpColor const *colors, VdpOutputSurfaceRenderBlendState const *blend_state, uint32_t flags)
 Composite a sub-rectangle of a VdpOutputSurface into a sub-rectangle of another VdpOutputSurface; Output Surface object VdpOutputSurface.
 
typedef VdpStatus VdpOutputSurfaceRenderBitmapSurface(VdpOutputSurface destination_surface, VdpRect const *destination_rect, VdpBitmapSurface source_surface, VdpRect const *source_rect, VdpColor const *colors, VdpOutputSurfaceRenderBlendState const *blend_state, uint32_t flags)
 Composite a sub-rectangle of a VdpBitmapSurface into a sub-rectangle of a VdpOutputSurface; Output Surface object VdpOutputSurface.
 

Enumerations

enum  VdpOutputSurfaceRenderBlendFactor {
  VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ZERO = 0 , VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE = 1 , VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_SRC_COLOR = 2 , VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3 ,
  VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_SRC_ALPHA = 4 , VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 5 , VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_DST_ALPHA = 6 , VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 7 ,
  VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_DST_COLOR = 8 , VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 9 , VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_SRC_ALPHA_SATURATE = 10 , VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_CONSTANT_COLOR = 11 ,
  VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 12 , VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_CONSTANT_ALPHA = 13 , VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 14
}
 The blending equation factors. More...
 
enum  VdpOutputSurfaceRenderBlendEquation {
  VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_SUBTRACT = 0 , VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_REVERSE_SUBTRACT = 1 , VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_ADD = 2 , VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_MIN = 3 ,
  VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_MAX = 4
}
 The blending equations. More...
 

Detailed Description

VdpOutputSurface objects directly provide some rendering/compositing operations. These are described below.

Macro Definition Documentation

◆ VDP_OUTPUT_SURFACE_RENDER_BLEND_STATE_VERSION

#define VDP_OUTPUT_SURFACE_RENDER_BLEND_STATE_VERSION   0

◆ VDP_OUTPUT_SURFACE_RENDER_COLOR_PER_VERTEX

#define VDP_OUTPUT_SURFACE_RENDER_COLOR_PER_VERTEX

A separate color is used for each vertex of the smooth-shaded quad. Hence, colors array contains 4 elements rather than 1. See description of colors array.

◆ VDP_OUTPUT_SURFACE_RENDER_ROTATE_0

#define VDP_OUTPUT_SURFACE_RENDER_ROTATE_0

Do not rotate source_surface prior to compositing.

◆ VDP_OUTPUT_SURFACE_RENDER_ROTATE_180

#define VDP_OUTPUT_SURFACE_RENDER_ROTATE_180

Rotate source_surface 180 degrees prior to compositing.

◆ VDP_OUTPUT_SURFACE_RENDER_ROTATE_270

#define VDP_OUTPUT_SURFACE_RENDER_ROTATE_270

Rotate source_surface 270 degrees clockwise prior to compositing.

◆ VDP_OUTPUT_SURFACE_RENDER_ROTATE_90

#define VDP_OUTPUT_SURFACE_RENDER_ROTATE_90

Rotate source_surface 90 degrees clockwise prior to compositing.

Typedef Documentation

◆ VdpOutputSurfaceRenderBitmapSurface

typedef VdpStatus VdpOutputSurfaceRenderBitmapSurface(VdpOutputSurface destination_surface, VdpRect const *destination_rect, VdpBitmapSurface source_surface, VdpRect const *source_rect, VdpColor const *colors, VdpOutputSurfaceRenderBlendState const *blend_state, uint32_t flags)

Composite a sub-rectangle of a VdpBitmapSurface into a sub-rectangle of a VdpOutputSurface; Output Surface object VdpOutputSurface.

Parameters
[in]destination_surfaceThe destination surface of the compositing operation.
[in]destination_rectThe sub-rectangle of the destination surface to update. If NULL, the entire destination surface will be updated.
[in]source_surfaceThe source surface for the compositing operation. The surface is treated as having four components: red, green, blue and alpha. Any missing components are treated as 1.0. For example, for an A8 VdpBitmapSurface, alpha will come from the surface but red, green and blue will be treated as 1.0. If source_surface is VDP_INVALID_HANDLE, all components will be treated as 1.0. Note that destination_surface and source_surface must have been allocated via the same VdpDevice.
[in]source_rectThe sub-rectangle of the source surface to read from. If NULL, the entire source_surface will be read. Left/right ot top/bottom co-ordinates may be swapped to flip the source. Any flip occurs prior to any requested rotation. Values from outside the source surface are valid and samples at those locations will be taken from the nearest edge.
[in]colorsA pointer to an array of VdpColor objects. If the flag VDP_OUTPUT_SURFACE_RENDER_COLOR_PER_VERTEX is set, VDPAU will four entries from the array, and treat them as the colors corresponding to the upper-left, upper-right, lower-right and lower-left corners of the post-rotation source (i.e. indices 0, 1, 2 and 3 run clockwise from the upper left corner). If the flag VDP_OUTPUT_SURFACE_RENDER_COLOR_PER_VERTEX is not set, VDPAU will use the single VdpColor for all four corners. If colors is NULL then red, green, blue and alpha values of 1.0 will be used.
[in]blend_stateIf a blend state is provided, the blend state will be used for the composite operation. If NULL, blending is effectively disabled, which is equivalent to a blend equation of ADD, source blend factors of ONE and destination blend factors of ZERO. See VdpOutputSurfaceRenderBlendState for details regarding the mathematics of the blending operation.
[in]flagsA set of flags influencing how the compositing operation works.
Returns
VdpStatus The completion status of the operation.

The general compositing pipeline is as follows.

  1. Extract source_rect from source_surface.
  2. The extracted source is rotated 0, 90, 180 or 270 degrees according to the flags.
  3. The rotated source is component-wise multiplied by a smooth-shaded quad with a (potentially) different color at each vertex.
  4. The resulting rotated, smooth-shaded quad is scaled to the size of destination_rect and composited with destination_surface using the provided blend state.

◆ VdpOutputSurfaceRenderOutputSurface

typedef VdpStatus VdpOutputSurfaceRenderOutputSurface(VdpOutputSurface destination_surface, VdpRect const *destination_rect, VdpOutputSurface source_surface, VdpRect const *source_rect, VdpColor const *colors, VdpOutputSurfaceRenderBlendState const *blend_state, uint32_t flags)

Composite a sub-rectangle of a VdpOutputSurface into a sub-rectangle of another VdpOutputSurface; Output Surface object VdpOutputSurface.

Parameters
[in]destination_surfaceThe destination surface of the compositing operation.
[in]destination_rectThe sub-rectangle of the destination surface to update. If NULL, the entire destination surface will be updated.
[in]source_surfaceThe source surface for the compositing operation. The surface is treated as having four components: red, green, blue and alpha. Any missing components are treated as 1.0. For example, for an A8 VdpOutputSurface, alpha will come from the surface but red, green and blue will be treated as 1.0. If source_surface is VDP_INVALID_HANDLE, all components will be treated as 1.0. Note that destination_surface and source_surface must have been allocated via the same VdpDevice.
[in]source_rectThe sub-rectangle of the source surface to read from. If NULL, the entire source_surface will be read. Left/right and/or top/bottom co-ordinates may be swapped to flip the source. Any flip occurs prior to any requested rotation. Values from outside the source surface are valid and samples at those locations will be taken from the nearest edge.
[in]colorsA pointer to an array of VdpColor objects. If the flag VDP_OUTPUT_SURFACE_RENDER_COLOR_PER_VERTEX is set, VDPAU will four entries from the array, and treat them as the colors corresponding to the upper-left, upper-right, lower-right and lower-left corners of the post-rotation source (i.e. indices 0, 1, 2 and 3 run clockwise from the upper left corner). If the flag VDP_OUTPUT_SURFACE_RENDER_COLOR_PER_VERTEX is not set, VDPAU will use the single VdpColor for all four corners. If colors is NULL then red, green, blue and alpha values of 1.0 will be used.
[in]blend_stateIf a blend state is provided, the blend state will be used for the composite operation. If NULL, blending is effectively disabled, which is equivalent to a blend equation of ADD, source blend factors of ONE and destination blend factors of ZERO. See VdpOutputSurfaceRenderBlendState for details regarding the mathematics of the blending operation.
[in]flagsA set of flags influencing how the compositing operation works.
Returns
VdpStatus The completion status of the operation.

The general compositing pipeline is as follows.

  1. Extract source_rect from source_surface.
  2. The extracted source is rotated 0, 90, 180 or 270 degrees according to the flags.
  3. The rotated source is component-wise multiplied by a smooth-shaded quad with a (potentially) different color at each vertex.
  4. The resulting rotated, smooth-shaded quad is scaled to the size of destination_rect and composited with destination_surface using the provided blend state.

Enumeration Type Documentation

◆ VdpOutputSurfaceRenderBlendEquation

The blending equations.

Enumerator
VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_SUBTRACT 
VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_REVERSE_SUBTRACT 
VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_ADD 
VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_MIN 
VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_MAX 

◆ VdpOutputSurfaceRenderBlendFactor

The blending equation factors.

Enumerator
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ZERO 
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE 
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_SRC_COLOR 
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_SRC_COLOR 
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_SRC_ALPHA 
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA 
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_DST_ALPHA 
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_DST_ALPHA 
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_DST_COLOR 
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_DST_COLOR 
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_SRC_ALPHA_SATURATE 
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_CONSTANT_COLOR 
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR 
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_CONSTANT_ALPHA 
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA