-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b414731
commit 9887b2d
Showing
2 changed files
with
59 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,69 @@ | ||
/******************************************************************* | ||
Program to draw simple shapes to frame buffer on MicroZed | ||
based MZ_APO board designed by Petr Porazil at PiKRON | ||
draw_shapes.h - simple program to draw shapes | ||
(C) Copyright 2021 by Lukas Nejezchleb | ||
e-mail: nejezluk@fel.cvut.cz | ||
license: any combination of GPL, LGPL, MPL or BSD licenses | ||
*******************************************************************/ | ||
/** | ||
* @file draw_shapes.h | ||
* @author Lukas Nejezchleb (nejezluk@fel.cvut.cz) | ||
* @brief Module with functions to draw shapes to the frame buffer | ||
* @version 0.1 | ||
* @date 2021-05-04 | ||
* | ||
* @copyright Copyright (c) 2021 | ||
* | ||
*/ | ||
|
||
#ifndef DRAW_SHAPES_H | ||
#define DRAW_SHAPES_H | ||
#include "data_structures.h" | ||
|
||
/** | ||
* function to draw circle to fb_data frame at x,y with radius and color | ||
* @brief Draws the circle with center at x,y with given radius | ||
* | ||
* @param frame | ||
* @param x | ||
* @param y | ||
* @param radius | ||
* @param color | ||
*/ | ||
void draw_circle(fb_data *frame, int x, int y, int radius, uint16_t color); | ||
|
||
/** | ||
* function to draw rectangle to fb_data frame at x,y with width and height and color | ||
* @brief Draws rectangle with left upper corner at x,y | ||
* | ||
* @param frame | ||
* @param x | ||
* @param y | ||
* @param width | ||
* @param height | ||
* @param color | ||
*/ | ||
void draw_rectangle(fb_data *frame, int x, int y, int width, int height, uint16_t color); | ||
|
||
/** | ||
* sets background to certain color | ||
* @brief Draws given colour across the whole frame buffer | ||
* | ||
* @param frame | ||
* @param color | ||
*/ | ||
void set_background(fb_data *frame, uint16_t color); | ||
|
||
/** | ||
* draws the ghost shape to fb | ||
* @brief Draws an ghost at x,y, bitmap of ghost is also in this function | ||
* | ||
* @param frame | ||
* @param x | ||
* @param y | ||
* @param scale | ||
* @param color | ||
*/ | ||
void draw_ghost_shape(fb_data *frame, int x, int y, int scale, uint16_t color); | ||
|
||
|
||
/** | ||
* @brief Pacman facing given direction with his mouth | ||
* | ||
* @param frame | ||
* @param x | ||
* @param y | ||
* @param radius | ||
* @param color | ||
* @param direction | ||
*/ | ||
void draw_pacman_dir(fb_data *frame, int x, int y, int radius, uint16_t color, int direction); | ||
#endif |