ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/hexbit.c
Revision: 3.2
Committed: Fri Nov 5 03:31:38 2004 UTC (19 years, 7 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 3.1: +1 -1 lines
State: FILE REMOVED
Log Message:
Removed unused programs and files from distribution (sources to CVS attic)

File Contents

# User Rev Content
1 greg 3.1 #ifndef lint
2 greg 3.2 static const char RCSid[] = "$Id: hexbit.c,v 3.1 2003/02/22 02:07:27 greg Exp $";
3 greg 3.1 #endif
4     /*
5     * Convert from Radiance picture to bitmap usable by hexbit4x1.fnt
6     *
7     * pipe input from "pvalue -h -b -di [picture]"
8     */
9    
10     #include <stdio.h>
11    
12     main()
13     {
14     int xres, yres;
15     int i, j, i1,i2,i3,i4;
16    
17     if (scanf("-Y %d +X %d\n", &yres, &xres) != 2)
18     exit(1);
19     for (i = 0; i < yres; i++) {
20     for (j = 0; j < xres/4; j++) {
21     if (scanf("%d\n%d\n%d\n%d\n", &i1, &i2, &i3, &i4) != 4)
22     exit(1);
23     printf("%01X", (i1<128)<<3|(i2<128)<<2|(i3<128)<<1|(i4<128));
24     }
25     for (j = xres%4; j--; ) /* should get it, but too lazy */
26     scanf("%*d\n");
27     putchar('\n');
28     }
29     exit(0);
30     }