You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(23) |
Dec
(26) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(2) |
Feb
(7) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(7) |
Sep
(8) |
Oct
(5) |
Nov
(11) |
Dec
(2) |
| 2008 |
Jan
(8) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
| 2009 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(16) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ane...@us...> - 2006-11-28 21:58:49
|
Revision: 194
http://svn.sourceforge.net/g15tools/?rev=194&view=rev
Author: aneurysm9
Date: 2006-11-28 13:58:48 -0800 (Tue, 28 Nov 2006)
Log Message:
-----------
update README and man page
Modified Paths:
--------------
trunk/g15composer/README
trunk/g15composer/doc/g15composer.1
Modified: trunk/g15composer/README
===================================================================
--- trunk/g15composer/README 2006-11-26 07:21:06 UTC (rev 193)
+++ trunk/g15composer/README 2006-11-28 21:58:48 UTC (rev 194)
@@ -73,12 +73,20 @@
F is optional and defaults to F=0
Note that the syntax has changed, the position of C and F has been swapped
-
DB X1 Y1 X2 Y2 C N M T
Draws a percentage or progress bar from (X1,Y1) to (X2,Y2) using color C
The bar will be filled with N units out of M
T sets the type of the bar, valid values are 1, 2, or 3
T is optional and defaults to T=1
+
+DN X1 Y1 X2 Y2 C N
+ Draws a big number N in the area bounded by (X1,Y2) and (X2,Y2) using color C
+
+*** WBMP Commands:
+
+WS "/path/to/image"
+ Loads a WBMP image from /path/to/image and displays it on the screen
+ Image must be 160x43 as it is loaded directly into the LCD buffer
*** Mode Commands:
Modified: trunk/g15composer/doc/g15composer.1
===================================================================
--- trunk/g15composer/doc/g15composer.1 2006-11-26 07:21:06 UTC (rev 193)
+++ trunk/g15composer/doc/g15composer.1 2006-11-28 21:58:48 UTC (rev 194)
@@ -88,6 +88,15 @@
T sets the type of the bar, valid values are 1, 2, or 3
T is optional and defaults to T=1
+DN X1 Y1 X2 Y2 C N
+ Draws a big number N in the area bounded by (X1,Y2) and (X2,Y2) using color C
+
+*** WBMP Commands:
+
+WS "/path/to/image"
+ Loads a WBMP image from /path/to/image and displays it on the screen
+ Image must be 160x43 as it is loaded directly into the LCD buffer
+
*** Mode Commands:
MC 0|1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-26 07:21:07
|
Revision: 193
http://svn.sourceforge.net/g15tools/?rev=193&view=rev
Author: aneurysm9
Date: 2006-11-25 23:21:06 -0800 (Sat, 25 Nov 2006)
Log Message:
-----------
minor cleanups
Modified Paths:
--------------
trunk/g15composer/g15composer.c
Modified: trunk/g15composer/g15composer.c
===================================================================
--- trunk/g15composer/g15composer.c 2006-11-26 07:17:40 UTC (rev 192)
+++ trunk/g15composer/g15composer.c 2006-11-26 07:21:06 UTC (rev 193)
@@ -63,6 +63,7 @@
fprintf (stderr, "Error: Could not create FIFO %s, aborting.\n", param->fifo_filename);
param->leaving = 1;
param->keepFifo = 1;
+ free (param);
pthread_exit (NULL);
}
chmod (param->fifo_filename, mode);
@@ -113,13 +114,19 @@
if (!param->background)
{
- g15_close_screen (param->g15screen_fd);
- free (param->canvas);
+ if (param->g15screen_fd)
+ g15_close_screen (param->g15screen_fd);
+ if (param->canvas != NULL)
+ free (param->canvas);
}
+
yylex_destroy (param->scanner);
+
if (param->keepFifo == 0)
unlink (param->fifo_filename);
+
free (param);
+
pthread_exit(NULL);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-26 07:17:40
|
Revision: 192
http://svn.sourceforge.net/g15tools/?rev=192&view=rev
Author: aneurysm9
Date: 2006-11-25 23:17:40 -0800 (Sat, 25 Nov 2006)
Log Message:
-----------
update fifo error handling
Modified Paths:
--------------
trunk/g15composer/g15composer.c
Modified: trunk/g15composer/g15composer.c
===================================================================
--- trunk/g15composer/g15composer.c 2006-11-26 07:04:07 UTC (rev 191)
+++ trunk/g15composer/g15composer.c 2006-11-26 07:17:40 UTC (rev 192)
@@ -60,9 +60,10 @@
mode_t mode = S_IRUSR | S_IWUSR | S_IWGRP | S_IWOTH;
if (mkfifo (param->fifo_filename, mode))
{
- fprintf (stderr, "Error: Could not create FIFO %s, aborting", param->fifo_filename);
+ fprintf (stderr, "Error: Could not create FIFO %s, aborting.\n", param->fifo_filename);
param->leaving = 1;
param->keepFifo = 1;
+ pthread_exit (NULL);
}
chmod (param->fifo_filename, mode);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-26 07:04:08
|
Revision: 191
http://svn.sourceforge.net/g15tools/?rev=191&view=rev
Author: aneurysm9
Date: 2006-11-25 23:04:07 -0800 (Sat, 25 Nov 2006)
Log Message:
-----------
add DRAWNUM and WBMPSPLASH commands to g15composer
Modified Paths:
--------------
trunk/g15composer/g15composer.c
trunk/g15composer/g15composer.l
trunk/g15composer/g15composer.y
Modified: trunk/g15composer/g15composer.c
===================================================================
--- trunk/g15composer/g15composer.c 2006-11-20 10:57:23 UTC (rev 190)
+++ trunk/g15composer/g15composer.c 2006-11-26 07:04:07 UTC (rev 191)
@@ -119,7 +119,7 @@
if (param->keepFifo == 0)
unlink (param->fifo_filename);
free (param);
- pthread_exit(pthread_self());
+ pthread_exit(NULL);
}
int
Modified: trunk/g15composer/g15composer.l
===================================================================
--- trunk/g15composer/g15composer.l 2006-11-20 10:57:23 UTC (rev 190)
+++ trunk/g15composer/g15composer.l 2006-11-26 07:04:07 UTC (rev 191)
@@ -43,6 +43,11 @@
^DC return T_DRAWCIRCLE;
^DR return T_DRAWRBOX;
^DB return T_DRAWBAR;
+^DN return T_DRAWNUM;
+^DI return T_DRAWICON;
+^DS return T_DRAWSPRITE;
+^WS return T_WBMPSPLASH;
+^WL return T_WBMPLOAD;
^MC return T_MODECACHE;
^MR return T_MODEREV;
^MX return T_MODEXOR;
Modified: trunk/g15composer/g15composer.y
===================================================================
--- trunk/g15composer/g15composer.y 2006-11-20 10:57:23 UTC (rev 190)
+++ trunk/g15composer/g15composer.y 2006-11-26 07:04:07 UTC (rev 191)
@@ -61,6 +61,11 @@
%token T_DRAWCIRCLE
%token T_DRAWRBOX
%token T_DRAWBAR
+%token T_DRAWNUM
+%token T_DRAWICON
+%token T_DRAWSPRITE
+%token T_WBMPSPLASH
+%token T_WBMPLOAD
%token T_MODECACHE
%token T_MODEREV
%token T_MODEXOR
@@ -102,6 +107,7 @@
nt_command:
nt_pixel_command
| nt_draw_command
+ | nt_wbmp_command
| nt_mode_command
| nt_font_command
| nt_text_command
@@ -257,6 +263,15 @@
}
|
+
+ T_DRAWNUM T_NUMBER T_NUMBER T_NUMBER T_NUMBER T_NUMBER T_NUMBER T_NEWLINE
+ {
+ if (((struct parserData *)param)->background == 1)
+ return (0);
+ g15r_drawBigNum (((struct parserData *)param)->canvas, $2, $3, $4, $5, $6, $7);
+ }
+
+ |
nt_drawcircle
|
nt_drawrbox
@@ -318,6 +333,15 @@
}
;
+nt_wbmp_command:
+ T_WBMPSPLASH nt_string T_NEWLINE
+ {
+ if (((struct parserData *)param)->background == 1)
+ return (0);
+ g15r_loadWbmpSplash (((struct parserData *)param)->canvas, $2);
+ }
+ ;
+
nt_mode_command:
T_MODECACHE T_NUMBER T_NEWLINE
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-19 21:35:30
|
Revision: 188
http://svn.sourceforge.net/g15tools/?rev=188&view=rev
Author: aneurysm9
Date: 2006-11-19 13:35:27 -0800 (Sun, 19 Nov 2006)
Log Message:
-----------
enable drawing white bignums
Modified Paths:
--------------
trunk/libg15render/libg15render.h
trunk/libg15render/pixel.c
trunk/testlibg15render/testlibg15render.cpp
Modified: trunk/libg15render/libg15render.h
===================================================================
--- trunk/libg15render/libg15render.h 2006-11-19 21:21:29 UTC (rev 187)
+++ trunk/libg15render/libg15render.h 2006-11-19 21:35:27 UTC (rev 188)
@@ -80,7 +80,7 @@
/** \brief Load a wbmp file into a buffer*/
int g15r_loadWbmpToBuf(char *buf, char *filename, int *img_width, int *img_height, int maxlen);
/** \brief Draw a large number*/
-void g15r_drawBigNum (g15canvas * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int num);
+void g15r_drawBigNum (g15canvas * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int color, int num);
/** \brief Gets the value of the pixel at (x, y)*/
int g15r_getPixel (g15canvas * canvas, unsigned int x, unsigned int y);
Modified: trunk/libg15render/pixel.c
===================================================================
--- trunk/libg15render/pixel.c 2006-11-19 21:21:29 UTC (rev 187)
+++ trunk/libg15render/pixel.c 2006-11-19 21:35:27 UTC (rev 188)
@@ -539,68 +539,68 @@
* \param num The number to be drawn.
*/
void
-g15r_drawBigNum (g15canvas * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int num)
+g15r_drawBigNum (g15canvas * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int color, int num)
{
x1 += 2;
x2 -= 2;
switch(num){
case 0:
- g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
- g15r_pixelBox (canvas, x1 +5, y1 +5, x2 -5, y2 - 6, G15_COLOR_WHITE, 1, 1);
+ g15r_pixelBox (canvas, x1, y1, x2, y2 , color, 1, 1);
+ g15r_pixelBox (canvas, x1 +5, y1 +5, x2 -5, y2 - 6, 1 - color, 1, 1);
break;
case 1:
- g15r_pixelBox (canvas, x2-5, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
- g15r_pixelBox (canvas, x1, y1, x2 -5, y2, G15_COLOR_WHITE, 1, 1);
+ g15r_pixelBox (canvas, x2-5, y1, x2, y2 , color, 1, 1);
+ g15r_pixelBox (canvas, x1, y1, x2 -5, y2, 1 - color, 1, 1);
break;
case 2:
- g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
- g15r_pixelBox (canvas, x1, y1+5, x2 -5, y1+((y2/2)-3), G15_COLOR_WHITE, 1, 1);
- g15r_pixelBox (canvas, x1+5, y1+((y2/2)+3), x2 , y2-6, G15_COLOR_WHITE, 1, 1);
+ g15r_pixelBox (canvas, x1, y1, x2, y2 , color, 1, 1);
+ g15r_pixelBox (canvas, x1, y1+5, x2 -5, y1+((y2/2)-3), 1 - color, 1, 1);
+ g15r_pixelBox (canvas, x1+5, y1+((y2/2)+3), x2 , y2-6, 1 - color, 1, 1);
break;
case 3:
- g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
- g15r_pixelBox (canvas, x1, y1+5, x2 -5, y1+((y2/2)-3), G15_COLOR_WHITE, 1, 1);
- g15r_pixelBox (canvas, x1, y1+((y2/2)+3), x2-5 , y2-6, G15_COLOR_WHITE, 1, 1);
+ g15r_pixelBox (canvas, x1, y1, x2, y2 , color, 1, 1);
+ g15r_pixelBox (canvas, x1, y1+5, x2 -5, y1+((y2/2)-3), 1 - color, 1, 1);
+ g15r_pixelBox (canvas, x1, y1+((y2/2)+3), x2-5 , y2-6, 1 - color, 1, 1);
break;
case 4:
- g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
- g15r_pixelBox (canvas, x1, y1+((y2/2)+3), x2 -5, y2, G15_COLOR_WHITE, 1, 1);
- g15r_pixelBox (canvas, x1+5, y1, x2-5 , y1+((y2/2)-3), G15_COLOR_WHITE, 1, 1);
+ g15r_pixelBox (canvas, x1, y1, x2, y2 , color, 1, 1);
+ g15r_pixelBox (canvas, x1, y1+((y2/2)+3), x2 -5, y2, 1 - color, 1, 1);
+ g15r_pixelBox (canvas, x1+5, y1, x2-5 , y1+((y2/2)-3), 1 - color, 1, 1);
break;
case 5:
- g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
- g15r_pixelBox (canvas, x1+5, y1+5, x2 , y1+((y2/2)-3), G15_COLOR_WHITE, 1, 1);
- g15r_pixelBox (canvas, x1, y1+((y2/2)+3), x2-5 , y2-6, G15_COLOR_WHITE, 1, 1);
+ g15r_pixelBox (canvas, x1, y1, x2, y2 , color, 1, 1);
+ g15r_pixelBox (canvas, x1+5, y1+5, x2 , y1+((y2/2)-3), 1 - color, 1, 1);
+ g15r_pixelBox (canvas, x1, y1+((y2/2)+3), x2-5 , y2-6, 1 - color, 1, 1);
break;
case 6:
- g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
- g15r_pixelBox (canvas, x1+5, y1+5, x2 , y1+((y2/2)-3), G15_COLOR_WHITE, 1, 1);
- g15r_pixelBox (canvas, x1+5, y1+((y2/2)+3), x2-5 , y2-6, G15_COLOR_WHITE, 1, 1);
+ g15r_pixelBox (canvas, x1, y1, x2, y2 , color, 1, 1);
+ g15r_pixelBox (canvas, x1+5, y1+5, x2 , y1+((y2/2)-3), 1 - color, 1, 1);
+ g15r_pixelBox (canvas, x1+5, y1+((y2/2)+3), x2-5 , y2-6, 1 - color, 1, 1);
break;
case 7:
- g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
- g15r_pixelBox (canvas, x1, y1+5, x2 -5, y2, G15_COLOR_WHITE, 1, 1);
+ g15r_pixelBox (canvas, x1, y1, x2, y2 , color, 1, 1);
+ g15r_pixelBox (canvas, x1, y1+5, x2 -5, y2, 1 - color, 1, 1);
break;
case 8:
- g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
- g15r_pixelBox (canvas, x1+5, y1+5, x2-5 , y1+((y2/2)-3), G15_COLOR_WHITE, 1, 1);
- g15r_pixelBox (canvas, x1+5, y1+((y2/2)+3), x2-5 , y2-6, G15_COLOR_WHITE, 1, 1);
+ g15r_pixelBox (canvas, x1, y1, x2, y2 , color, 1, 1);
+ g15r_pixelBox (canvas, x1+5, y1+5, x2-5 , y1+((y2/2)-3), 1 - color, 1, 1);
+ g15r_pixelBox (canvas, x1+5, y1+((y2/2)+3), x2-5 , y2-6, 1 - color, 1, 1);
break;
case 9:
- g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
- g15r_pixelBox (canvas, x1+5, y1+5, x2-5 , y1+((y2/2)-3), G15_COLOR_WHITE, 1, 1);
- g15r_pixelBox (canvas, x1, y1+((y2/2)+3), x2-5 , y2, G15_COLOR_WHITE, 1, 1);
+ g15r_pixelBox (canvas, x1, y1, x2, y2 , color, 1, 1);
+ g15r_pixelBox (canvas, x1+5, y1+5, x2-5 , y1+((y2/2)-3), 1 - color, 1, 1);
+ g15r_pixelBox (canvas, x1, y1+((y2/2)+3), x2-5 , y2, 1 - color, 1, 1);
break;
case 10:
- g15r_pixelBox (canvas, x2-5, y1+5, x2, y1+10 , G15_COLOR_BLACK, 1, 1);
- g15r_pixelBox (canvas, x2-5, y2-10, x2, y2-5 , G15_COLOR_BLACK, 1, 1);
+ g15r_pixelBox (canvas, x2-5, y1+5, x2, y1+10 , color, 1, 1);
+ g15r_pixelBox (canvas, x2-5, y2-10, x2, y2-5 , color, 1, 1);
break;
case 11:
- g15r_pixelBox (canvas, x1, y1+((y2/2)-2), x2, y1+((y2/2)+2), G15_COLOR_BLACK, 1, 1);
+ g15r_pixelBox (canvas, x1, y1+((y2/2)-2), x2, y1+((y2/2)+2), color, 1, 1);
break;
case 12:
- g15r_pixelBox (canvas, x2-5, y2-5, x2, y2 , G15_COLOR_BLACK, 1, 1);
+ g15r_pixelBox (canvas, x2-5, y2-5, x2, y2 , color, 1, 1);
break;
}
}
Modified: trunk/testlibg15render/testlibg15render.cpp
===================================================================
--- trunk/testlibg15render/testlibg15render.cpp 2006-11-19 21:21:29 UTC (rev 187)
+++ trunk/testlibg15render/testlibg15render.cpp 2006-11-19 21:35:27 UTC (rev 188)
@@ -174,10 +174,17 @@
sleep (3);
g15r_clearScreen (canvas, 0);
- g15r_drawBigNum (canvas, 0, 0, 20, 22, 3);
- g15r_drawBigNum (canvas, 25, 0, 45, 42, 0);
+ g15r_drawBigNum (canvas, 0, 0, 20, 22, G15_COLOR_BLACK, 3);
+ g15r_drawBigNum (canvas, 25, 0, 45, 42, G15_COLOR_BLACK, 0);
updateScreen ();
sleep (3);
+ g15r_clearScreen (canvas, 1);
+ g15r_drawBigNum (canvas, 0, 0, 20, 22, G15_COLOR_WHITE, 4);
+ g15r_drawBigNum (canvas, 25, 0, 45, 42, G15_COLOR_WHITE, 7);
+ updateScreen ();
+ sleep (3);
+
+
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-19 21:21:29
|
Revision: 187
http://svn.sourceforge.net/g15tools/?rev=187&view=rev
Author: aneurysm9
Date: 2006-11-19 13:21:29 -0800 (Sun, 19 Nov 2006)
Log Message:
-----------
fix g15r_drawBigNum to use int rather than int-as-char for num
Modified Paths:
--------------
trunk/libg15render/pixel.c
trunk/testlibg15render/testlibg15render.cpp
Modified: trunk/libg15render/pixel.c
===================================================================
--- trunk/libg15render/pixel.c 2006-11-19 11:24:46 UTC (rev 186)
+++ trunk/libg15render/pixel.c 2006-11-19 21:21:29 UTC (rev 187)
@@ -545,63 +545,63 @@
x2 -= 2;
switch(num){
- case 45:
- g15r_pixelBox (canvas, x1, y1+((y2/2)-2), x2, y1+((y2/2)+2), G15_COLOR_BLACK, 1, 1);
- break;
- case 46:
- g15r_pixelBox (canvas, x2-5, y2-5, x2, y2 , G15_COLOR_BLACK, 1, 1);
- break;
- case 48:
+ case 0:
g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
g15r_pixelBox (canvas, x1 +5, y1 +5, x2 -5, y2 - 6, G15_COLOR_WHITE, 1, 1);
break;
- case 49:
+ case 1:
g15r_pixelBox (canvas, x2-5, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
g15r_pixelBox (canvas, x1, y1, x2 -5, y2, G15_COLOR_WHITE, 1, 1);
break;
- case 50:
+ case 2:
g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
g15r_pixelBox (canvas, x1, y1+5, x2 -5, y1+((y2/2)-3), G15_COLOR_WHITE, 1, 1);
g15r_pixelBox (canvas, x1+5, y1+((y2/2)+3), x2 , y2-6, G15_COLOR_WHITE, 1, 1);
break;
- case 51:
+ case 3:
g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
g15r_pixelBox (canvas, x1, y1+5, x2 -5, y1+((y2/2)-3), G15_COLOR_WHITE, 1, 1);
g15r_pixelBox (canvas, x1, y1+((y2/2)+3), x2-5 , y2-6, G15_COLOR_WHITE, 1, 1);
break;
- case 52:
+ case 4:
g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
g15r_pixelBox (canvas, x1, y1+((y2/2)+3), x2 -5, y2, G15_COLOR_WHITE, 1, 1);
g15r_pixelBox (canvas, x1+5, y1, x2-5 , y1+((y2/2)-3), G15_COLOR_WHITE, 1, 1);
break;
- case 53:
+ case 5:
g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
g15r_pixelBox (canvas, x1+5, y1+5, x2 , y1+((y2/2)-3), G15_COLOR_WHITE, 1, 1);
g15r_pixelBox (canvas, x1, y1+((y2/2)+3), x2-5 , y2-6, G15_COLOR_WHITE, 1, 1);
break;
- case 54:
+ case 6:
g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
g15r_pixelBox (canvas, x1+5, y1+5, x2 , y1+((y2/2)-3), G15_COLOR_WHITE, 1, 1);
g15r_pixelBox (canvas, x1+5, y1+((y2/2)+3), x2-5 , y2-6, G15_COLOR_WHITE, 1, 1);
break;
- case 55:
+ case 7:
g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
g15r_pixelBox (canvas, x1, y1+5, x2 -5, y2, G15_COLOR_WHITE, 1, 1);
break;
- case 56:
+ case 8:
g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
g15r_pixelBox (canvas, x1+5, y1+5, x2-5 , y1+((y2/2)-3), G15_COLOR_WHITE, 1, 1);
g15r_pixelBox (canvas, x1+5, y1+((y2/2)+3), x2-5 , y2-6, G15_COLOR_WHITE, 1, 1);
break;
- case 57:
+ case 9:
g15r_pixelBox (canvas, x1, y1, x2, y2 , G15_COLOR_BLACK, 1, 1);
g15r_pixelBox (canvas, x1+5, y1+5, x2-5 , y1+((y2/2)-3), G15_COLOR_WHITE, 1, 1);
g15r_pixelBox (canvas, x1, y1+((y2/2)+3), x2-5 , y2, G15_COLOR_WHITE, 1, 1);
break;
- case 58:
+ case 10:
g15r_pixelBox (canvas, x2-5, y1+5, x2, y1+10 , G15_COLOR_BLACK, 1, 1);
g15r_pixelBox (canvas, x2-5, y2-10, x2, y2-5 , G15_COLOR_BLACK, 1, 1);
break;
+ case 11:
+ g15r_pixelBox (canvas, x1, y1+((y2/2)-2), x2, y1+((y2/2)+2), G15_COLOR_BLACK, 1, 1);
+ break;
+ case 12:
+ g15r_pixelBox (canvas, x2-5, y2-5, x2, y2 , G15_COLOR_BLACK, 1, 1);
+ break;
}
}
Modified: trunk/testlibg15render/testlibg15render.cpp
===================================================================
--- trunk/testlibg15render/testlibg15render.cpp 2006-11-19 11:24:46 UTC (rev 186)
+++ trunk/testlibg15render/testlibg15render.cpp 2006-11-19 21:21:29 UTC (rev 187)
@@ -174,8 +174,8 @@
sleep (3);
g15r_clearScreen (canvas, 0);
- g15r_drawBigNum (canvas, 0, 0, 20, 22, '3');
- g15r_drawBigNum (canvas, 25, 0, 45, 42, '0');
+ g15r_drawBigNum (canvas, 0, 0, 20, 22, 3);
+ g15r_drawBigNum (canvas, 25, 0, 45, 42, 0);
updateScreen ();
sleep (3);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-19 11:24:47
|
Revision: 186
http://svn.sourceforge.net/g15tools/?rev=186&view=rev
Author: aneurysm9
Date: 2006-11-19 03:24:46 -0800 (Sun, 19 Nov 2006)
Log Message:
-----------
Back out previous change since \0 gets drawn as 0 or 0 doesn't get drawn at all
Modified Paths:
--------------
trunk/libg15render/pixel.c
trunk/testlibg15render/testlibg15render.cpp
Modified: trunk/libg15render/pixel.c
===================================================================
--- trunk/libg15render/pixel.c 2006-11-19 11:09:04 UTC (rev 185)
+++ trunk/libg15render/pixel.c 2006-11-19 11:24:46 UTC (rev 186)
@@ -544,12 +544,6 @@
x1 += 2;
x2 -= 2;
- int tmp_num = 0;
- if (num != '\0')
- tmp_num = num + 48;
- if ((tmp_num > 47) && (tmp_num < 58))
- num = tmp_num;
-
switch(num){
case 45:
g15r_pixelBox (canvas, x1, y1+((y2/2)-2), x2, y1+((y2/2)+2), G15_COLOR_BLACK, 1, 1);
Modified: trunk/testlibg15render/testlibg15render.cpp
===================================================================
--- trunk/testlibg15render/testlibg15render.cpp 2006-11-19 11:09:04 UTC (rev 185)
+++ trunk/testlibg15render/testlibg15render.cpp 2006-11-19 11:24:46 UTC (rev 186)
@@ -174,8 +174,8 @@
sleep (3);
g15r_clearScreen (canvas, 0);
- g15r_drawBigNum (canvas, 0, 0, 20, 22, 3);
- g15r_drawBigNum (canvas, 25, 0, 45, 42, 9);
+ g15r_drawBigNum (canvas, 0, 0, 20, 22, '3');
+ g15r_drawBigNum (canvas, 25, 0, 45, 42, '0');
updateScreen ();
sleep (3);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-19 11:09:06
|
Revision: 185
http://svn.sourceforge.net/g15tools/?rev=185&view=rev
Author: aneurysm9
Date: 2006-11-19 03:09:04 -0800 (Sun, 19 Nov 2006)
Log Message:
-----------
Don't draw null char as 0 in g15r_drawBigNum
Modified Paths:
--------------
trunk/libg15render/pixel.c
Modified: trunk/libg15render/pixel.c
===================================================================
--- trunk/libg15render/pixel.c 2006-11-19 10:59:47 UTC (rev 184)
+++ trunk/libg15render/pixel.c 2006-11-19 11:09:04 UTC (rev 185)
@@ -544,7 +544,9 @@
x1 += 2;
x2 -= 2;
- int tmp_num = num + 48;
+ int tmp_num = 0;
+ if (num != '\0')
+ tmp_num = num + 48;
if ((tmp_num > 47) && (tmp_num < 58))
num = tmp_num;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-19 10:59:47
|
Revision: 184
http://svn.sourceforge.net/g15tools/?rev=184&view=rev
Author: aneurysm9
Date: 2006-11-19 02:59:47 -0800 (Sun, 19 Nov 2006)
Log Message:
-----------
Allow g15r_drawBigNum to draw plain ints as well as numbers in a char
Modified Paths:
--------------
trunk/libg15render/pixel.c
trunk/testlibg15render/testlibg15render.cpp
Modified: trunk/libg15render/pixel.c
===================================================================
--- trunk/libg15render/pixel.c 2006-11-18 22:11:18 UTC (rev 183)
+++ trunk/libg15render/pixel.c 2006-11-19 10:59:47 UTC (rev 184)
@@ -543,6 +543,10 @@
{
x1 += 2;
x2 -= 2;
+
+ int tmp_num = num + 48;
+ if ((tmp_num > 47) && (tmp_num < 58))
+ num = tmp_num;
switch(num){
case 45:
Modified: trunk/testlibg15render/testlibg15render.cpp
===================================================================
--- trunk/testlibg15render/testlibg15render.cpp 2006-11-18 22:11:18 UTC (rev 183)
+++ trunk/testlibg15render/testlibg15render.cpp 2006-11-19 10:59:47 UTC (rev 184)
@@ -174,8 +174,8 @@
sleep (3);
g15r_clearScreen (canvas, 0);
- g15r_drawBigNum (canvas, 0, 0, 20, 22, '3');
- g15r_drawBigNum (canvas, 25, 0, 45, 42, '9');
+ g15r_drawBigNum (canvas, 0, 0, 20, 22, 3);
+ g15r_drawBigNum (canvas, 25, 0, 45, 42, 9);
updateScreen ();
sleep (3);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-18 22:11:18
|
Revision: 183
http://svn.sourceforge.net/g15tools/?rev=183&view=rev
Author: aneurysm9
Date: 2006-11-18 14:11:18 -0800 (Sat, 18 Nov 2006)
Log Message:
-----------
Fix g15r_drawBigNum tests
Modified Paths:
--------------
trunk/testlibg15render/testlibg15render.cpp
Modified: trunk/testlibg15render/testlibg15render.cpp
===================================================================
--- trunk/testlibg15render/testlibg15render.cpp 2006-11-16 10:58:58 UTC (rev 182)
+++ trunk/testlibg15render/testlibg15render.cpp 2006-11-18 22:11:18 UTC (rev 183)
@@ -174,8 +174,8 @@
sleep (3);
g15r_clearScreen (canvas, 0);
- g15r_drawBigNum (canvas, 0, 0, 12, 42, 3);
- g15r_drawBigNum (canvas, 18, 0, 30, 42, 9);
+ g15r_drawBigNum (canvas, 0, 0, 20, 22, '3');
+ g15r_drawBigNum (canvas, 25, 0, 45, 42, '9');
updateScreen ();
sleep (3);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-16 10:59:00
|
Revision: 182
http://svn.sourceforge.net/g15tools/?rev=182&view=rev
Author: aneurysm9
Date: 2006-11-16 02:58:58 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
Add splash.wbmp for testlibg15render
Added Paths:
-----------
trunk/testlibg15render/splash.wbmp
Added: trunk/testlibg15render/splash.wbmp
===================================================================
(Binary files differ)
Property changes on: trunk/testlibg15render/splash.wbmp
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-16 10:58:07
|
Revision: 181
http://svn.sourceforge.net/g15tools/?rev=181&view=rev
Author: aneurysm9
Date: 2006-11-16 02:58:07 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
fix buglet in g15r_drawIcon
Modified Paths:
--------------
trunk/libg15render/pixel.c
Modified: trunk/libg15render/pixel.c
===================================================================
--- trunk/libg15render/pixel.c 2006-11-16 10:57:39 UTC (rev 180)
+++ trunk/libg15render/pixel.c 2006-11-16 10:58:07 UTC (rev 181)
@@ -414,9 +414,9 @@
for (y=0; y < height - 1; y++)
for (x=0; x < width - 1; x++)
{
+ pixel_offset = y * width + x;
byte_offset = pixel_offset / BYTE_SIZE;
bit_offset = 7 - (pixel_offset % BYTE_SIZE);
- pixel_offset++;
val = (buf[byte_offset] & (1 << bit_offset)) >> bit_offset;
g15r_setPixel (canvas, x + my_x, y + my_y, val);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-16 10:57:41
|
Revision: 180
http://svn.sourceforge.net/g15tools/?rev=180&view=rev
Author: aneurysm9
Date: 2006-11-16 02:57:39 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
update testlibg15render
Modified Paths:
--------------
trunk/testlibg15render/testlibg15render.cpp
Modified: trunk/testlibg15render/testlibg15render.cpp
===================================================================
--- trunk/testlibg15render/testlibg15render.cpp 2006-11-16 10:23:37 UTC (rev 179)
+++ trunk/testlibg15render/testlibg15render.cpp 2006-11-16 10:57:39 UTC (rev 180)
@@ -128,7 +128,7 @@
g15r_drawRoundBox (canvas, 10, 21, 50, 40, 0, 1);
g15r_drawRoundBox (canvas, 80, 15, 140, 30, 1, 1);
updateScreen ();
- sleep (4);
+ sleep (3);
g15r_clearScreen (canvas, 0);
@@ -136,7 +136,7 @@
g15r_drawBar (canvas, 10, 22, 150, 32, 1, 75, 100, 2);
g15r_drawBar (canvas, 10, 34, 150, 42, 1, 315, 900, 3);
updateScreen ();
- sleep (6);
+ sleep (3);
g15r_clearScreen (canvas, 0);
@@ -146,12 +146,38 @@
g15r_pixelBox (canvas, 0, 22, 159, 42, 1, 1, 1);
g15r_ttfPrint (canvas, 0, 25, 16, 1, 0, 1, "This is a test");
updateScreen ();
- sleep (6);
+ sleep (3);
g15r_clearScreen (canvas, 0);
+ g15r_loadWbmpSplash (canvas, "./splash.wbmp");
+ updateScreen ();
+ sleep (3);
+
+ g15r_clearScreen (canvas, 0);
+ char *buf = (char *)malloc (G15_BUFFER_LEN);
+ int width, height;
+ g15r_loadWbmpToBuf (buf, "./splash.wbmp", &width, &height, G15_BUFFER_LEN);
+ g15r_drawSprite (canvas, buf, 30, 10, 43, 20, 30, 10, width);
+ g15r_drawSprite (canvas, buf, 10, 20, 15, 20, 10, 20, width);
+ g15r_drawSprite (canvas, buf, 100, 20, 25, 20, 100, 20, width);
+ updateScreen ();
+ sleep (3);
+
+ g15r_clearScreen (canvas, 0);
g15r_pixelOverlay (canvas, 0, 0, 160, 43, logo_data);
updateScreen ();
sleep (3);
+ g15r_clearScreen (canvas, 0);
+ g15r_drawIcon (canvas, buf, 0, 0, width, height);
+ updateScreen ();
+ sleep (3);
+
+ g15r_clearScreen (canvas, 0);
+ g15r_drawBigNum (canvas, 0, 0, 12, 42, 3);
+ g15r_drawBigNum (canvas, 18, 0, 30, 42, 9);
+ updateScreen ();
+ sleep (3);
+
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-16 10:23:37
|
Revision: 179
http://svn.sourceforge.net/g15tools/?rev=179&view=rev
Author: aneurysm9
Date: 2006-11-16 02:23:37 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
Update libg15render man page
Modified Paths:
--------------
trunk/libg15render/libg15render.3
Modified: trunk/libg15render/libg15render.3
===================================================================
--- trunk/libg15render/libg15render.3 2006-11-16 10:13:03 UTC (rev 178)
+++ trunk/libg15render/libg15render.3 2006-11-16 10:23:37 UTC (rev 179)
@@ -1,4 +1,4 @@
-.TH "libg15render" 3 "7 Nov 2006" "libg15render" \" -*- nroff -*-
+.TH "libg15render" 3 "16 Nov 2006" "libg15render" \" -*- nroff -*-
.ad l
.nh
.SH NAME
@@ -75,10 +75,18 @@
.br
.RI "\fIDraws a completion bar. \fP"
.ti -1c
+.RI "void \fBg15r_drawBigNum\fP (\fBg15canvas\fP *canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int num)"
+.br
+.RI "\fIDraw a large number. \fP"
+.ti -1c
.RI "void \fBg15r_drawCircle\fP (\fBg15canvas\fP *canvas, int x, int y, int r, int fill, int color)"
.br
.RI "\fIDraws a circle centered at (x, y) with a radius of r. \fP"
.ti -1c
+.RI "void \fBg15r_drawIcon\fP (\fBg15canvas\fP *canvas, char *buf, int my_x, int my_y, int width, int height)"
+.br
+.RI "\fIDraw an icon to the screen from a wbmp buffer. \fP"
+.ti -1c
.RI "void \fBg15r_drawLine\fP (\fBg15canvas\fP *canvas, int px1, int py1, int px2, int py2, const int color)"
.br
.RI "\fIDraws a line from (px1, py1) to (px2, py2). \fP"
@@ -87,6 +95,10 @@
.br
.RI "\fIDraws a box with rounded corners bounded by (x1, y1) and (x2, y2). \fP"
.ti -1c
+.RI "void \fBg15r_drawSprite\fP (\fBg15canvas\fP *canvas, char *buf, int my_x, int my_y, int width, int height, int start_x, int start_y, int total_width)"
+.br
+.RI "\fIDraw a sprite to the screen from a wbmp buffer. \fP"
+.ti -1c
.RI "int \fBg15r_getPixel\fP (\fBg15canvas\fP *canvas, unsigned int x, unsigned int y)"
.br
.RI "\fIGets the value of the pixel at (x, y). \fP"
@@ -95,6 +107,14 @@
.br
.RI "\fIClears the canvas and resets the mode switches. \fP"
.ti -1c
+.RI "int \fBg15r_loadWbmpSplash\fP (\fBg15canvas\fP *canvas, char *filename)"
+.br
+.RI "\fIDraw a splash screen from 160x43 wbmp file. \fP"
+.ti -1c
+.RI "int \fBg15r_loadWbmpToBuf\fP (char *buf, char *filename, int *img_width, int *img_height, int maxlen)"
+.br
+.RI "\fILoad a wbmp file into a buffer. \fP"
+.ti -1c
.RI "void \fBg15r_pixelBox\fP (\fBg15canvas\fP *canvas, int x1, int y1, int x2, int y2, int color, int thick, int fill)"
.br
.RI "\fIDraws a box bounded by (x1, y1) and (x2, y2). \fP"
@@ -157,22 +177,22 @@
.PP
Definition at line 21 of file libg15render.h.
.PP
-Referenced by g15r_getPixel(), and g15r_setPixel().
+Referenced by g15r_drawIcon(), g15r_drawSprite(), g15r_getPixel(), g15r_loadWbmpToBuf(), and g15r_setPixel().
.SS "#define G15_BUFFER_LEN 1048"
.PP
Definition at line 22 of file libg15render.h.
.PP
-Referenced by g15r_clearScreen(), and g15r_initCanvas().
+Referenced by g15r_clearScreen(), g15r_initCanvas(), and g15r_loadWbmpSplash().
.SS "#define G15_COLOR_BLACK 1"
.PP
Definition at line 27 of file libg15render.h.
.PP
-Referenced by g15r_drawRoundBox(), g15r_pixelOverlay(), g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
+Referenced by g15r_drawBigNum(), g15r_drawRoundBox(), g15r_pixelOverlay(), g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
.SS "#define G15_COLOR_WHITE 0"
.PP
Definition at line 26 of file libg15render.h.
.PP
-Referenced by g15r_drawRoundBox(), g15r_pixelOverlay(), g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
+Referenced by g15r_drawBigNum(), g15r_drawRoundBox(), g15r_pixelOverlay(), g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
.SS "#define G15_LCD_HEIGHT 43"
.PP
Definition at line 24 of file libg15render.h.
@@ -233,12 +253,6 @@
.PP
References g15canvas::buffer, and G15_BUFFER_LEN.
.PP
-.nf
-81 {
-82 memset (canvas->buffer, (color ? 0xFF : 0), G15_BUFFER_LEN);
-83 }
-.fi
-.PP
.SS "void g15r_drawBar (\fBg15canvas\fP * canvas, int x1, int y1, int x2, int y2, int color, int num, int max, int type)"
.PP
Draws a completion bar.
@@ -268,51 +282,37 @@
.PP
.PP
-Definition at line 336 of file pixel.c.
+Definition at line 337 of file pixel.c.
.PP
References g15r_drawLine(), and g15r_pixelBox().
.PP
-.nf
-338 {
-339 float len, length;
-340 int x;
-341 if (num > max)
-342 num = max;
-343
-344 if (type == 2)
-345 {
-346 y1 += 2;
-347 y2 -= 2;
-348 x1 += 2;
-349 x2 -= 2;
-350 }
-351
-352 len = ((float) max / (float) num);
-353 length = (x2 - x1) / len;
-354
-355 if (type == 1)
-356 {
-357 g15r_pixelBox (canvas, x1, y1 - type, x2, y2 + type, color ^ 1, 1, 1);
-358 g15r_pixelBox (canvas, x1, y1 - type, x2, y2 + type, color, 1, 0);
-359 }
-360 else if (type == 2)
-361 {
-362 g15r_pixelBox (canvas, x1 - 2, y1 - type, x2 + 2, y2 + type, color ^ 1,
-363 1, 1);
-364 g15r_pixelBox (canvas, x1 - 2, y1 - type, x2 + 2, y2 + type, color, 1,
-365 0);
-366 }
-367 else if (type == 3)
-368 {
-369 g15r_drawLine (canvas, x1, y1 - type, x1, y2 + type, color);
-370 g15r_drawLine (canvas, x2, y1 - type, x2, y2 + type, color);
-371 g15r_drawLine (canvas, x1, y1 + ((y2 - y1) / 2), x2,
-372 y1 + ((y2 - y1) / 2), color);
-373 }
-374 g15r_pixelBox (canvas, x1, y1, (int) ceil (x1 + length), y2, color, 1, 1);
-375 }
-.fi
+.SS "void g15r_drawBigNum (\fBg15canvas\fP * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int num)"
.PP
+Draw a large number.
+.PP
+Draw a large number to a canvas
+.PP
+\fBParameters:\fP
+.RS 4
+\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
+.br
+\fIx1\fP Defines leftmost bound of the number.
+.br
+\fIy1\fP Defines uppermost bound of the number.
+.br
+\fIx2\fP Defines rightmost bound of the number.
+.br
+\fIy2\fP Defines bottommost bound of the number.
+.br
+\fInum\fP The number to be drawn.
+.RE
+.PP
+
+.PP
+Definition at line 542 of file pixel.c.
+.PP
+References G15_COLOR_BLACK, G15_COLOR_WHITE, and g15r_pixelBox().
+.PP
.SS "void g15r_drawCircle (\fBg15canvas\fP * canvas, int x, int y, int r, int fill, int color)"
.PP
Draws a circle centered at (x, y) with a radius of r.
@@ -338,46 +338,37 @@
.PP
.PP
-Definition at line 202 of file pixel.c.
+Definition at line 203 of file pixel.c.
.PP
References g15r_drawLine(), and g15r_setPixel().
.PP
-.nf
-203 {
-204 int xx, yy, dd;
-205
-206 xx = 0;
-207 yy = r;
-208 dd = 2 * (1 - r);
-209
-210 while (yy >= 0)
-211 {
-212 if (!fill)
-213 {
-214 g15r_setPixel (canvas, x + xx, y - yy, color);
-215 g15r_setPixel (canvas, x + xx, y + yy, color);
-216 g15r_setPixel (canvas, x - xx, y - yy, color);
-217 g15r_setPixel (canvas, x - xx, y + yy, color);
-218 }
-219 else
-220 {
-221 g15r_drawLine (canvas, x - xx, y - yy, x + xx, y - yy, color);
-222 g15r_drawLine (canvas, x - xx, y + yy, x + xx, y + yy, color);
-223 }
-224 if (dd + yy > 0)
-225 {
-226 yy--;
-227 dd = dd - (2 * yy + 1);
-228 }
-229 if (xx > dd)
-230 {
-231 xx++;
-232 dd = dd + (2 * xx + 1);
-233 }
-234 }
-235 }
-.fi
+.SS "void g15r_drawIcon (\fBg15canvas\fP * canvas, char * buf, int my_x, int my_y, int width, int height)"
.PP
+Draw an icon to the screen from a wbmp buffer.
+.PP
+Draw an icon to a canvas
+.PP
+\fBParameters:\fP
+.RS 4
+\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated in is found.
+.br
+\fIbuf\fP A pointer to the buffer holding the icon to be displayed.
+.br
+\fImy_x\fP Leftmost boundary of image.
+.br
+\fImy_y\fP Topmost boundary of image.
+.br
+\fIwidth\fP Width of the image in buf.
+.br
+\fIheight\fP Height of the image in buf.
+.RE
+.PP
+
+.PP
+Definition at line 408 of file pixel.c.
+.PP
+References BYTE_SIZE, and g15r_setPixel().
+.PP
.SS "void g15r_drawLine (\fBg15canvas\fP * canvas, int px1, int py1, int px2, int py2, const int color)"
.PP
Draws a line from (px1, py1) to (px2, py2).
@@ -401,61 +392,12 @@
.PP
.PP
-Definition at line 98 of file pixel.c.
+Definition at line 99 of file pixel.c.
.PP
References g15r_setPixel(), and swap().
.PP
Referenced by g15r_drawBar(), g15r_drawCircle(), g15r_drawRoundBox(), and g15r_pixelBox().
.PP
-.nf
-100 {
-101 /*
-102 * Bresenham's Line Algorithm
-103 * http://en.wikipedia.org/wiki/Bresenham's_algorithm
-104 */
-105
-106 int steep = 0;
-107
-108 if (abs (py2 - py1) > abs (px2 - px1))
-109 steep = 1;
-110
-111 if (steep)
-112 {
-113 swap (&px1, &py1);
-114 swap (&px2, &py2);
-115 }
-116
-117 if (px1 > px2)
-118 {
-119 swap (&px1, &px2);
-120 swap (&py1, &py2);
-121 }
-122
-123 int dx = px2 - px1;
-124 int dy = abs (py2 - py1);
-125
-126 int error = 0;
-127 int y = py1;
-128 int ystep = (py1 < py2) ? 1 : -1;
-129 int x = 0;
-130
-131 for (x = px1; x <= px2; ++x)
-132 {
-133 if (steep)
-134 g15r_setPixel (canvas, y, x, color);
-135 else
-136 g15r_setPixel (canvas, x, y, color);
-137
-138 error += dy;
-139 if (2 * error >= dx)
-140 {
-141 y += ystep;
-142 error -= dx;
-143 }
-144 }
-145 }
-.fi
-.PP
.SS "void g15r_drawRoundBox (\fBg15canvas\fP * canvas, int x1, int y1, int x2, int y2, int fill, int color)"
.PP
Draws a box with rounded corners bounded by (x1, y1) and (x2, y2).
@@ -483,81 +425,43 @@
.PP
.PP
-Definition at line 251 of file pixel.c.
+Definition at line 252 of file pixel.c.
.PP
References G15_COLOR_BLACK, G15_COLOR_WHITE, g15r_drawLine(), and g15r_setPixel().
.PP
-.nf
-253 {
-254 int y, shave = 3;
-255
-256 if (shave > (x2 - x1) / 2)
-257 shave = (x2 - x1) / 2;
-258 if (shave > (y2 - y1) / 2)
-259 shave = (y2 - y1) / 2;
-260
-261 if ((x1 != x2) && (y1 != y2))
-262 {
-263 if (fill)
-264 {
-265 g15r_drawLine (canvas, x1 + shave, y1, x2 - shave, y1, color);
-266 for (y = y1 + 1; y < y1 + shave; y++)
-267 g15r_drawLine (canvas, x1 + 1, y, x2 - 1, y, color);
-268 for (y = y1 + shave; y <= y2 - shave; y++)
-269 g15r_drawLine (canvas, x1, y, x2, y, color);
-270 for (y = y2 - shave + 1; y < y2; y++)
-271 g15r_drawLine (canvas, x1 + 1, y, x2 - 1, y, color);
-272 g15r_drawLine (canvas, x1 + shave, y2, x2 - shave, y2, color);
-273 if (shave == 4)
-274 {
-275 g15r_setPixel (canvas, x1 + 1, y1 + 1,
-276 color ==
-277 G15_COLOR_WHITE ? G15_COLOR_BLACK :
-278 G15_COLOR_WHITE);
-279 g15r_setPixel (canvas, x1 + 1, y2 - 1,
-280 color ==
-281 G15_COLOR_WHITE ? G15_COLOR_BLACK :
-282 G15_COLOR_WHITE);
-283 g15r_setPixel (canvas, x2 - 1, y1 + 1,
-284 color ==
-285 G15_COLOR_WHITE ? G15_COLOR_BLACK :
-286 G15_COLOR_WHITE);
-287 g15r_setPixel (canvas, x2 - 1, y2 - 1,
-288 color ==
-289 G15_COLOR_WHITE ? G15_COLOR_BLACK :
-290 G15_COLOR_WHITE);
-291 }
-292 }
-293 else
-294 {
-295 g15r_drawLine (canvas, x1 + shave, y1, x2 - shave, y1, color);
-296 g15r_drawLine (canvas, x1, y1 + shave, x1, y2 - shave, color);
-297 g15r_drawLine (canvas, x2, y1 + shave, x2, y2 - shave, color);
-298 g15r_drawLine (canvas, x1 + shave, y2, x2 - shave, y2, color);
-299 if (shave > 1)
-300 {
-301 g15r_drawLine (canvas, x1 + 1, y1 + 1, x1 + shave - 1, y1 + 1,
-302 color);
-303 g15r_drawLine (canvas, x2 - shave + 1, y1 + 1, x2 - 1, y1 + 1,
-304 color);
-305 g15r_drawLine (canvas, x1 + 1, y2 - 1, x1 + shave - 1, y2 - 1,
-306 color);
-307 g15r_drawLine (canvas, x2 - shave + 1, y2 - 1, x2 - 1, y2 - 1,
-308 color);
-309 g15r_drawLine (canvas, x1 + 1, y1 + 1, x1 + 1, y1 + shave - 1,
-310 color);
-311 g15r_drawLine (canvas, x1 + 1, y2 - 1, x1 + 1, y2 - shave + 1,
-312 color);
-313 g15r_drawLine (canvas, x2 - 1, y1 + 1, x2 - 1, y1 + shave - 1,
-314 color);
-315 g15r_drawLine (canvas, x2 - 1, y2 - 1, x2 - 1, y2 - shave + 1,
-316 color);
-317 }
-318 }
-319 }
-320 }
-.fi
+.SS "void g15r_drawSprite (\fBg15canvas\fP * canvas, char * buf, int my_x, int my_y, int width, int height, int start_x, int start_y, int total_width)"
.PP
+Draw a sprite to the screen from a wbmp buffer.
+.PP
+Draw a sprite to a canvas
+.PP
+\fBParameters:\fP
+.RS 4
+\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated in is found.
+.br
+\fIbuf\fP A pointer to the buffer holding a set of sprites.
+.br
+\fImy_x\fP Leftmost boundary of image.
+.br
+\fImy_y\fP Topmost boundary of image.
+.br
+\fIwidth\fP Width of the sprite.
+.br
+\fIheight\fP Height of the sprite.
+.br
+\fIstart_x\fP X offset for reading sprite from buf.
+.br
+\fIstart_y\fP Y offset for reading sprite from buf.
+.br
+\fItotal_width\fP Width of the set of sprites held in buf.
+.RE
+.PP
+
+.PP
+Definition at line 440 of file pixel.c.
+.PP
+References BYTE_SIZE, and g15r_setPixel().
+.PP
.SS "int g15r_getPixel (\fBg15canvas\fP * canvas, unsigned int x, unsigned int y)"
.PP
Gets the value of the pixel at (x, y).
@@ -581,19 +485,6 @@
.PP
Referenced by g15r_pixelReverseFill(), and g15r_setPixel().
.PP
-.nf
-30 {
-31 if (x >= G15_LCD_WIDTH || y >= G15_LCD_HEIGHT)
-32 return 0;
-33
-34 unsigned int pixel_offset = y * G15_LCD_WIDTH + x;
-35 unsigned int byte_offset = pixel_offset / BYTE_SIZE;
-36 unsigned int bit_offset = 7 - (pixel_offset % BYTE_SIZE);
-37
-38 return (canvas->buffer[byte_offset] & (1 << bit_offset)) >> bit_offset;
-39 }
-.fi
-.PP
.SS "void g15r_initCanvas (\fBg15canvas\fP * canvas)"
.PP
Clears the canvas and resets the mode switches.
@@ -611,19 +502,52 @@
.PP
References g15canvas::buffer, g15canvas::ftLib, G15_BUFFER_LEN, g15canvas::mode_cache, g15canvas::mode_reverse, and g15canvas::mode_xor.
.PP
-.nf
-92 {
-93 memset (canvas->buffer, 0, G15_BUFFER_LEN);
-94 canvas->mode_cache = 0;
-95 canvas->mode_reverse = 0;
-96 canvas->mode_xor = 0;
-97 #ifdef TTF_SUPPORT
-98 if (FT_Init_FreeType (&canvas->ftLib))
-99 printf ('Freetype couldnt initialise\n');
-100 #endif
-101 }
-.fi
+.SS "int g15r_loadWbmpSplash (\fBg15canvas\fP * canvas, char * filename)"
.PP
+Draw a splash screen from 160x43 wbmp file.
+.PP
+wbmp splash screen loader - assumes image is 160x43
+.PP
+\fBParameters:\fP
+.RS 4
+\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
+.br
+\fIfilename\fP A string holding the path to the wbmp to be displayed.
+.RE
+.PP
+
+.PP
+Definition at line 385 of file pixel.c.
+.PP
+References g15canvas::buffer, G15_BUFFER_LEN, and g15r_loadWbmpToBuf().
+.PP
+.SS "int g15r_loadWbmpToBuf (char * buf, char * filename, int * img_width, int * img_height, int maxlen)"
+.PP
+Load a wbmp file into a buffer.
+.PP
+basic wbmp loader - loads wbmp into pre-prepared buf.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIbuf\fP A pointer to the buffer into which the wbmp will be loaded.
+.br
+\fIfilename\fP A string holding the path to the wbmp to be loaded.
+.br
+\fIimg_width\fP A pointer to an int that will hold the image width on return.
+.br
+\fIimg_height\fP A pointer to an int that will hold the image height on return.
+.br
+\fImaxlen\fP The maximum number of bytes that should be read from filename.
+.RE
+.PP
+
+.PP
+Definition at line 468 of file pixel.c.
+.PP
+References BYTE_SIZE.
+.PP
+Referenced by g15r_loadWbmpSplash().
+.PP
.SS "void g15r_pixelBox (\fBg15canvas\fP * canvas, int x1, int y1, int x2, int y2, int color, int thick, int fill)"
.PP
Draws a box bounded by (x1, y1) and (x2, y2).
@@ -653,39 +577,12 @@
.PP
.PP
-Definition at line 162 of file pixel.c.
+Definition at line 163 of file pixel.c.
.PP
References g15r_drawLine(), and g15r_setPixel().
.PP
-Referenced by g15r_drawBar().
+Referenced by g15r_drawBar(), and g15r_drawBigNum().
.PP
-.nf
-164 {
-165 int i = 0;
-166 for (i = 0; i < thick; ++i)
-167 {
-168 g15r_drawLine (canvas, x1, y1, x2, y1, color); /* Top */
-169 g15r_drawLine (canvas, x1, y1, x1, y2, color); /* Left */
-170 g15r_drawLine (canvas, x2, y1, x2, y2, color); /* Right */
-171 g15r_drawLine (canvas, x1, y2, x2, y2, color); /* Bottom */
-172 x1++;
-173 y1++;
-174 x2--;
-175 y2--;
-176 }
-177
-178 int x = 0, y = 0;
-179
-180 if (fill)
-181 {
-182 for (x = x1; x <= x2; ++x)
-183 for (y = y1; y <= y2; ++y)
-184 g15r_setPixel (canvas, x, y, color);
-185 }
-186
-187 }
-.fi
-.PP
.SS "void g15r_pixelOverlay (\fBg15canvas\fP * canvas, int x1, int y1, int width, int height, short colormap[])"
.PP
Overlays a bitmap of size width x height starting at (x1, y1).
@@ -709,24 +606,10 @@
.PP
.PP
-Definition at line 73 of file pixel.c.
+Definition at line 74 of file pixel.c.
.PP
References G15_COLOR_BLACK, G15_COLOR_WHITE, and g15r_setPixel().
.PP
-.nf
-75 {
-76 int i = 0;
-77
-78 for (i = 0; i < (width * height); ++i)
-79 {
-80 int color = (colormap[i] ? G15_COLOR_BLACK : G15_COLOR_WHITE);
-81 int x = x1 + i % width;
-82 int y = y1 + i / width;
-83 g15r_setPixel (canvas, x, y, color);
-84 }
-85 }
-.fi
-.PP
.SS "void g15r_pixelReverseFill (\fBg15canvas\fP * canvas, int x1, int y1, int x2, int y2, int fill, int color)"
.PP
Fills an area bounded by (x1, y1) and (x2, y2).
@@ -752,27 +635,10 @@
.PP
.PP
-Definition at line 44 of file pixel.c.
+Definition at line 45 of file pixel.c.
.PP
References g15r_getPixel(), and g15r_setPixel().
.PP
-.nf
-46 {
-47 int x = 0;
-48 int y = 0;
-49
-50 for (x = x1; x <= x2; ++x)
-51 {
-52 for (y = y1; y <= y2; ++y)
-53 {
-54 if (!fill)
-55 color = !g15r_getPixel (canvas, x, y);
-56 g15r_setPixel (canvas, x, y, color);
-57 }
-58 }
-59 }
-.fi
-.PP
.SS "void g15r_renderCharacterLarge (\fBg15canvas\fP * canvas, int x, int y, unsigned char character, unsigned int sx, unsigned int sy)"
.PP
Renders a character in the large font at (x, y).
@@ -783,32 +649,6 @@
.PP
Referenced by g15r_renderString().
.PP
-.nf
-25 {
-26 int helper = character * 8; /* for our font which is 8x8 */
-27
-28 int top_left_pixel_x = sx + col * (8); /* 1 pixel spacing */
-29 int top_left_pixel_y = sy + row * (8); /* once again 1 pixel spacing */
-30
-31 int x, y;
-32 for (y = 0; y < 8; ++y)
-33 {
-34 for (x = 0; x < 8; ++x)
-35 {
-36 char font_entry = fontdata_8x8[helper + y];
-37
-38 if (font_entry & 1 << (7 - x))
-39 g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
-40 G15_COLOR_BLACK);
-41 else
-42 g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
-43 G15_COLOR_WHITE);
-44
-45 }
-46 }
-47 }
-.fi
-.PP
.SS "void g15r_renderCharacterMedium (\fBg15canvas\fP * canvas, int x, int y, unsigned char character, unsigned int sx, unsigned int sy)"
.PP
Renders a character in the meduim font at (x, y).
@@ -819,31 +659,6 @@
.PP
Referenced by g15r_renderString().
.PP
-.nf
-53 {
-54 int helper = character * 7 * 5; /* for our font which is 6x4 */
-55
-56 int top_left_pixel_x = sx + col * (5); /* 1 pixel spacing */
-57 int top_left_pixel_y = sy + row * (7); /* once again 1 pixel spacing */
-58
-59 int x, y;
-60 for (y = 0; y < 7; ++y)
-61 {
-62 for (x = 0; x < 5; ++x)
-63 {
-64 char font_entry = fontdata_7x5[helper + y * 5 + x];
-65 if (font_entry)
-66 g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
-67 G15_COLOR_BLACK);
-68 else
-69 g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
-70 G15_COLOR_WHITE);
-71
-72 }
-73 }
-74 }
-.fi
-.PP
.SS "void g15r_renderCharacterSmall (\fBg15canvas\fP * canvas, int x, int y, unsigned char character, unsigned int sx, unsigned int sy)"
.PP
Renders a character in the small font at (x, y).
@@ -854,31 +669,6 @@
.PP
Referenced by g15r_renderString().
.PP
-.nf
-80 {
-81 int helper = character * 6 * 4; /* for our font which is 6x4 */
-82
-83 int top_left_pixel_x = sx + col * (4); /* 1 pixel spacing */
-84 int top_left_pixel_y = sy + row * (6); /* once again 1 pixel spacing */
-85
-86 int x, y;
-87 for (y = 0; y < 6; ++y)
-88 {
-89 for (x = 0; x < 4; ++x)
-90 {
-91 char font_entry = fontdata_6x4[helper + y * 4 + x];
-92 if (font_entry)
-93 g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
-94 G15_COLOR_BLACK);
-95 else
-96 g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
-97 G15_COLOR_WHITE);
-98
-99 }
-100 }
-101 }
-.fi
-.PP
.SS "void g15r_renderString (\fBg15canvas\fP * canvas, unsigned char stringOut[], int row, int size, unsigned int sx, unsigned int sy)"
.PP
Renders a string with font size in row.
@@ -887,37 +677,6 @@
.PP
References G15_TEXT_LARGE, G15_TEXT_MED, G15_TEXT_SMALL, g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
.PP
-.nf
-106 {
-107
-108 int i = 0;
-109 for (i; stringOut[i] != NULL; ++i)
-110 {
-111 switch (size)
-112 {
-113 case G15_TEXT_SMALL:
-114 {
-115 g15r_renderCharacterSmall (canvas, i, row, stringOut[i], sx, sy);
-116 break;
-117 }
-118 case G15_TEXT_MED:
-119 {
-120 g15r_renderCharacterMedium (canvas, i, row, stringOut[i], sx, sy);
-121 break;
-122 }
-123 case G15_TEXT_LARGE:
-124 {
-125 g15r_renderCharacterLarge (canvas, i, row, stringOut[i], sx, sy);
-126 break;
-127 }
-128 default:
-129 break;
-130 }
-131 }
-132
-133 }
-.fi
-.PP
.SS "void g15r_setPixel (\fBg15canvas\fP * canvas, unsigned int x, unsigned int y, int val)"
.PP
Sets the value of the pixel at (x, y).
@@ -941,32 +700,8 @@
.PP
References g15canvas::buffer, BYTE_SIZE, G15_LCD_HEIGHT, G15_LCD_WIDTH, g15r_getPixel(), g15canvas::mode_reverse, and g15canvas::mode_xor.
.PP
-Referenced by draw_ttf_char(), g15r_drawCircle(), g15r_drawLine(), g15r_drawRoundBox(), g15r_pixelBox(), g15r_pixelOverlay(), g15r_pixelReverseFill(), g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
+Referenced by draw_ttf_char(), g15r_drawCircle(), g15r_drawIcon(), g15r_drawLine(), g15r_drawRoundBox(), g15r_drawSprite(), g15r_pixelBox(), g15r_pixelOverlay(), g15r_pixelReverseFill(), g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
.PP
-.nf
-51 {
-52 if (x >= G15_LCD_WIDTH || y >= G15_LCD_HEIGHT)
-53 return;
-54
-55 unsigned int pixel_offset = y * G15_LCD_WIDTH + x;
-56 unsigned int byte_offset = pixel_offset / BYTE_SIZE;
-57 unsigned int bit_offset = 7 - (pixel_offset % BYTE_SIZE);
-58
-59 if (canvas->mode_xor)
-60 val ^= g15r_getPixel (canvas, x, y);
-61 if (canvas->mode_reverse)
-62 val = !val;
-63
-64 if (val)
-65 canvas->buffer[byte_offset] =
-66 canvas->buffer[byte_offset] | 1 << bit_offset;
-67 else
-68 canvas->buffer[byte_offset] =
-69 canvas->buffer[byte_offset] & ~(1 << bit_offset);
-70
-71 }
-.fi
-.PP
.SS "void g15r_ttfLoad (\fBg15canvas\fP * canvas, char * fontname, int fontsize, int face_num)"
.PP
Loads a font through the FreeType2 library.
@@ -990,40 +725,6 @@
.PP
References g15canvas::ftLib, G15_MAX_FACE, g15canvas::ttf_face, and g15canvas::ttf_fontsize.
.PP
-.nf
-146 {
-147 int errcode = 0;
-148
-149 if (face_num < 0)
-150 face_num = 0;
-151 if (face_num > G15_MAX_FACE)
-152 face_num = G15_MAX_FACE;
-153
-154 if (canvas->ttf_fontsize[face_num])
-155 FT_Done_Face (canvas->ttf_face[face_num][0]); /* destroy the last face */
-156
-157 if (!canvas->ttf_fontsize[face_num] && !fontsize)
-158 canvas->ttf_fontsize[face_num] = 10;
-159 else
-160 canvas->ttf_fontsize[face_num] = fontsize;
-161
-162 errcode =
-163 FT_New_Face (canvas->ftLib, fontname, 0, &canvas->ttf_face[face_num][0]);
-164 if (errcode)
-165 {
-166 canvas->ttf_fontsize[face_num] = 0;
-167 }
-168 else
-169 {
-170 if (canvas->ttf_fontsize[face_num]
-171 && FT_IS_SCALABLE (canvas->ttf_face[face_num][0]))
-172 errcode =
-173 FT_Set_Char_Size (canvas->ttf_face[face_num][0], 0,
-174 canvas->ttf_fontsize[face_num] * 64, 90, 0);
-175 }
-176 }
-.fi
-.PP
.SS "void g15r_ttfPrint (\fBg15canvas\fP * canvas, int x, int y, int fontsize, int face_num, int color, int center, char * print_string)"
.PP
Prints a string in a given font.
@@ -1055,34 +756,6 @@
.PP
References calc_ttf_centering(), calc_ttf_right_justify(), calc_ttf_true_ypos(), draw_ttf_str(), g15canvas::ttf_face, and g15canvas::ttf_fontsize.
.PP
-.nf
-285 {
-286 int errcode = 0;
-287
-288 if (canvas->ttf_fontsize[face_num])
-289 {
-290 if (fontsize > 0 && FT_IS_SCALABLE (canvas->ttf_face[face_num][0]))
-291 {
-292 canvas->ttf_fontsize[face_num] = fontsize;
-293 int errcode =
-294 FT_Set_Pixel_Sizes (canvas->ttf_face[face_num][0], 0,
-295 canvas->ttf_fontsize[face_num]);
-296 if (errcode)
-297 printf ('Trouble setting the Glyph size!\n');
-298 }
-299 y =
-300 calc_ttf_true_ypos (canvas->ttf_face[face_num][0], y,
-301 canvas->ttf_fontsize[face_num]);
-302 if (center == 1)
-303 x = calc_ttf_centering (canvas->ttf_face[face_num][0], print_string);
-304 else if (center == 2)
-305 x = calc_ttf_right_justify (canvas->ttf_face[face_num][0], print_string);
-306 draw_ttf_str (canvas, print_string, x, y, color,
-307 canvas->ttf_face[face_num][0]);
-308 }
-309 }
-.fi
-.PP
.SH "Variable Documentation"
.PP
.SS "unsigned char \fBfontdata_6x4\fP[]"
@@ -1101,7 +774,7 @@
.PP
Referenced by g15r_renderCharacterLarge().
.SH "Author"
-.PP
+.PP
Anthony J. Mirabella <mir...@gm...>
.PP
Generated automatically by Doxygen for libg15render from the source code.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-16 10:13:04
|
Revision: 178
http://svn.sourceforge.net/g15tools/?rev=178&view=rev
Author: aneurysm9
Date: 2006-11-16 02:13:03 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
Add documentation for wbmp and bignum functions
Modified Paths:
--------------
trunk/libg15render/libg15render.h
trunk/libg15render/pixel.c
Modified: trunk/libg15render/libg15render.h
===================================================================
--- trunk/libg15render/libg15render.h 2006-11-16 08:17:08 UTC (rev 177)
+++ trunk/libg15render/libg15render.h 2006-11-16 10:13:03 UTC (rev 178)
@@ -71,18 +71,22 @@
/** \brief Draws a completion bar*/
void g15r_drawBar (g15canvas * canvas, int x1, int y1, int x2, int y2,
int color, int num, int max, int type);
+/** \brief Draw a splash screen from 160x43 wbmp file*/
+int g15r_loadWbmpSplash(g15canvas *canvas, char *filename);
+/** \brief Draw an icon to the screen from a wbmp buffer*/
+void g15r_drawIcon(g15canvas *canvas, char *buf, int my_x, int my_y, int width, int height);
+/** \brief Draw a sprite to the screen from a wbmp buffer*/
+void g15r_drawSprite(g15canvas *canvas, char *buf, int my_x, int my_y, int width, int height, int start_x, int start_y, int total_width);
+/** \brief Load a wbmp file into a buffer*/
+int g15r_loadWbmpToBuf(char *buf, char *filename, int *img_width, int *img_height, int maxlen);
+/** \brief Draw a large number*/
+void g15r_drawBigNum (g15canvas * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int num);
/** \brief Gets the value of the pixel at (x, y)*/
int g15r_getPixel (g15canvas * canvas, unsigned int x, unsigned int y);
/** \brief Sets the value of the pixel at (x, y)*/
void g15r_setPixel (g15canvas * canvas, unsigned int x, unsigned int y,
int val);
-int g15r_loadWbmpSplash(g15canvas *canvas, char *filename);
-void g15r_drawIcon(g15canvas *canvas, char *buf, int my_x, int my_y, int width, int height);
-void g15r_drawSprite(g15canvas *canvas, char *buf, int my_x, int my_y, int width, int height, int start_x, int start_y, int total_width);
-int g15r_loadWbmpToBuf(char *buf, char *filename, int *img_width, int *img_height, int maxlen);
-void g15r_drawBigNum (g15canvas * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int num);
-
/** \brief Fills the screen with pixels of color*/
void g15r_clearScreen (g15canvas * canvas, int color);
/** \brief Clears the canvas and resets the mode switches*/
Modified: trunk/libg15render/pixel.c
===================================================================
--- trunk/libg15render/pixel.c 2006-11-16 08:17:08 UTC (rev 177)
+++ trunk/libg15render/pixel.c 2006-11-16 10:13:03 UTC (rev 178)
@@ -375,7 +375,12 @@
g15r_pixelBox (canvas, x1, y1, (int) ceil (x1 + length), y2, color, 1, 1);
}
-/* basic wbmp splash screen loader - assumes image is 160x43 */
+/**
+ * wbmp splash screen loader - assumes image is 160x43
+ *
+ * \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
+ * \param filename A string holding the path to the wbmp to be displayed.
+ */
int
g15r_loadWbmpSplash(g15canvas *canvas, char *filename)
{
@@ -389,7 +394,16 @@
return retval;
}
-/* draw an icon at location my_x,my_y, from buf. width&height should be icons width/height */
+/**
+ * Draw an icon to a canvas
+ *
+ * \param canvas A pointer to a g15canvas struct in which the buffer to be operated in is found.
+ * \param buf A pointer to the buffer holding the icon to be displayed.
+ * \param my_x Leftmost boundary of image.
+ * \param my_y Topmost boundary of image.
+ * \param width Width of the image in buf.
+ * \param height Height of the image in buf.
+ */
void
g15r_drawIcon(g15canvas *canvas, char *buf, int my_x, int my_y, int width, int height)
{
@@ -409,6 +423,19 @@
}
}
+/**
+ * Draw a sprite to a canvas
+ *
+ * \param canvas A pointer to a g15canvas struct in which the buffer to be operated in is found.
+ * \param buf A pointer to the buffer holding a set of sprites.
+ * \param my_x Leftmost boundary of image.
+ * \param my_y Topmost boundary of image.
+ * \param width Width of the sprite.
+ * \param height Height of the sprite.
+ * \param start_x X offset for reading sprite from buf.
+ * \param start_y Y offset for reading sprite from buf.
+ * \param total_width Width of the set of sprites held in buf.
+ */
void
g15r_drawSprite(g15canvas *canvas, char *buf, int my_x, int my_y, int width, int height, int start_x, int start_y, int total_width)
{
@@ -428,7 +455,15 @@
}
}
-/* basic wbmp loader - loads wbmp into pre-prepared buf. sets img_height & img_width to image size */
+/**
+ * basic wbmp loader - loads wbmp into pre-prepared buf.
+ *
+ * \param buf A pointer to the buffer into which the wbmp will be loaded.
+ * \param filename A string holding the path to the wbmp to be loaded.
+ * \param img_width A pointer to an int that will hold the image width on return.
+ * \param img_height A pointer to an int that will hold the image height on return.
+ * \param maxlen The maximum number of bytes that should be read from filename.
+ */
int
g15r_loadWbmpToBuf(char *buf, char *filename, int *img_width, int *img_height, int maxlen)
{
@@ -493,6 +528,16 @@
return retval;
}
+/**
+ * Draw a large number to a canvas
+ *
+ * \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
+ * \param x1 Defines leftmost bound of the number.
+ * \param y1 Defines uppermost bound of the number.
+ * \param x2 Defines rightmost bound of the number.
+ * \param y2 Defines bottommost bound of the number.
+ * \param num The number to be drawn.
+ */
void
g15r_drawBigNum (g15canvas * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int num)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-16 08:17:08
|
Revision: 177
http://svn.sourceforge.net/g15tools/?rev=177&view=rev
Author: aneurysm9
Date: 2006-11-16 00:17:08 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
Add g15r_drawSprite to draw from a rectangular portion of a buffer
Modified Paths:
--------------
trunk/libg15render/libg15render.h
trunk/libg15render/pixel.c
Modified: trunk/libg15render/libg15render.h
===================================================================
--- trunk/libg15render/libg15render.h 2006-11-16 04:11:29 UTC (rev 176)
+++ trunk/libg15render/libg15render.h 2006-11-16 08:17:08 UTC (rev 177)
@@ -79,6 +79,7 @@
int val);
int g15r_loadWbmpSplash(g15canvas *canvas, char *filename);
void g15r_drawIcon(g15canvas *canvas, char *buf, int my_x, int my_y, int width, int height);
+void g15r_drawSprite(g15canvas *canvas, char *buf, int my_x, int my_y, int width, int height, int start_x, int start_y, int total_width);
int g15r_loadWbmpToBuf(char *buf, char *filename, int *img_width, int *img_height, int maxlen);
void g15r_drawBigNum (g15canvas * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int num);
Modified: trunk/libg15render/pixel.c
===================================================================
--- trunk/libg15render/pixel.c 2006-11-16 04:11:29 UTC (rev 176)
+++ trunk/libg15render/pixel.c 2006-11-16 08:17:08 UTC (rev 177)
@@ -409,6 +409,25 @@
}
}
+void
+g15r_drawSprite(g15canvas *canvas, char *buf, int my_x, int my_y, int width, int height, int start_x, int start_y, int total_width)
+{
+ int y,x,val;
+ unsigned int pixel_offset = 0;
+ unsigned int byte_offset, bit_offset;
+
+ for (y=0; y < height - 1; y++)
+ for (x=0; x < width - 1; x++)
+ {
+ pixel_offset = (y + start_y) * total_width + (x + start_x);
+ byte_offset = pixel_offset / BYTE_SIZE;
+ bit_offset = 7 - (pixel_offset % BYTE_SIZE);
+
+ val = (buf[byte_offset] & (1 << bit_offset)) >> bit_offset;
+ g15r_setPixel (canvas, x + my_x, y + my_y, val);
+ }
+}
+
/* basic wbmp loader - loads wbmp into pre-prepared buf. sets img_height & img_width to image size */
int
g15r_loadWbmpToBuf(char *buf, char *filename, int *img_width, int *img_height, int maxlen)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ane...@us...> - 2006-11-16 04:11:28
|
Revision: 176
http://svn.sourceforge.net/g15tools/?rev=176&view=rev
Author: aneurysm9
Date: 2006-11-15 20:11:29 -0800 (Wed, 15 Nov 2006)
Log Message:
-----------
Update version to reflect new functions
Modified Paths:
--------------
trunk/libg15render/Makefile.am
trunk/libg15render/configure.in
Modified: trunk/libg15render/Makefile.am
===================================================================
--- trunk/libg15render/Makefile.am 2006-11-16 04:01:52 UTC (rev 175)
+++ trunk/libg15render/Makefile.am 2006-11-16 04:11:29 UTC (rev 176)
@@ -3,7 +3,7 @@
lib_LTLIBRARIES = libg15render.la
libg15render_la_SOURCES = libg15render.h text.c pixel.c screen.c font_6x4.c font_7x5.c font_8x8.c
libg15render_la_LIBADD = @FTLIB@
-libg15render_la_LDFLAGS = -version-info 1:0:0
+libg15render_la_LDFLAGS = -version-info 2:0:1
include_HEADERS= libg15render.h
EXTRA_DIST = debian Doxyfile libg15render.3
man3_MANS = $(top_srcdir)/libg15render.3
Modified: trunk/libg15render/configure.in
===================================================================
--- trunk/libg15render/configure.in 2006-11-16 04:01:52 UTC (rev 175)
+++ trunk/libg15render/configure.in 2006-11-16 04:11:29 UTC (rev 176)
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT(libg15render, 1.1.1, mir...@gm...)
+AC_INIT(libg15render, 1.2, mir...@gm...)
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE()
AC_CONFIG_SRCDIR([libg15render.h])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|