This is a service providing generic implementations of graphic primitives.
it also provides functionality to draw a bitmap to the graphic memory.
These functions are made available if the graphic hardware being used do not implement the functionality in hardware. This is true in most cases.
This service is included as a requirement for a hardware specific component that uses these functions, and provides a asfdoc_common2_draw_pixel function.
Data Structures | |
struct | gfx_mono_bitmap |
Storage structure for bitmap pixel data and metadata. More... | |
Functions | |
void | gfx_mono_generic_draw_circle (gfx_coord_t x, gfx_coord_t y, gfx_coord_t radius, enum gfx_mono_color color, uint8_t octant_mask) |
Draw an outline of a circle or arc (generic implementation). More... | |
void | gfx_mono_generic_draw_filled_circle (gfx_coord_t x, gfx_coord_t y, gfx_coord_t radius, enum gfx_mono_color color, uint8_t quadrant_mask) |
Draw a filled circle or sector (generic implementation). More... | |
void | gfx_mono_generic_draw_filled_rect (gfx_coord_t x, gfx_coord_t y, gfx_coord_t width, gfx_coord_t height, enum gfx_mono_color color) |
Draw a filled rectangle (generic implementation). More... | |
void | gfx_mono_generic_draw_line (gfx_coord_t x1, gfx_coord_t y1, gfx_coord_t x2, gfx_coord_t y2, enum gfx_mono_color color) |
Draw a line between two arbitrary points (generic implementation). More... | |
void | gfx_mono_generic_draw_rect (gfx_coord_t x, gfx_coord_t y, gfx_coord_t width, gfx_coord_t height, enum gfx_mono_color color) |
Draw an outline of a rectangle (generic implementation). More... | |
void | gfx_mono_generic_draw_vertical_line (gfx_coord_t x, gfx_coord_t y, gfx_coord_t length, enum gfx_mono_color color) |
Draw a vertical line, one pixel wide (generic implementation) More... | |
void | gfx_mono_generic_put_bitmap (struct gfx_mono_bitmap *bitmap, gfx_coord_t x, gfx_coord_t y) |
Put bitmap from FLASH or RAM to display. More... | |
void | gfx_mono_generic_draw_horizontal_line (gfx_coord_t x, gfx_coord_t y, gfx_coord_t length, enum gfx_mono_color color) |
Draw a horizontal line, one pixel wide (generic implementation) More... | |
void gfx_mono_generic_draw_circle | ( | gfx_coord_t | x, |
gfx_coord_t | y, | ||
gfx_coord_t | radius, | ||
enum gfx_mono_color | color, | ||
uint8_t | octant_mask | ||
) |
Draw an outline of a circle or arc (generic implementation).
The radius is the distance from the center to the circumference, which means that the total width or height of a circle will be (radius*2+1).
The octant_mask parameter is a bitmask that decides which octants of the circle to draw. Use the GFX_OCTANTn, GFX_QUADRANTn, GFX_xHALF and GFX_WHOLE constants and OR them together if required. Radius equal to zero gives a single pixel.
[in] | x | X coordinate of center. |
[in] | y | Y coordinate of center. |
[in] | radius | Circle radius in pixels. |
[in] | color | Pixel operation. |
[in] | octant_mask | Bitmask indicating which octants to draw. |
References gfx_mono_draw_pixel, GFX_OCTANT0, GFX_OCTANT1, GFX_OCTANT2, GFX_OCTANT3, GFX_OCTANT4, GFX_OCTANT5, GFX_OCTANT6, and GFX_OCTANT7.
void gfx_mono_generic_draw_filled_circle | ( | gfx_coord_t | x, |
gfx_coord_t | y, | ||
gfx_coord_t | radius, | ||
enum gfx_mono_color | color, | ||
uint8_t | quadrant_mask | ||
) |
Draw a filled circle or sector (generic implementation).
The radius is the distance from the center to the circumference, which means that the total width or height of a circle will be (radius*2+1).
The quadrant_mask parameter is a bitmask that decides which quadrants of the circle to draw. Use the GFX_QUADRANTn, GFX_xHALF and GFX_WHOLE constants and OR them together if required. Radius equal to zero gives a single pixel.
[in] | x | X coordinate of center. |
[in] | y | Y coordinate of center. |
[in] | radius | Circle radius in pixels. |
[in] | color | Pixel operation. |
[in] | quadrant_mask | Bitmask indicating which quadrants to draw. |
References gfx_mono_draw_pixel, gfx_mono_draw_vertical_line, GFX_QUADRANT0, GFX_QUADRANT1, GFX_QUADRANT2, and GFX_QUADRANT3.
void gfx_mono_generic_draw_filled_rect | ( | gfx_coord_t | x, |
gfx_coord_t | y, | ||
gfx_coord_t | width, | ||
gfx_coord_t | height, | ||
enum gfx_mono_color | color | ||
) |
Draw a filled rectangle (generic implementation).
[in] | x | X coordinate of the left side. |
[in] | y | Y coordinate of the top side. |
[in] | width | Width of the rectangle. |
[in] | height | Height of the rectangle. |
[in] | color | Pixel operation of the line |
References gfx_mono_draw_horizontal_line.
void gfx_mono_generic_draw_horizontal_line | ( | gfx_coord_t | x, |
gfx_coord_t | y, | ||
gfx_coord_t | length, | ||
enum gfx_mono_color | color | ||
) |
Draw a horizontal line, one pixel wide (generic implementation)
[in] | x | X coordinate of leftmost pixel. |
[in] | y | Y coordinate of the line. |
[in] | length | Length of the line in pixels. |
[in] | color | Pixel operation of the line. |
References gfx_mono_get_byte, GFX_MONO_LCD_WIDTH, gfx_mono_put_byte, GFX_PIXEL_CLR, GFX_PIXEL_SET, and GFX_PIXEL_XOR.
void gfx_mono_generic_draw_line | ( | gfx_coord_t | x1, |
gfx_coord_t | y1, | ||
gfx_coord_t | x2, | ||
gfx_coord_t | y2, | ||
enum gfx_mono_color | color | ||
) |
Draw a line between two arbitrary points (generic implementation).
[in] | x1 | Start X coordinate. |
[in] | y1 | Start Y coordinate. |
[in] | x2 | End X coordinate. |
[in] | y2 | End Y coordinate. |
[in] | color | Pixel operation of the line. |
References gfx_mono_draw_pixel, and i.
void gfx_mono_generic_draw_rect | ( | gfx_coord_t | x, |
gfx_coord_t | y, | ||
gfx_coord_t | width, | ||
gfx_coord_t | height, | ||
enum gfx_mono_color | color | ||
) |
Draw an outline of a rectangle (generic implementation).
[in] | x | X coordinate of the left side. |
[in] | y | Y coordinate of the top side. |
[in] | width | Width of the rectangle. |
[in] | height | Height of the rectangle. |
[in] | color | Pixel operation of the line. |
References gfx_mono_draw_horizontal_line, and gfx_mono_draw_vertical_line.
void gfx_mono_generic_draw_vertical_line | ( | gfx_coord_t | x, |
gfx_coord_t | y, | ||
gfx_coord_t | length, | ||
enum gfx_mono_color | color | ||
) |
Draw a vertical line, one pixel wide (generic implementation)
[in] | x | X coordinate of the line. |
[in] | y | Y coordinate of the topmost pixel. |
[in] | length | Length of the line in pixels. |
[in] | color | Pixel operation of the line. |
References gfx_mono_draw_pixel, GFX_MONO_LCD_HEIGHT, and gfx_mono_mask_byte.
void gfx_mono_generic_put_bitmap | ( | struct gfx_mono_bitmap * | bitmap, |
gfx_coord_t | x, | ||
gfx_coord_t | y | ||
) |
Put bitmap from FLASH or RAM to display.
This function will output bitmap data from FLASH or RAM. The bitmap y-coordinate will be aligned with display pages, rounded down. Ie: placing a bitmap at x=10, y=5 will put the bitmap at x = 10,y = 0 and placing a bitmap at x = 10, y = 10 will put the bitmap at x = 10, y = 8
References gfx_mono_bitmap::data, GFX_MONO_BITMAP_PROGMEM, GFX_MONO_BITMAP_RAM, gfx_mono_put_byte, gfx_mono_put_page, gfx_mono_bitmap::height, i, gfx_mono_bitmap::pixmap, gfx_mono_bitmap::progmem, PROGMEM_READ_BYTE, gfx_mono_bitmap::type, and gfx_mono_bitmap::width.