Open main menu

CDOT Wiki β

Changes

Team Z

8 bytes added, 22:27, 10 February 2013
Project Image Spitfire
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