From: Joshua Grams Date: Thu, 7 Apr 2005 11:59:12 +0000 (+0000) Subject: removed pnmoutline (no longer necessary). X-Git-Tag: 0.1~1 X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=commitdiff_plain;h=6f387565c4a8faed189e327b5102d05debf79163 removed pnmoutline (no longer necessary). --- diff --git a/Makefile b/Makefile index 504279a..98fff2e 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ vor: $(objects) include gfx.mk clean: - rm -f *.o vor pnmoutline $(graphics) + rm -f *.o vor $(graphics) install: all if [ ! -d $(DATA_PREFIX) ]; then mkdir $(DATA_PREFIX); fi diff --git a/oldship.png b/oldship.png deleted file mode 100644 index be23002..0000000 Binary files a/oldship.png and /dev/null differ diff --git a/pnmoutline.c b/pnmoutline.c deleted file mode 100644 index 1315da5..0000000 --- a/pnmoutline.c +++ /dev/null @@ -1,116 +0,0 @@ -#include -#include - -struct pam inpam, outpam; -tuple *inrows[3]; -tuple *outrow; - -void -row_fill_black(struct pam *p, tuple *row) -{ - int i, j; - - for(i=0; iwidth; i++) - for(j=0; j<3; j++) - row[i][j]=0; -} - -int -is_black(unsigned int row, unsigned int column) -{ - - sample *s = inrows[row][column]; - if(s[0]==0 && s[1]==0 && s[2]==0) return ~0; - else return 0; -} - -int -is_edge(unsigned int column) -{ - unsigned int n = 0; - if(is_black(0,column)) n++; - if(is_black(2,column)) n++; - if(column == 0 || is_black(1, column-1)) n++; - if(column == outpam.width-1 || is_black(1, column+1)) n++; - return n>1 && n<4; -} - -void -set_black(unsigned int column) -{ - sample *s = outrow[column]; - s[0]=0; s[1]=0; s[2]=0; -} - -void -set_white(unsigned int column) -{ - sample *s = outrow[column]; - s[0]=255; s[1]=255; s[2]=255; -} - -void -copy_tuple(sample *dest, sample *src) -{ - dest[0] = src[0]; - dest[1] = src[1]; - dest[2] = src[2]; -} - -void -copy_row(struct pam *p, tuple *dest, tuple *src) -{ - int i; - - for(i=0; iwidth; i++) copy_tuple(dest[i], src[i]); -} - -void -next_row(unsigned int read) -{ - copy_row(&outpam, inrows[0], inrows[1]); - copy_row(&outpam, inrows[1], inrows[2]); - /* - memcpy(inrows[0], inrows[1], outpam.width*sizeof(sample)*3); - memcpy(inrows[1], inrows[2], outpam.width*sizeof(sample)*3); - */ - if(read) pnm_readpamrow(&inpam, inrows[2]+1); - else row_fill_black(&outpam, inrows[2]); -} - - -int -main(int argc, char **argv) -{ - unsigned int row,column,i; - - pnm_init(&argc, argv); - pnm_readpaminit(stdin, &inpam, sizeof(struct pam)); - - outpam = inpam; - outpam.width+=2; outpam.height+=2; - outpam.file = stdout; - pnm_writepaminit(&outpam); - - for(i=0; i<3; i++) { - inrows[i] = pnm_allocpamrow(&outpam); - row_fill_black(&outpam, inrows[i]); - } - - outrow = pnm_allocpamrow(&outpam); - - for(row=0; row < outpam.height; row++) { - next_row(row < inpam.height); - for(column=0; column