A tiny drawing library. include line draw and bitmap-font draw.bitmap-font is from linux-kernel-source.

Embed: (wiki syntax)

« Back to documentation index

TinyDraw Class Reference

TinyDraw Class Reference

Tiny library of drawing in framebuffer. More...

#include <tinydraw.h>

Public Member Functions

void clear (void)
 The frame buffer is cleared by 0.
void drawPoint (TD_XY_t x, TD_XY_t y, TD_COLOR_t fcol)
 The dot is drawn in specified coordinates by the specified color code.
void drawLine (TD_POINT_t *p1, TD_POINT_t *p2, TD_COLOR_PAIR_t *col)
 It draws in the line.
void drawChar (TD_POINT_t *pnt, int c, TD_COLOR_PAIR_t *col, const struct font_desc *fontdesc)
 It draws in the character.
void drawStr (TD_POINT_t *pnt, char *str, TD_COLOR_PAIR_t *col, const struct font_desc *fontdesc)
 It draws in the string.
char * getCharImage (int c, const struct font_desc *fontdesc)
 Get the bit map image of the font.
TD_COLOR_t * getVRAMPtr (TD_POINT_t *pnt)
 Get the framebuffer pointer.
TD_COLOR_t * getVRAMPtr (void)
 Get the top of framebuffer pointer.

Detailed Description

Tiny library of drawing in framebuffer.

Definition at line 47 of file tinydraw.h.


Member Function Documentation

void clear ( void   )

The frame buffer is cleared by 0.

Parameters:
none.
Returns:
none.

Definition at line 49 of file tinydraw.cpp.

void drawChar ( TD_POINT_t *  pnt,
int  c,
TD_COLOR_PAIR_t col,
const struct font_desc *  fontdesc 
)

It draws in the character.

Parameters:
pnt[in] point of draw (upper left corner of font)
c[in] character code(only use ASCII-CODE now)
col[in] Color-code.
fontdesc[in] font-descriptor.
Returns:
none.

Definition at line 63 of file tinydraw.cpp.

void drawLine ( TD_POINT_t *  p1,
TD_POINT_t *  p2,
TD_COLOR_PAIR_t col 
)

It draws in the line.

Parameters:
p1[in] point of start.
p2[in] point of end.
col[in] Color-code (now only use 'fore').
Returns:
none.

Definition at line 113 of file tinydraw.cpp.

void drawPoint ( TD_XY_t  x,
TD_XY_t  y,
TD_COLOR_t  fcol 
)

The dot is drawn in specified coordinates by the specified color code.

Parameters:
x[in] X coordinates
y[in] Y coordinates
fcol[in] Color-code (0 or 1 or COL_TRANS).
Returns:
none.

Definition at line 29 of file tinydraw.cpp.

void drawStr ( TD_POINT_t *  pnt,
char *  str,
TD_COLOR_PAIR_t col,
const struct font_desc *  fontdesc 
)

It draws in the string.

Parameters:
pnt[in] point of draw (upper left corner of font)
str[in] string (only use ASCII-CODE now)
col[in] Color-code.
fontdesc[in] font-descriptor.
Returns:
none.

Definition at line 87 of file tinydraw.cpp.

char * getCharImage ( int  c,
const struct font_desc *  fontdesc 
)

Get the bit map image of the font.

Parameters:
c[in] character code(only use ASCII-CODE now)
fontdesc[in] font-descriptor.
Returns:
pointer for bit map image.

Definition at line 56 of file tinydraw.cpp.

TD_COLOR_t * getVRAMPtr ( void   )

Get the top of framebuffer pointer.

Parameters:
none.
Returns:
pointer for top of framebuffer.

LICENSE

This source code is "GPLv2" license. The original of the font image is Linux kernel source. Because the Linux kernel license is "GPLv2 with the exception articles", this program also applies GPLv2.

Copyright (C) 2010 tosihisa

DESCRIPTION

Tiny library of drawing in framebuffer

Definition at line 20 of file tinydraw.cpp.

TD_COLOR_t * getVRAMPtr ( TD_POINT_t *  pnt )

Get the framebuffer pointer.

Parameters:
pnt[in] Coordinates.
Returns:
pointer for framebuffer.

Definition at line 24 of file tinydraw.cpp.