Vision Apps User Guide

Introduction

Font and 2D Drawing API.

Version
0.0 (Oct 2013) : [KC] First version

Go to the source code of this file.

Data Structures

struct  Draw2D_FontProperty
 
struct  Draw2D_BmpProperty
 
struct  Draw2D_BufInfo
 Buffer information into which font and 2d primitives will be draw. More...
 
struct  Draw2D_FontPrm
 Font parameters. More...
 
struct  Draw2D_BmpPrm
 Bitmap parameters. More...
 
struct  Draw2D_LinePrm
 Line draw parameters. More...
 
struct  Draw2D_RegionPrm
 Region Params. More...
 

Macros

#define DRAW2D_MAX_PLANES   (3)
 
#define RGB888_TO_RGB565(r, g, b)   ((((uint32_t)(r>>3) & 0x1F) << 11) | (((uint32_t)(g>>2) & 0x3F) << 5) | (((uint32_t)(b>>3) & 0x1F)))
 Macro that converts RGB888 to RGB565. More...
 
#define RGB888_TO_BGRA444(r, g, b, a)   ((((uint32_t)(r>>4) & 0xF) << 0) | (((uint32_t)(g>>4) & 0xF) << 4) | (((uint32_t)(b>>4) & 0xF)<<8)| (((uint32_t)(a>>4) & 0xF)<<12))
 
#define DRAW2D_TRANSPARENT_COLOR   (RGB888_TO_RGB565(0, 0, 0))
 
#define DRAW2D_TRANSPARENT_COLOR_FORMAT   (DRAW2D_DF_BGR16_565)
 
#define DRAW2D_BMP_IDX_TI_LOGO_0   (0)
 
#define DRAW2D_BMP_IDX_TI_LOGO_1   (1)
 
#define DRAW2D_BMP_IDX_TI_LOGO_2   (2)
 
#define DRAW2D_BMP_IDX_TI_LOGO_3   (3)
 
#define DRAW2D_BMP_IDX_TI_LOGO_4   (4)
 
#define DRAW2D_BMP_IDX_TI_LOGO_5   (5)
 
#define DRAW2D_BMP_IDX_DOF_COLOUR_MAP   (6)
 
#define DRAW2D_BMP_IDX_SDE_COLOUR_MAP   (7)
 

Typedefs

typedef void * Draw2D_Handle
 Draw 2D object handle. More...
 

Enumerations

enum  Draw2D_DataFormat {
  DRAW2D_DF_YUV422I_UYVY = 0x0000,
  DRAW2D_DF_YUV422I_YUYV,
  DRAW2D_DF_YUV422I_YVYU,
  DRAW2D_DF_YUV422I_VYUY,
  DRAW2D_DF_YUV422SP_UV,
  DRAW2D_DF_YUV422SP_VU,
  DRAW2D_DF_YUV422P,
  DRAW2D_DF_YUV420SP_UV,
  DRAW2D_DF_YUV420SP_VU,
  DRAW2D_DF_YUV420P,
  DRAW2D_DF_YUV444P,
  DRAW2D_DF_YUV444I,
  DRAW2D_DF_RGB16_565,
  DRAW2D_DF_BGRA16_4444,
  DRAW2D_DF_RGB24_888,
  DRAW2D_DF_ARGB32_8888,
  DRAW2D_DF_RGBA32_8888,
  DRAW2D_DF_BGR16_565,
  DRAW2D_DF_BGR24_888,
  DRAW2D_DF_ABGR32_8888,
  DRAW2D_DF_BGRA32_8888,
  DRAW2D_DF_MISC,
  DRAW2D_DF_INVALID,
  DRAW2D_DF_FORCE32BITS = 0xFFFFFFFF
}
 Enums for data format. More...
 

Functions

int32_t Draw2D_create (Draw2D_Handle *pCtx)
 Create a context for drawing. More...
 
int32_t Draw2D_delete (Draw2D_Handle pCtx)
 Delete a previously created drawing context. More...
 
int32_t Draw2D_setBufInfo (Draw2D_Handle pCtx, Draw2D_BufInfo *pBufInfo)
 Associated a drawing buffer with a drawing context. More...
 
void Draw2D_updateBufAddr (Draw2D_Handle pCtx, uint8_t **bufAddr)
 Update drawing buffer. More...
 
int32_t Draw2D_clearBuf (Draw2D_Handle pCtx)
 Fill buffer with transperency color. More...
 
int32_t Draw2D_drawString (Draw2D_Handle pCtx, uint32_t startX, uint32_t startY, char *str, Draw2D_FontPrm *pPrm)
 Draw string of character into the drawing buffer. More...
 
int32_t Draw2D_drawString_rot (Draw2D_Handle pCtx, uint32_t startX, uint32_t startY, char *str, Draw2D_FontPrm *pPrm, uint32_t rotate)
 Draw string of character into the drawing buffer. More...
 
int32_t Draw2D_clearString (Draw2D_Handle pCtx, uint32_t startX, uint32_t startY, uint32_t stringLength, Draw2D_FontPrm *pPrm)
 Clear a area equal to stringLength in the drawing buffer. More...
 
int32_t Draw2D_getFontProperty (Draw2D_FontPrm *pPrm, Draw2D_FontProperty *pProp)
 Get properties of a given font. More...
 
int32_t Draw2D_getBmpProperty (Draw2D_BmpPrm *pPrm, Draw2D_BmpProperty *pProp)
 Get properties of a given bitmap. More...
 
int32_t Draw2D_drawLine (Draw2D_Handle pCtx, uint32_t startX, uint32_t startY, uint32_t endX, uint32_t endY, Draw2D_LinePrm *pPrm)
 Draw a line in the drawing buffer. More...
 
int32_t Draw2D_drawRect (Draw2D_Handle pCtx, uint32_t startX, uint32_t startY, uint32_t width, uint32_t height, Draw2D_LinePrm *pPrm)
 Draw a rectangle in the drawing buffer. More...
 
int32_t Draw2D_clearRegion (Draw2D_Handle pCtx, uint32_t startX, uint32_t startY, uint32_t width, uint32_t height)
 Clear a region in the drawing buffer with transperency color. More...
 
int32_t Draw2D_fillRegion (Draw2D_Handle pCtx, Draw2D_RegionPrm *prm)
 Draw a region in the drawing buffer with custom color. More...
 
void Draw2D_drawPixel (Draw2D_Handle pCtx, uint32_t px, uint32_t py, uint32_t color, uint32_t colorFormat)
 Draw pixel of a given color. More...
 
int32_t Draw2D_drawBmp (Draw2D_Handle pCtx, uint32_t startX, uint32_t startY, Draw2D_BmpPrm *pPrm)
 Draw a bitmap into the drawing buffer. More...
 
int32_t Draw2D_drawBmp_rot (Draw2D_Handle pCtx, uint32_t startX, uint32_t startY, Draw2D_BmpPrm *pPrm, uint32_t rotate)
 Draw a bitmap into the drawing buffer. More...
 
int32_t Draw2D_insertBmp (Draw2D_Handle pCtx, char *input_file, int32_t startX, int32_t startY)
 Draw a bitmap from BMP file at a specified display buffer location. More...
 
int32_t Draw2D_insertBmpFromMemory (Draw2D_Handle pCtx, void *buf, uint32_t buf_size, int32_t startX, int32_t startY)
 Draw a bitmap from BMP file (pre-copied at a memory location) at a specified display buffer location. More...
 
void Draw2D_setFontColor (uint16_t colorText, uint16_t colorBorder, uint16_t colorBg)
 Sets a global color to use for fonts in RGB565 format. More...
 
void Draw2D_resetFontColor ()
 Restore font to default. More...
 
static uint32_t Draw2D_floor (uint32_t val, uint32_t align)
 Initialize In queue parameters of a link. More...