Esempio n. 1
0
int main(int argc, char *argv[]){

	// storing arguments from the comman line
	int filter_width = parseWidth(argv);
	float filter_weight[filter_width*filter_width];
	char *inputName = parseIn(argv);
	char *outputName = parseOut(argv);

	// parses the input weights from positional parameters
	parseWeight(filter_weight, argv, argc);

	// opening the files
	FILE *imageIn = fopen(inputName, "rb");
	FILE *imageOut = fopen(outputName, "wb");

	// initialize the before modification and after modification arrays
	unsigned char before[imageSize(imageIn)];
	unsigned char after[imageSize(imageIn)];

	// loading the raw data in to the before array
	loadBMP(imageIn, before);

	// apply the filter
	doFiltering(before, filter_weight, filter_width, after);

	// write to the new file
	fwrite(after, sizeof(unsigned char), imageSize(imageIn), imageOut);

	// closing the file.
	fclose(imageIn);
	fclose(imageOut);
}
Esempio n. 2
0
template<class T> WStringObjectList<T>::WStringObjectList( const char *str ) {
    /****************************************************************************/

    parseIn( str );
}