Hi. Beginner here. I have a question about a Java program on manipulation of photos.
I want to learn how to rotate a photo 90 degrees, rotate it 180 degrees, enlarge it by doubling its width and length, and stitching them.
So far I have written a code segment on how to copy a photo:
public class PhotoTools {
public static Photograph copy(Photograph photo) {
Photograph copy_of_photo = new Photograph(photo.getWidth(), photo.getHeight()); /*create a new photo and get dimensions*/
for (int row = 0; row < photo.getWidth(); row++){ //2 loops going through each column then row
for (int col = 0; col < photo.getHeight(); col++){
Pixel copy = photo.getPixel(row, col); //set pixels to get the pixels in the photo
copy_of_photo.setPixel(row, col, copy); //copy pixels to new photo
}
}
return copy_of_photo; //return new copied photo
}
---------------------------------------------------------------------------
Please do not give me actual code.
I was hoping I could get hints on ways to approach the other methods.
Thank you for your time.