int build_transformation(Mat float[100][225] matA, Mat float[100][225] matB, #function to tranform image represented by matA into image represented by matB to the degree of degree#
	int x, int y, float degree, String filename) {

	Mat float [100][225] matC;
	Mat int [100][225] output;
	float sum;
	int i;
	int j;

	matA = matA * (1.0 - degree); # multiply matrix by floating point value#
	matB = matB * (degree);
	matC = matA + matB; #Matrix addtion#

	for(i=0; i< 100; i = i+1) {
		for(j =0; j<225; j=j+1) {
			sum = matC[i][j];
			output[i][j] = to_int(sum); #building back output matrix, which is composed of integers#
		}
	}
	write_image(**output, x, y, filename); #writing the output image based off the output matrix#

	return 0;
}

int main() {
	Mat float [100][225] matA;
	Mat float [100][225] matB;
	Img imgA;
	Img imgB;
	int k;
	int i;
	int j;
	int x;
	int y;

	#reading in images#
	imgA = read_image("edwards2.ppm");
	imgB = read_image("shaggy2.ppm");

	#getting size information of images#
	y = &imgA;
	imgA = ++imgA;
	x = &imgB;
	imgA = ++imgA;
	imgB = ++imgB;
	imgB = ++imgB;
	
	#building images#
	for(i=0; i<100; i = i+1) {
		for(j=0; j<225; j = j+1) {
			k = &imgA;			
			matA[i][j] = to_float(k); #converting each element of the matrix for float for future operation#
			imgA = ++imgA;
		}
	}

	for(i=0; i<100; i = i+1) {
		for(j=0; j<225; j = j+1) {
			k = &imgB;			
			matB[i][j] = to_float(k);
			imgB = ++imgB;
		}
	}
	
	#transforming image pointed to by imgA into image pointed to by imgB#
	build_transformation(matA, matB, x, y, 0.0, "shaggy_edwards0.ppm");
	build_transformation(matA, matB, x, y, 0.25, "shaggy_edwards1.ppm");
	build_transformation(matA, matB, x, y, 0.5, "shaggy_edwards2.ppm");
	build_transformation(matA, matB, x, y, 0.75, "shaggy_edwards3.ppm");
	build_transformation(matA, matB, x, y, 1.0, "shaggy_edwards4.ppm");
	
	return 0;
}


