/[opencvs]/eyes/1440_to_2880.c
ViewVC logotype

Contents of /eyes/1440_to_2880.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Mon Nov 12 07:33:44 2012 UTC (5 years, 5 months ago) by hib
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/plain
cleanup
1 /* When making a grey scale alpha rendition, for whatever reason, there are spots where color still
2 exists. It is consuming to fille these in by hand. So this program filles them in with a random walk.
3 */
4
5
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <math.h>
9
10 #include "util.h"
11
12
13
14
15
16 /* usage tilify xsize ysize seed basefile */
17 int main (int argc,char *argv[]) {
18 int xsize;
19 int ysize;
20 if (argc==4) {
21 xsize=atoi(argv[1]);
22 ysize=atoi(argv[2]);
23 }
24 else {
25 fprintf(stderr,"usage 1440_to_2880 xsize ysize\n"
26 "Where file has x|y|r|g|b text format\n");
27 exit(-1);
28 }
29 FILE *base;
30 base = stdin;
31 char basebuf[10001];
32 char otherbuf[10001];
33 char alphabuf[10001];
34 char hologrambuf[10001];
35
36
37 printf("# ImageMagick pixel enumeration: %d,%d,255,rgb\n",xsize*2,ysize*2);
38 while (fgets(basebuf,10000,base)) {
39 char *q;
40 int xb,yb,rb,gb,bb;
41 int xo,yo,ro,go,bo;
42 int xa,ya,ra,ga,ba;
43 int hb;
44 xb = fieldi(basebuf,0);
45 yb = fieldi(basebuf,1);
46 rb = fieldi(basebuf,2);
47 gb = fieldi(basebuf,3);
48 bb = fieldi(basebuf,4);
49 int x,y,rf,gf,bf;
50 x=xb*2;
51 y=yb;
52 rf=rb;
53 gf=gb;
54 bf=bb;
55 unsigned int total;
56 total = rf*65536+gf*256+bf;
57 printf("%d,%d: (%d,%d,%d) #%06x rgb(%d,%d,%d)\n",
58 x,y,rf,gf,bf,total,rf,gf,bf);
59 x++;
60 rf=255;
61 gf=255;
62 bf=255;
63 printf("%d,%d: (%d,%d,%d) #%06x rgb(%d,%d,%d)\n",
64 x,y,rf,gf,bf,total,rf,gf,bf);
65 }
66
67 exit(0);
68 }
69
70
71
72

  ViewVC Help
Powered by ViewVC 1.1.5