ugfx/include/graph.h

85 lines
2.3 KiB
C
Raw Normal View History

2012-10-23 22:12:50 +00:00
/*
ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
ChibiOS/GFX is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/GFX is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2012-11-03 01:56:59 +00:00
2012-10-31 00:14:11 +00:00
/**
2012-11-03 01:56:59 +00:00
* @file include/graph.h
2012-10-31 00:14:11 +00:00
* @brief GRAPH module header file.
*
* @addtogroup GRAPH
* @{
*/
2012-11-03 01:56:59 +00:00
2012-10-23 22:12:50 +00:00
#ifndef GRAPH_H
#define GRAPH_H
2012-10-24 20:51:25 +00:00
#ifndef GFX_USE_GRAPH
#define GFX_USE_GRAPH FALSE
#endif
2012-11-03 00:59:50 +00:00
#if GFX_USE_GRAPH || defined(__DOXYGEN__)
2012-10-23 22:12:50 +00:00
2012-10-31 00:14:11 +00:00
/*===========================================================================*/
/* Type definitions */
/*===========================================================================*/
2012-10-23 22:12:50 +00:00
typedef struct _Graph {
2012-10-24 19:05:23 +00:00
coord_t origin_x;
coord_t origin_y;
2012-10-24 20:51:25 +00:00
coord_t xmin;
coord_t xmax;
coord_t ymin;
coord_t ymax;
2012-10-23 22:12:50 +00:00
uint16_t grid_size;
2012-10-24 00:39:21 +00:00
uint16_t dot_space;
2012-10-23 22:12:50 +00:00
bool_t full_grid;
2012-10-24 19:05:23 +00:00
bool_t arrows;
2012-10-24 16:52:25 +00:00
color_t axis_color;
color_t grid_color;
2012-10-24 19:05:23 +00:00
/* do never modify values below this line manually */
coord_t x0;
coord_t x1;
coord_t y0;
coord_t y1;
2012-10-23 22:12:50 +00:00
} Graph;
2012-10-24 00:39:21 +00:00
#ifdef __cplusplus
extern "C" {
#endif
2012-10-31 00:14:11 +00:00
/*===========================================================================*/
/* Type definitions */
/*===========================================================================*/
2012-10-24 19:05:23 +00:00
void graphDrawSystem(Graph *g);
void graphDrawDot(Graph *g, coord_t x, coord_t y, uint16_t radius, color_t color);
2012-10-24 19:10:35 +00:00
void graphDrawDots(Graph *g, int coord[][2], uint16_t entries, uint16_t radius, uint16_t color);
void graphDrawNet(Graph *g, int coord[][2], uint16_t entries, uint16_t radius, uint16_t lineColor, uint16_t dotColor);
2012-10-24 16:59:52 +00:00
2012-10-24 00:39:21 +00:00
#ifdef __cplusplus
}
#endif
2012-10-23 22:12:50 +00:00
#endif /* GFX_USE_GRAPH */
#endif
2012-10-31 00:14:11 +00:00
/** @} */
2012-10-23 22:12:50 +00:00