BufferGfx

Describes a graphics buffer. The other DMAI modules perform graphics operations on instances of this module. This module is a submodule of the Buffer module, and all the Buffer module functions can also be used on a BufferGfx instance. Typical usage below for a D1 PAL sized buffer of color type UYVY (no error checking):. More...

Data Structures

struct  BufferGfx_Dimensions
 Describes the dimensions of a graphics Buffer. More...
struct  BufferGfx_Attrs
 Describes the attributes used to create a BufferGfx instance. More...

Functions

Buffer_AttrsBufferGfx_getBufferAttrs (BufferGfx_Attrs *gfxAttrs)
 Get the basic Buffer_Attrs of a BufferGfx_Attrs structure.
Int32 BufferGfx_calcSize (VideoStd_Type videoStd, ColorSpace_Type colorSpace)
 Calculate the size of a Buffer given a VideoStd_Type and a ColorSpace_Type.
Int32 BufferGfx_calcSizeDim (BufferGfx_Dimensions *dimPtr, ColorSpace_Type colorSpace)
 Calculate the size of a Buffer given BufferGfx_Dimensions and a ColorSpace_Type.
Int BufferGfx_calcDimensions (VideoStd_Type videoStd, ColorSpace_Type colorSpace, BufferGfx_Dimensions *dimPtr)
 Calculate the dimensions of a Buffer given a VideoStd_Type and a ColorSpace_Type.
Int32 BufferGfx_calcLineLength (Int32 width, ColorSpace_Type colorSpace)
 Calculate the line length (pitch) of a Buffer given a ColorSpace_Type.
Int32 BufferGfx_getFrameType (Buffer_Handle hBuf)
 Get the frame type of a BufferGfx instance.
Void BufferGfx_setFrameType (Buffer_Handle hBuf, Int32 frameType)
 Set the frame type of a BufferGfx instance,.
ColorSpace_Type BufferGfx_getColorSpace (Buffer_Handle hBuf)
 Get the ColorSpace_Type of a BufferGfx instance.
Void BufferGfx_setColorSpace (Buffer_Handle hBuf, ColorSpace_Type colorSpace)
 Set the ColorSpace_Type of a BufferGfx instance.
Void BufferGfx_getDimensions (Buffer_Handle hBuf, BufferGfx_Dimensions *dimPtr)
 Get the BufferGfx_Dimensions of a BufferGfx instance. If the current dimensions are not set (all fields set to 0), the original dimensions will be returned, otherwise the current dimensions are returned.
Int BufferGfx_setDimensions (Buffer_Handle hBuf, BufferGfx_Dimensions *dimPtr)
 Set the current BufferGfx_Dimensions of a BufferGfx instance.
Void BufferGfx_resetDimensions (Buffer_Handle hBuf)
 Reset the dimensions to the original create time dimensions.
Int BufferGfx_setMaxDimensions (Buffer_Handle hBuf, BufferGfx_Dimensions *dimPtr)
 Set the maximum dimensions of a Buffer reference.

Variables

const BufferGfx_Attrs BufferGfx_Attrs_DEFAULT
 The default BufferGfx_Attrs used to create a BufferGfx instance.

Detailed Description

Describes a graphics buffer. The other DMAI modules perform graphics operations on instances of this module. This module is a submodule of the Buffer module, and all the Buffer module functions can also be used on a BufferGfx instance. Typical usage below for a D1 PAL sized buffer of color type UYVY (no error checking):.

   #include <xdc/std.h>
   #include <ti/sdo/dmai/BufferGfx.h>
   BufferGfx_Handle hBuf;
   Int32 size;
   BufferGfx_Attrs gfxAttrs = BufferGfx_Attrs_DEFAULT;

   Dmai_init();
   size = BufferGfx_calcSize(VideoStd_D1_PAL, ColorSpace_UYVY);
   BufferGfx_calcDimensions(VideoStd_D1_PAL, ColorSpace_UYVY, &gfxAttrs.dim);
   gfxAttrs.colorSpace = ColorSpace_UYVY;
   hBuf = Buffer_create(size, Buffer_getBufferAttrs(&gfxAttrs));
   // Operate on graphics Buffer
   Buffer_delete(hBuf);

Function Documentation

Buffer_Attrs* BufferGfx_getBufferAttrs ( BufferGfx_Attrs gfxAttrs  ) 

Get the basic Buffer_Attrs of a BufferGfx_Attrs structure.

Parameters:
[in] gfxAttrs A BufferGfx_Attrs pointer to the full graphics attrs.
Return values:
Pointer to the basic Buffer_Attrs.
Remarks:
This is used when calling Buffer_create and is safer than type casting.

Int32 BufferGfx_calcSize ( VideoStd_Type  videoStd,
ColorSpace_Type  colorSpace 
)

Calculate the size of a Buffer given a VideoStd_Type and a ColorSpace_Type.

Parameters:
[in] videoStd Video standard, see VideoStd_Type.
[in] colorSpace Color space type, see ColorSpace_Type.
Return values:
Size estimation in bytes of the graphics Buffer.
Negative value for failure, see Dmai.h.

Int32 BufferGfx_calcSizeDim ( BufferGfx_Dimensions dimPtr,
ColorSpace_Type  colorSpace 
)

Calculate the size of a Buffer given BufferGfx_Dimensions and a ColorSpace_Type.

Parameters:
[in] dimPtr Dimensions of the graphics Buffer.
[in] colorSpace Color space type, see ColorSpace_Type.
Return values:
Size estimation in bytes of the graphics Buffer.

Int BufferGfx_calcDimensions ( VideoStd_Type  videoStd,
ColorSpace_Type  colorSpace,
BufferGfx_Dimensions dimPtr 
)

Calculate the dimensions of a Buffer given a VideoStd_Type and a ColorSpace_Type.

Parameters:
[in] videoStd Video standard, see VideoStd_Type.
[in] colorSpace Color space type, see ColorSpace_Type.
[out] dimPtr Pointer to a BufferGfx_Dimensions structure to fill in with the calculate dimensions.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.

Int32 BufferGfx_calcLineLength ( Int32  width,
ColorSpace_Type  colorSpace 
)

Calculate the line length (pitch) of a Buffer given a ColorSpace_Type.

Parameters:
[in] colorSpace Color space type, see ColorSpace_Type.
[in] width The width to calculate the line length for.
Return values:
Line length as a result of the calculation.
Negative value for failure, see Dmai.h.

Int32 BufferGfx_getFrameType ( Buffer_Handle  hBuf  ) 

Get the frame type of a BufferGfx instance.

Parameters:
[in] hBuf Handle to the Buffer to get the frame type for.
Return values:
Frame Type 
Remarks:
For more information on frame type, see IVIDEO_FrameType in the XDM documenation.

Buffer_create or BufTab_create must be called before this function.

Void BufferGfx_setFrameType ( Buffer_Handle  hBuf,
Int32  frameType 
)

Set the frame type of a BufferGfx instance,.

Parameters:
[in] hBuf Handle to the graphics Buffer to get the frame type for.
[in] frameType Frane type to set the Buffer to.
Remarks:
For more information on frame type, see IVIDEO_FrameType in the XDM documenation.

Buffer_create or BufTab_create must be called before this function.

ColorSpace_Type BufferGfx_getColorSpace ( Buffer_Handle  hBuf  ) 

Get the ColorSpace_Type of a BufferGfx instance.

Parameters:
[in] hBuf Handle to the graphics Buffer to get the color space type for
Return values:
Type of color space of Buffer (see ColorSpace_Type).
Remarks:
Buffer_create or BufTab_create must be called before this function.

Void BufferGfx_setColorSpace ( Buffer_Handle  hBuf,
ColorSpace_Type  colorSpace 
)

Set the ColorSpace_Type of a BufferGfx instance.

Parameters:
[in] hBuf Handle to the graphics Buffer to set the color space type for
[in] colorSpace ColorSpace_Type to set the Buffer to.
Remarks:
Buffer_create or BufTab_create must be called before this function.

Void BufferGfx_getDimensions ( Buffer_Handle  hBuf,
BufferGfx_Dimensions dimPtr 
)

Get the BufferGfx_Dimensions of a BufferGfx instance. If the current dimensions are not set (all fields set to 0), the original dimensions will be returned, otherwise the current dimensions are returned.

Parameters:
[in] hBuf Handle to the graphics Buffer to get the dimensions for.
[out] dimPtr Dimensions of the graphics Buffer is returned here.
Remarks:
Buffer_create or BufTab_create must be called before this function.

Int BufferGfx_setDimensions ( Buffer_Handle  hBuf,
BufferGfx_Dimensions dimPtr 
)

Set the current BufferGfx_Dimensions of a BufferGfx instance.

Parameters:
[in] hBuf Handle to the graphics Buffer to set the dimensions for.
[out] dimPtr Dimensions of the graphics Buffer to set.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Buffer_create or BufTab_create must be called before this function.

Void BufferGfx_resetDimensions ( Buffer_Handle  hBuf  ) 

Reset the dimensions to the original create time dimensions.

Parameters:
[in] hBuf Handle to the graphics Buffer to reset the dimensions for.
Remarks:
Buffer_create or BufTab_create must be called before this function.

Int BufferGfx_setMaxDimensions ( Buffer_Handle  hBuf,
BufferGfx_Dimensions dimPtr 
)

Set the maximum dimensions of a Buffer reference.

Parameters:
[in] hBuf Handle to the graphics Buffer reference to set the maximum dimensions of.
[in] dimPtr Maximum dimensions to set.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
The Buffer instance passed need to having been created as a reference, see Buffer_Attrs.reference.

Buffer_create or BufTab_create must be called before this function.


Variable Documentation

The default BufferGfx_Attrs used to create a BufferGfx instance.

 bAttrs       = {
     memParams     = Buffer_Memory_Params_DEFAULT
     type          = Buffer_Type_GRAPHICS,
     useMask       = 1
 },
 colorSpace   = ColorSpace_NOTSET,
 dim          = { 0, 0, 0, 0, 0 }


Copyright 2011, Texas Instruments Incorporated