int build_transformation(Mat float[100][225] matA, Mat float[100][225] matB, 
	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);
	matB = matB * (degree);
	matC = matA + matB;

	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);
		}
	}
	write_image(**output, x, y, filename);

	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;
	Mat float [100][225] matC;
	Mat int [100][225] output;
	float sum;
	float degree;

	imgA = read_image("mona2.ppm");
	imgB = read_image("lego2.ppm");

	y = &imgA;
	imgA = ++imgA;
	x = &imgB;
	imgA = ++imgA;
	imgB = ++imgB;
	imgB = ++imgB;
	
	for(i=0; i<100; i = i+1) {
		for(j=0; j<225; j = j+1) {
			k = &imgA;			
			matA[i][j] = to_float(k);
			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;
		}
	}
	
	degree = 0.75;
	matA = matA * (1.0 - degree);
	matB = matB * (degree);
	matC = matA + matB;

	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);
		}
	}
	write_image(**output, x, y, "mona_lego3.ppm");
	
	return 0;
}


