Ccv

This module implements color conversion from a source to a destination buffer. The color conversion can either be H/W accelerated (if supported) or performed by the CPU. Typical usage (Convert from 420Psemi to 422Psemi, no error checks):. More...

Data Structures

struct  Ccv_Attrs
 Attributes used to create a Color Conversion job. More...

Typedefs

typedef struct Ccv_Object * Ccv_Handle
 Handle through which to reference a Color Conversion job.

Enumerations

enum  Ccv_Mode {
  Ccv_Mode_YUV420SEMI_YUV422SEMI = 0,
  Ccv_Mode_YUV422SEMI_YUV420SEMI,
  Ccv_Mode_YUV420P_RGB565,
  Ccv_Mode_YUV422PSEMI_RGB565,
  Ccv_Mode_COUNT
}
 Different modes of Color Conversion. More...

Functions

Ccv_Handle Ccv_create (Ccv_Attrs *attrs)
 Creates a Color Conversion job.
Int Ccv_config (Ccv_Handle hCcv, Buffer_Handle hSrcBuf, Buffer_Handle hDstBuf)
 Configure a Color Conversion job.
Int Ccv_execute (Ccv_Handle hCcv, Buffer_Handle hSrcBuf, Buffer_Handle hDstBuf)
 Execute a Color Conversion job.
Ccv_Mode Ccv_getMode (Ccv_Handle hCcv)
 Gets the mode of a configured color conversion job.
Int Ccv_delete (Ccv_Handle hCcv)
 Deletes a Color Conversion job.

Variables

const Ccv_Attrs Ccv_Attrs_DEFAULT
 Default attributes for a Color Conversion job.

Detailed Description

This module implements color conversion from a source to a destination buffer. The color conversion can either be H/W accelerated (if supported) or performed by the CPU. Typical usage (Convert from 420Psemi to 422Psemi, no error checks):.

   #include <xdc/std.h>
   #include <ti/sdo/dmai/Ccv.h>
   #include <ti/sdo/dmai/Dmai.h>
   #include <ti/sdo/dmai/Capture.h>
   #include <ti/sdo/dmai/BufferGfx.h>

   Ccv_Attrs ccvAttrs = Ccv_Attrs_DEFAULT;
   BufferGfx_Attrs gfxAttrs = BufferGfx_Attrs_DEFAULT;
   Buffer_Handle hInBuf, hOutBuf;
   Ccv_Handle hCcv;
   Int32 bufSize;

   Dmai_init();
   gfxAttrs = BufferGfx_Attrs_DEFAULT;
   gfxAttrs.colorSpace     = ColorSpace_420Psemi;
   gfxAttrs.dim.width      = 720;
   gfxAttrs.dim.height     = 480;
   gfxAttrs.dim.lineLength = BufferGfx_calcLineLength(gfxAttrs.dim.width,
                                                      ColorSpace_420Psemi);
   bufSize = gfxAttrs.dim.lineLength * gfxAttrs.dim.height;
   hInBuf = Buffer_create(bufSize, BufferGfx_getBufferAttrs(&gfxAttrs)); 

   gfxAttrs = BufferGfx_Attrs_DEFAULT;
   gfxAttrs.colorSpace     = ColorSpace_422Psemi;
   gfxAttrs.dim.width      = 720;
   gfxAttrs.dim.height     = 480;
   gfxAttrs.dim.lineLength = BufferGfx_calcLineLength(gfxAttrs.dim.width
                                                      ColorSpace_422Psemi);
   bufSize = gfxAttrs.dim.lineLength * gfxAttrs.dim.height;
   hOutBuf = Buffer_create(bufSize, BufferGfx_getBufferAttrs(&gfxAttrs)); 

   hCcv = Ccv_create(&ccvAttrs);
   Ccv_config(hCcv, hInBuf, hOutBuf);

   Ccv_execute(hCcv, hInBuf, 0, hOutBuf, 0);

   Buffer_delete(hInBuf);
   Buffer_delete(hOutBuf);
   Ccv_delete(hCcv);

Typedef Documentation

typedef struct Ccv_Object* Ccv_Handle

Handle through which to reference a Color Conversion job.


Enumeration Type Documentation

enum Ccv_Mode

Different modes of Color Conversion.

See also:
ColorSpace_Type
Enumerator:
Ccv_Mode_YUV420SEMI_YUV422SEMI  From 420Psemi to 422Psemi.
Ccv_Mode_YUV422SEMI_YUV420SEMI  From 422Psemi to 420Psemi.
Ccv_Mode_YUV420P_RGB565  From 420P to RGB565.
Ccv_Mode_YUV422PSEMI_RGB565  From 422Psemi to RGB565.
Ccv_Mode_COUNT 


Function Documentation

Ccv_Handle Ccv_create ( Ccv_Attrs attrs  ) 

Creates a Color Conversion job.

Parameters:
[in] attrs Ccv_Attrs to use for creating the Color Conversion job.
Return values:
Ccv_Handle for use in subsequent operations (see Ccv_Handle).
NULL for failure.

Int Ccv_config ( Ccv_Handle  hCcv,
Buffer_Handle  hSrcBuf,
Buffer_Handle  hDstBuf 
)

Configure a Color Conversion job.

Parameters:
[in] hCcv The Ccv_Handle of the job to configure.
[in] hSrcBuf The source buffer to configure for. Note that only the buffer properties are accessed, the pointers are not used.
[in] hDstBuf The destination buffer to configure for. Note that only the buffer properties are accessed, the pointers are not used.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Ccv_create must be called before this function.

Int Ccv_execute ( Ccv_Handle  hCcv,
Buffer_Handle  hSrcBuf,
Buffer_Handle  hDstBuf 
)

Execute a Color Conversion job.

Parameters:
[in] hCcv The Ccv_Handle of the job to execute.
[in] hSrcBuf The source buffer to convert from.
[in] hDstBuf The destination buffer to convert to.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Ccv_create must be called before this function.

Ccv_config must be called before this function.

Ccv_Mode Ccv_getMode ( Ccv_Handle  hCcv  ) 

Gets the mode of a configured color conversion job.

Parameters:
[in] hCcv The Ccv_Handle to get the mode of.
Return values:
Mode of color conversion job (see Ccv_Mode).
Remarks:
Ccv_create must be called before this function.

Ccv_config must be called before this function.

Int Ccv_delete ( Ccv_Handle  hCcv  ) 

Deletes a Color Conversion job.

Parameters:
[in] hCcv The Ccv_Handle to delete.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Ccv_create must be called before this function.


Variable Documentation

Default attributes for a Color Conversion job.

     accel    = FALSE


Copyright 2011, Texas Instruments Incorporated