From 9887b2df18b40bdcc6a63700d2271481efb26096 Mon Sep 17 00:00:00 2001 From: Petr Kucera Date: Tue, 4 May 2021 22:33:40 +0200 Subject: [PATCH] add doxygen comments --- draw_shapes.c | 27 +++++++++++----------- draw_shapes.h | 62 ++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 59 insertions(+), 30 deletions(-) diff --git a/draw_shapes.c b/draw_shapes.c index cc9fcc3..a88c430 100644 --- a/draw_shapes.c +++ b/draw_shapes.c @@ -1,14 +1,13 @@ -/******************************************************************* - Program to draw simple shapes to frame buffer on MicroZed - based MZ_APO board designed by Petr Porazil at PiKRON - - draw_shapes.c - 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.c + * @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 + * + */ #include "draw_shapes.h" #include @@ -64,9 +63,9 @@ void set_background(fb_data *frame, uint16_t color) void draw_ghost_shape(fb_data *frame, int x, int y, int scale, uint16_t color) { - //offset x and y so the ghost would be centered around - x = x - scale * 4; //4 is half of bitsize of uint8_t - y = y - scale * 4; //4 is half of height of ghost bitmap + // offset x and y so the ghost would be centered around + x = x - scale * 4; // 4 is half of bitsize of uint8_t + y = y - scale * 4; // 4 is half of height of ghost bitmap uint8_t ghost_bitmap[] = {0x3c, 0x7e, 0x7e, 0xdb, 0xff, 0xff, 0xff, 0xdb}; /* xxxx diff --git a/draw_shapes.h b/draw_shapes.h index 91f3818..f8137a7 100644 --- a/draw_shapes.h +++ b/draw_shapes.h @@ -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