Changes

Jump to: navigation, search

Team Z

742 bytes added, 21:26, 10 February 2013
Project Image Spitfire
}
}
 
// Convert the unsigned characters to integers
image.setPixelVal(i, j, val);
}
 
IMAGE Rotation
 
<pre>// goes through the array of the oldImage, uses the formulas to find where the pixel should go // then puts the old pixel value into the new pixel position on the tempImage for(int r = 0; r < rows; r++) { for(int c = 0; c < cols; c++) { r1 = (int) (r0 + ((r - r0) * cos(rads)) - ((c - c0) * sin(rads))); c1 = (int) (c0 + ((r - r0) * sin(rads)) + ((c - c0) * cos(rads))); if(inBounds(r1,c1)) // makes sure the new pixel location is in bounds, { tempImage.pixelVal[r1][c1] = oldImage.pixelVal[r][c]; } } } for(int i = 0; i < rows; i++) { for(int j = 0; j < cols; j++) { if(tempImage.pixelVal[i][j] == 0) tempImage.pixelVal[i][j] = tempImage.pixelVal[i][j+1]; } }</pre><br>
= Assignment 2 =
= Assignment 3 =
1
edit

Navigation menu