Skip to content

Commit

Permalink
add doxygen comments
Browse files Browse the repository at this point in the history
  • Loading branch information
petrkucerak committed May 4, 2021
1 parent b414731 commit 9887b2d
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 30 deletions.
27 changes: 13 additions & 14 deletions draw_shapes.c
Original file line number Diff line number Diff line change
@@ -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 <stdlib.h>
Expand Down Expand Up @@ -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
Expand Down
62 changes: 46 additions & 16 deletions draw_shapes.h
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

0 comments on commit 9887b2d

Please sign in to comment.