Subversion Repositories shark

Rev

Rev 743 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
471 giacomo 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Giacomo Guidi       <giacomo@gandalf.sssup.it>
10
 *
11
 *
12
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
13
 *
14
 * http://www.sssup.it
15
 * http://retis.sssup.it
16
 * http://shark.sssup.it
17
 */
18
 
19
/* Glue Layer Header Linux Frame Buffer 2.6 Driver*/
20
 
21
#ifndef __SHARK_FB26__
22
#define __SHARK_FB26__
23
 
24
/* Init the FB 2.6 Driver */
484 giacomo 25
int FB26_init();
471 giacomo 26
 
484 giacomo 27
/* Open FB */
471 giacomo 28
int FB26_open(int num);
29
 
30
/* Close the FB */
31
int FB26_close(int num);
32
 
484 giacomo 33
/* Set mode */
34
int FB26_setmode(int num, unsigned char *modeopt);
35
 
529 giacomo 36
/* Use old GRX library to draw */
37
int FB26_use_grx(int num);
38
 
39
/* GRX emulation under FrameBuffer */
40
 
41
void grx_plot(WORD x, WORD y, DWORD color);
42
DWORD grx_getpixel(WORD x, WORD y);
743 giacomo 43
void grx_getimage(WORD x1, WORD y1, WORD x2, WORD y2, WORD *buf);
44
void grx_putimage(WORD x1, WORD y1, WORD x2, WORD y2, WORD *buf);
529 giacomo 45
void grx_box(WORD x1, WORD y1, WORD x2, WORD y2, DWORD color);
531 giacomo 46
void grx_clear(DWORD color);
529 giacomo 47
void grx_rect(WORD x1, WORD y1, WORD x2, WORD y2, DWORD color);
48
void grx_line(WORD x1, WORD y1, WORD x2, WORD y2, DWORD color);
49
void grx_text(char *text, WORD x, WORD y, DWORD fg, DWORD bg);
50
void grx_circle(WORD x, WORD y, WORD r, DWORD col);
51
void grx_disc(WORD x, WORD y, WORD r, DWORD col);
52
 
998 mauro 53
int vga16color[16];
54
 
531 giacomo 55
/* 15bpp, 16bpp, 24bpp and 32bpp colors... */
56
#define color15(r, g, b) (((WORD)(r & 0x1F) << 10) | ((WORD)(g & 0x1F) << 5) | ((WORD)(b & 0x1F)))
57
#define color16(r, g, b) (((WORD)(r & 0x1F) << 11) | ((WORD)(g & 0x3F) << 5) | ((WORD)(b & 0x1F)))
58
#define color24(r, g, b) (((DWORD)(r & 0xFF) << 16) | ((DWORD)(g & 0xFF) << 8) | (DWORD)(b & 0xFF))
59
#define color32(r, g, b) (((DWORD)(r & 0xFF) << 16) | ((DWORD)(g & 0xFF) << 8) | (DWORD)(b & 0xFF))
60
 
61
#define rgb15(r, g, b) ((((WORD)(r & 0xF8)>>3) << 10) | (((WORD)(g & 0xF8)>>3) << 5) | ((WORD)(b & 0xF8)>>3))
62
#define rgb16(r, g, b) ((((WORD)(r & 0xF8)>>3) << 11) | (((WORD)(g & 0xFC)>>2) << 5) | ((WORD)(b & 0xF8)>>3))
63
#define rgb24(r, g, b) (((DWORD)(r & 0xFF) << 16) | ((DWORD)(g & 0xFF) << 8) | (DWORD)(b & 0xFF))
64
#define rgb32(r, g, b) (((DWORD)(r & 0xFF) << 16) | ((DWORD)(g & 0xFF) << 8) | (DWORD)(b & 0xFF))
65
 
471 giacomo 66
#endif
67