#include <stdio.h>
#include <stdint.h>

extern double ox;
extern double oy;

long map(long x, long in_min, long in_max, long out_min, long out_max);
void swap(int16_t *xp, int16_t *yp); 
void GFX_fillTriangle ( int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
int GFX_ringMeter(int value, int vmin, int vmax, int x, int y, int r, uint8_t scheme);
unsigned int rainbow(uint8_t value);
void GFX_fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
void fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint16_t color);
void GFX_drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
void GFX_drawCircle(int16_t x0, int16_t y0, int16_t r,uint16_t color);
void drawCircleHelper( int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint16_t color);
void GFX_Graph(double x, double y, double gx, double gy, double w, double h, double xlo, double xhi, double xinc, double ylo, double yhi, double yinc, uint8_t title[], uint8_t xlabel[], uint8_t ylabel[], unsigned int gcolor, unsigned int acolor, unsigned int pcolor, unsigned int tcolor, unsigned int bcolor, uint8_t redraw);
void DrawDial(int cx, int cy, int r, double loval , double hival , double inc, double sa, double curval,  int dig , int dec, unsigned int needlecolor, unsigned int dialcolor, unsigned int  textcolor, uint8_t label[], uint8_t redraw);
void GFX_graf(uint32_t x, uint32_t y, uint32_t xmax, uint32_t ymax, uint32_t ymin, uint8_t xdiv, uint8_t ydiv, uint16_t xpos, uint16_t ypos, uint16_t width, uint16_t height, uint8_t xlabel[], uint8_t ylabel[],uint8_t redraw, uint16_t color);