Category : Files from Magazines
Archive   : CUJ9306.ZIP
Filename : 1106074A

 
Output of file : 1106074A contained in archive : CUJ9306.ZIP
/*******************************************
*
* high_pixel(..
*
* This function replaces the pixel at
* the center of a 3x3, 5x5, etc. area
* with the max for that area.
*
*******************************************/

high_pixel(in_name, out_name, the_image, out_image,
il, ie, ll, le, size)
char in_name[], out_name[];
int il, ie, ll, le, size;
short the_image[ROWS][COLS],
out_image[ROWS][COLS];
{
int a, b, count, i, j, k,
length, sd2, sd2p1, ss, width;
short *elements;
struct tiff_header_struct image_header;

sd2 = size/2;
sd2p1 = sd2 + 1;

/**********************************************
*
* Allocate the elements array large enough
* to hold size*size shorts.
*
**********************************************/

ss = size*size;
elements = (short *) malloc(ss * sizeof(short));

if(does_not_exist(out_name)){
printf("\n\n output file does not exist %s",
out_name);
read_tiff_header(in_name, &image_header);
round_off_image_size(&image_header,
&length, &width);
image_header.image_length = length*ROWS;
image_header.image_width = width*COLS;
create_allocate_tiff_file(out_name, &image_header,
out_image);
} /* ends if does_not_exist */
read_tiff_image(in_name, the_image, il, ie, ll, le);

/***************************
*
* Loop over image array
*
****************************/

printf("\n");
for(i=sd2; i if( (i%10) == 0) printf("%d ", i);
for(j=sd2; j count = 0;
for(a=-sd2; a for(b=-sd2; b elements[count] = the_image[i+a][j+b];
count++;
}
}
sort_elements(elements, &ss);
out_image[i][j] = elements[ss-1];
} /* ends loop over j */
} /* ends loop over i */

fix_edges(out_image, sd2);

write_array_into_tiff_image(out_name, out_image,
il, ie, ll, le);

free(elements);

} /* ends high_pixel */




/*******************************************
*
* low_pixel(..
*
* This function replaces the pixel at
* the center of a 3x3, 5x5, etc. area
* with the min for that area.
*
*******************************************/

low_pixel(in_name, out_name, the_image, out_image,
il, ie, ll, le, size)
char in_name[], out_name[];
int il, ie, ll, le, size;
short the_image[ROWS][COLS],
out_image[ROWS][COLS];

{
int a, b, count, i, j, k,
length, sd2, sd2p1, ss, width;
short *elements;
struct tiff_header_struct image_header;

sd2 = size/2;
sd2p1 = sd2 + 1;

/**********************************************
*
* Allocate the elements array large enough
* to hold size*size shorts.
*
**********************************************/

ss = size*size;
elements = (short *) malloc(ss * sizeof(short));

if(does_not_exist(out_name)){
printf("\n\n output file does not exist %s",
out_name);
read_tiff_header(in_name, &image_header);
round_off_image_size(&image_header,
&length, &width);
image_header.image_length = length*ROWS;
image_header.image_width = width*COLS;
create_allocate_tiff_file(out_name, &image_header,
out_image);
} /* ends if does_not_exist */

read_tiff_image(in_name, the_image, il, ie, ll, le);

/***************************
*
* Loop over image array
*
****************************/

printf("\n");
for(i=sd2; i if( (i%10) == 0) printf("%d ", i);
for(j=sd2; j count = 0;
for(a=-sd2; a for(b=-sd2; b elements[count] = the_image[i+a][j+b];
count++;
}
}
sort_elements(elements, &ss);
out_image[i][j] = elements[0];
} /* ends loop over j */
} /* ends loop over i */

fix_edges(out_image, sd2);

write_array_into_tiff_image(out_name, out_image,
il, ie, ll, le);

free(elements);

} /* ends low_pixel */



  3 Responses to “Category : Files from Magazines
Archive   : CUJ9306.ZIP
Filename : 1106074A

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/