Atmel Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Generic Implementation of Graphics Primitives

This is a library of generic implementations of various graphics primitives.

They are meant to simplify the implementation of the low-level graphics driver by providing generic implementations of primitives that aren't directly supported by the hardware.

Data Structures

struct  gfx_bitmap
 Storage structure for bitmap pixel data and metadata. More...
 

Typedefs

typedef void(* gfx_ext_draw_handler_t )(struct gfx_bitmap const *bmp, gfx_coord_t map_x, gfx_coord_t map_y, gfx_coord_t x, gfx_coord_t y)
 Function pointer type for external bitmap draw handlers. More...
 

Enumerations

enum  gfx_bitmap_type {
  GFX_BITMAP_SOLID,
  GFX_BITMAP_RAM,
  GFX_BITMAP_PROGMEM,
  GFX_BITMAP_EXT
}
 Valid bitmap types. More...
 

Functions

static __always_inline void gfx_generic_draw_bitmap (const struct gfx_bitmap *bmp, gfx_coord_t x, gfx_coord_t y)
 
void gfx_generic_draw_bitmap_tiled (const struct gfx_bitmap *bmp, gfx_coord_t x1, gfx_coord_t y1, gfx_coord_t x2, gfx_coord_t y2, gfx_coord_t tile_origin_x, gfx_coord_t tile_origin_y)
 
void gfx_generic_draw_circle (gfx_coord_t x, gfx_coord_t y, gfx_coord_t radius, gfx_color_t color, uint8_t octant_mask)
 
void gfx_generic_draw_filled_circle (gfx_coord_t x, gfx_coord_t y, gfx_coord_t radius, gfx_color_t color, uint8_t quadrant_mask)
 
void gfx_generic_draw_filled_rect (gfx_coord_t x, gfx_coord_t y, gfx_coord_t width, gfx_coord_t height, gfx_color_t color)
 
static __always_inline void gfx_generic_draw_horizontal_line (gfx_coord_t x, gfx_coord_t y, gfx_coord_t length, gfx_color_t color)
 
void gfx_generic_draw_line (gfx_coord_t x1, gfx_coord_t y1, gfx_coord_t x2, gfx_coord_t y2, gfx_color_t color)
 
static __always_inline void gfx_generic_draw_rect (gfx_coord_t x, gfx_coord_t y, gfx_coord_t width, gfx_coord_t height, gfx_color_t color)
 
static __always_inline void gfx_generic_draw_vertical_line (gfx_coord_t x, gfx_coord_t y, gfx_coord_t length, gfx_color_t color)
 
void gfx_generic_get_pixmap (gfx_color_t *pixmap, gfx_coord_t map_width, gfx_coord_t map_x, gfx_coord_t map_y, gfx_coord_t x, gfx_coord_t y, gfx_coord_t width, gfx_coord_t height)
 
void gfx_generic_put_bitmap (const struct gfx_bitmap *bmp, gfx_coord_t map_x, gfx_coord_t map_y, gfx_coord_t x, gfx_coord_t y, gfx_coord_t width, gfx_coord_t height)
 
void gfx_generic_put_pixmap (const gfx_color_t *pixmap, gfx_coord_t map_width, gfx_coord_t map_x, gfx_coord_t map_y, gfx_coord_t x, gfx_coord_t y, gfx_coord_t width, gfx_coord_t height)
 
void gfx_generic_set_ext_handler (gfx_ext_draw_handler_t gfx_ext_draw)
 
static __always_inline void gfx_generic_sync (void)
 

typedef void(* gfx_ext_draw_handler_t)(struct gfx_bitmap const *bmp, gfx_coord_t map_x, gfx_coord_t map_y, gfx_coord_t x, gfx_coord_t y)

Function pointer type for external bitmap draw handlers.

Parameters
bmpPointer to the bitmap.
map_xStart pos x.
map_yStart pos y.
xWidth length.
yHeight length.

Valid bitmap types.

Enumerator
GFX_BITMAP_SOLID 

Solid color bitmap

GFX_BITMAP_RAM 

Bitmap stored in SRAM

GFX_BITMAP_PROGMEM 

Bitmap stored in progmem

GFX_BITMAP_EXT 

Draw bitmap through extended interface

static __always_inline void gfx_generic_draw_bitmap ( const struct gfx_bitmap bmp,
gfx_coord_t  x,
gfx_coord_t  y 
)
static

Generic implementation of gfx_draw_bitmap().

References gfx_put_bitmap(), gfx_bitmap::height, and gfx_bitmap::width.

void gfx_generic_draw_bitmap_tiled ( const struct gfx_bitmap bmp,
gfx_coord_t  x1,
gfx_coord_t  y1,
gfx_coord_t  x2,
gfx_coord_t  y2,
gfx_coord_t  tile_origin_x,
gfx_coord_t  tile_origin_y 
)
void gfx_generic_draw_circle ( gfx_coord_t  x,
gfx_coord_t  y,
gfx_coord_t  radius,
gfx_color_t  color,
uint8_t  octant_mask 
)
void gfx_generic_draw_filled_circle ( gfx_coord_t  x,
gfx_coord_t  y,
gfx_coord_t  radius,
gfx_color_t  color,
uint8_t  quadrant_mask 
)
void gfx_generic_draw_filled_rect ( gfx_coord_t  x,
gfx_coord_t  y,
gfx_coord_t  width,
gfx_coord_t  height,
gfx_color_t  color 
)
static __always_inline void gfx_generic_draw_horizontal_line ( gfx_coord_t  x,
gfx_coord_t  y,
gfx_coord_t  length,
gfx_color_t  color 
)
static

Generic implementation of gfx_draw_horizontal_line().

References gfx_draw_filled_rect.

void gfx_generic_draw_line ( gfx_coord_t  x1,
gfx_coord_t  y1,
gfx_coord_t  x2,
gfx_coord_t  y2,
gfx_color_t  color 
)

Generic implementation of gfx_draw_line().

References gfx_draw_line_pixel(), gfx_height, gfx_set_bottom_right_limit(), gfx_width, i, x, and y.

static __always_inline void gfx_generic_draw_rect ( gfx_coord_t  x,
gfx_coord_t  y,
gfx_coord_t  width,
gfx_coord_t  height,
gfx_color_t  color 
)
static

Generic implementation of gfx_draw_rect().

References gfx_draw_horizontal_line, and gfx_draw_vertical_line.

static __always_inline void gfx_generic_draw_vertical_line ( gfx_coord_t  x,
gfx_coord_t  y,
gfx_coord_t  length,
gfx_color_t  color 
)
static

Generic implementation of gfx_draw_vertical_line().

References gfx_draw_filled_rect.

void gfx_generic_get_pixmap ( gfx_color_t pixmap,
gfx_coord_t  map_width,
gfx_coord_t  map_x,
gfx_coord_t  map_y,
gfx_coord_t  x,
gfx_coord_t  y,
gfx_coord_t  width,
gfx_coord_t  height 
)
void gfx_generic_put_pixmap ( const gfx_color_t pixmap,
gfx_coord_t  map_width,
gfx_coord_t  map_x,
gfx_coord_t  map_y,
gfx_coord_t  x,
gfx_coord_t  y,
gfx_coord_t  width,
gfx_coord_t  height 
)
void gfx_generic_set_ext_handler ( gfx_ext_draw_handler_t  gfx_ext_draw)

Generic implementation of setting external bitmap draw interface.

References gfx_ext_draw_func.

static __always_inline void gfx_generic_sync ( void  )
static

Generic implementation of gfx_sync().