Line | |
---|
1 | #include "stdio.h" |
---|
2 | |
---|
3 | #define NBLOCS 32 |
---|
4 | #define THRESHOLD 200 |
---|
5 | |
---|
6 | int main() |
---|
7 | { |
---|
8 | char buf_in[128*128]; |
---|
9 | char buf_out[128*128]; |
---|
10 | int i; |
---|
11 | int base = 0; |
---|
12 | |
---|
13 | while(base < 5*NBLOCS) { |
---|
14 | |
---|
15 | tty_printf("\n *** image %d *** at date = %d \n", base/NBLOCS, proctime()); |
---|
16 | |
---|
17 | /* Phase 1 : lecture image sur le disque et transfert vers buf_in */ |
---|
18 | if( ioc_read(base, buf_in, NBLOCS) ) |
---|
19 | { |
---|
20 | tty_printf("echec io_read\n"); |
---|
21 | exit(); |
---|
22 | } |
---|
23 | else |
---|
24 | { |
---|
25 | ioc_completed(); |
---|
26 | tty_printf("io_read completed at date = %d \n",proctime()); |
---|
27 | } |
---|
28 | |
---|
29 | /* Phase 2 : transfert de buf_in vers buf_out avec seuillage */ |
---|
30 | for(i=0 ; i<128*128 ; i++) |
---|
31 | { |
---|
32 | if( buf_in[i] > THRESHOLD ) buf_out[i] = 255; |
---|
33 | else buf_out[i] = buf_in[i]; |
---|
34 | } |
---|
35 | tty_printf("image processing completed at date = %d \n",proctime()); |
---|
36 | |
---|
37 | /* Phase 3 : transfert de buf_out vers le frame buffer par dma */ |
---|
38 | if( fb_sync_write(0,buf_out,128*128) ) |
---|
39 | { |
---|
40 | tty_printf("echec fb_write\n"); |
---|
41 | exit(); |
---|
42 | } |
---|
43 | else |
---|
44 | { |
---|
45 | tty_printf("transfer completed at date = %d \n",proctime()); |
---|
46 | } |
---|
47 | |
---|
48 | base = base + NBLOCS; |
---|
49 | } // end while |
---|
50 | |
---|
51 | exit(); |
---|
52 | |
---|
53 | return 0; |
---|
54 | |
---|
55 | } // end main |
---|
Note: See
TracBrowser
for help on using the repository browser.