hw/hw5/SeamCarver.java
public double energy(int x, int y) {
        // x stands for column, y stands for row

        // a 3-by-4 image (x, y) W by H
        // (0, 0)  	  (1, 0)  	  (2, 0)
        // (0, 1)  	  (1, 1)  	  (2, 1)
        // (0, 2)  	  (1, 2)  	  (2, 2)
        // (0, 3)  	  (1, 3)  	  (2, 3)

        if (x < 0 || y < 0 || x > width()-1 || y > height()-1) {
            throw new IndexOutOfBoundsException();
        }

        return energyX(x, y) + energyY(x, y);
    }
/**  energy of pixel at column x and row y */
energy of pixel at column x and row y
energy of pixel at column x and row y
public double energy(int x, int y) {
        if (x < 0 || y < 0 || x > width()-1 || y > height()-1) {
            throw new IndexOutOfBoundsException();
        }
        return energyX(x, y) + energyY(x, y);
    }
public double energy ( int x , int y ) { if ( x < 0 || y < 0 || x > width ( ) - 1 || y > height ( ) - 1 ) { throw new IndexOutOfBoundsException ( ) ; } return energyX ( x , y ) + energyY ( x , y ) ; }
energy of pixel at column x and row y
energy of pixel at column x and row y
// x stands for column, y stands for row // a 3-by-4 image (x, y) W by H // (0, 0)  	  (1, 0)  	  (2, 0) // (0, 1)  	  (1, 1)  	  (2, 1) // (0, 2)  	  (1, 2)  	  (2, 2) // (0, 3)  	  (1, 3)  	  (2, 3)