libwallaby  v24
The wallaby standard library
graphics_characters.h
Go to the documentation of this file.
1 /*
2  * graphics_characters.h
3  *
4  * Created on: Feb 10, 2016
5  * Author: kipr
6  */
7 
8 #ifndef GRAPHICS_CHARACTERS_H_
9 #define GRAPHICS_CHARACTERS_H_
10 
25 // The number of segments in a character display
26 /* Segment arrangement
27  --0- -1-- ---18---- --20 21-- ---- ----
28  |\ | /| |\ 18 /| |\20 21/| || | /|
29  7 8 9 10 2 | \ | / | |24 | 26| ||\ 29 / |
30  | \|/ | | 17/ | 24 |/ 26 || 29|/ |
31  -15- -11- ---17---- ---- ---- |--- ----
32  | /|\ | | /|\ | 25 /|\ 27 |2 /|\ |
33  6 14 1 12 3 | / | \ | |25 | 27| |8 / | \ |
34  |/ 3 \| |/ 16 \| |/22 23\| || | \|
35  --5- -4-- ---16---- --22 23-- ---- ----
36  /
37  / (19)
38 */
39 
40 #define NUMSEG 30
41 // SEGL specifies the length of a vertical segment in pixels
42 #define SEGL 5
43 // SEGSP is the spacing of characters
44 #define SEGSP 7
45 // The width in pixels of the window
46 extern int __bold;
47 #define BOLD __bold=1;
48 #define NOBOLD __bold=0;
49 
50 #ifndef GXWINDOW
51  #define GXWINDOW 700
52 #endif
53 // The height of the window
54 #ifndef GYWINDOW
55  #define GYWINDOW 500
56 #endif
57 
58 // **************** Function Prototypes ******************
59 // Based on 16 segment characters: draws a segment for each s value that gets a 1 and a rectangle if the value is 2;
60 // the upper left corner starts at x,y; the color is defined by the vales of rgb; multiplier size resizes the character;
61 // there are added segments to provide for . : , ; and other non alphameric characters
62 // arrows (l,r,u,d) are specified by numbers 11 ,12, 13, 14
63 
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 
80  void graphics_segmentDisplay(int s[], int x, int y, int r, int g, int b, float size);
81  void g_segmentDisplay(int s[], int x, int y, int r, int g, int b, float size);
82 
83 
96  void graphics_printCharacter(int n, int x, int y, int r, int g, int b, float size);
97  void g_printCharacter(int n, int x, int y, int r, int g, int b, float size);
98 
99 
112  void graphics_printString(char s[], int x, int y, int r, int g, int b, float size);
113  void g_printString(char s[], int x, int y, int r, int g, int b, float size);
114 
115 
129  int graphics_printInt(int n, int minNumDigits, int x, int y, int r, int g, int b, float size);
130  int g_printInt(int n, int minNumDigits, int x, int y, int r, int g, int b, float size);
131 
132 
146  void graphics_printFloat(float n, int numDigits, int x, int y, int r, int g, int b, float size);
147  void g_printFloat(float n, int numDigits, int x, int y, int r, int g, int b, float size);
148 
149 
150 #ifdef __cplusplus
151 }
152 #endif
153 
154 
155 #endif /* GRAPHICS_CHARACTERS_H_ */
graphics_printString
void graphics_printString(char s[], int x, int y, int r, int g, int b, float size)
graphics_printCharacter
void graphics_printCharacter(int n, int x, int y, int r, int g, int b, float size)
g_printCharacter
void g_printCharacter(int n, int x, int y, int r, int g, int b, float size)
g_printInt
int g_printInt(int n, int minNumDigits, int x, int y, int r, int g, int b, float size)
graphics_segmentDisplay
void graphics_segmentDisplay(int s[], int x, int y, int r, int g, int b, float size)
graphics_printInt
int graphics_printInt(int n, int minNumDigits, int x, int y, int r, int g, int b, float size)
graphics_printFloat
void graphics_printFloat(float n, int numDigits, int x, int y, int r, int g, int b, float size)
g_printFloat
void g_printFloat(float n, int numDigits, int x, int y, int r, int g, int b, float size)
__bold
int __bold
g_segmentDisplay
void g_segmentDisplay(int s[], int x, int y, int r, int g, int b, float size)
g_printString
void g_printString(char s[], int x, int y, int r, int g, int b, float size)