Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1164 → Rev 1165

/demos/trunk/bttvdemo/bttv.c
50,11 → 50,13
unsigned long int VMEMLONG = WIDTH * HEIGHT * BYTES_PP / 4; // Used by copy_videomem_16to16
unsigned long int RGB565MEM = WIDTH * HEIGHT * BYTES_PP; // Total video mem
 
#define FG_PERIOD 50000
#define FG_PERIOD 40000
#define FG_WCET 30000
#define FG_W 400
#define FG_H 300
#define FG_W 320
#define FG_H 200
 
unsigned int color = FG_MONO;
 
static int screen(int mode)
{
 
105,24 → 107,33
void elaborate_image(void *imageptr)
{
 
WORD col,x,y;
WORD x,y;
BYTE *col;
 
while(1) {
if (color == FG_MONO) {
 
for(y = 0; y < FG_H; y++)
for(x = 0; x < FG_W; x++) {
for(x = 0; x < FG_W; x++) {
 
col = *(BYTE *)(imageptr + y*FG_W + x);
*(WORD *)(video_buf + y*(WIDTH*2) + x*2) = (WORD)rgb16(col,col,col);
col = (BYTE *)(imageptr + y*FG_W + x);
*(WORD *)(video_buf + y*(WIDTH*2) + (x*2)) = (WORD)rgb16(*(BYTE *)(col),*(BYTE *)(col),*(BYTE *)(col));
 
}
task_endcycle();
}
 
}
 
sys_end();
if (color == FG_RGB24) {
 
for(y = 0; y < FG_H; y++)
for(x = 0; x < FG_W; x++) {
 
col = (BYTE *)(imageptr + y*(FG_W*3) + (x*3));
*(WORD *)(video_buf + y*(WIDTH*2) + (x*2)) = (WORD)rgb16(*(BYTE *)(col),*(BYTE *)(col+1),*(BYTE *)(col+2));
 
}
 
}
}
 
int main(int argc, char **argv)
140,9 → 151,11
 
screen(INITSTR);
 
FG_init(FG_PERIOD, FG_WCET, FG_W, FG_H);
FG_init(FG_PERIOD, FG_WCET, FG_W, FG_H, color);
 
FG_set_hook(elaborate_image);
 
FG_start_grabbing();
return 0;