/[opencvs]/eyes/analyze_source_image_filter.c
ViewVC logotype

Contents of /eyes/analyze_source_image_filter.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations)
Thu Mar 8 11:49:30 2012 UTC (6 years, 1 month ago) by hib
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -0 lines
File MIME type: text/plain
building girl3 (jenni)
1 #include <stdio.h>
2
3 int main (int argc,char *argv[]) {
4 long maxline=0;
5 char buf[10000];
6 if (argc ==3) {
7 long a,b;
8 a = atoi(argv[1]);
9 b = atoi(argv[2]);
10 maxline = a*b;
11 }
12 long count;
13 count=0;
14 while (
15 ((maxline==0)||(count<maxline))
16 &&(gets(buf))
17 ) {
18 if (buf[0]=='#') continue;
19 char buf2[10000];
20 char *a,*b;
21 a=buf;b=buf2;
22 int ctr=0;
23 while (*a) {
24 if (*a != '(') {
25 if (*a == ' ') {
26 a++;
27 continue;
28 }
29 else if ((*a == ':')|| (*a == ',')|| (*a ==')')) {
30 *b++='|';
31 }
32 else
33 *b++= *a;
34 }
35 a++;
36 }
37 *b = '\0';
38
39 b = buf2;
40 ctr = 0;
41 while (*b) {
42 if (*b == '|') {
43 ctr++;
44 if (ctr==5) {
45 *b = '\0';
46 break;
47 }
48 }
49 b++;
50 }
51 puts(buf2);
52 count++;
53 continue;
54 }
55 }
56 /*convert $1 -depth 8 txt: | \
57 grep -v '^#' | \
58 sed s/\(//g | \
59 awk '{print $1 $2 $3 $4}' | \
60 sed s/,/\|/g | \
61 sed s/:/\|/g | \
62 sed s/\)/\|/g |
63 field 1 2 3 4 5
64 # convert dumps stuff out
65 # we then get rid of comments
66 # then we git rid of open parens
67 # then print out x,y:r,g,b)fffff
68 # then filter to x|y:r|g|b)fdffdf
69 # then filter to x|y|r|g|b)fddfdfdf
70 #then filter to x|y|r|g|b|ffffff
71 # the fff is not always there - erroneous.
72 # so we get rid of that by using field
73 */

  ViewVC Help
Powered by ViewVC 1.1.5