src/io/github/marwlod/seam_carving/SeamCarver.java
// remove vertical seam from current picture
remove vertical seam from current picture
remove vertical seam from current picture
public void removeVerticalSeam(int[] seam) {
        validateSeam(seam, picHeight, picWidth);
        Picture narrowerPicture = new Picture(picWidth-1, picHeight);
        int[][] narrowerRgb = new int[picWidth-1][picHeight];
        for (int y = 0; y < picHeight; y++) {
            for (int x = 0, oldX = 0; x < picWidth-1; x++, oldX++) {
                if (x == seam[y]) oldX++;
                narrowerPicture.set(x, y, picture.get(oldX, y));
                narrowerRgb[x][y] = rgb[oldX][y];
            }
        }
        picture = narrowerPicture;
        rgb = narrowerRgb;
        picWidth--;
    }
public void removeVerticalSeam ( int [ ] seam ) { validateSeam ( seam , picHeight , picWidth ) ; Picture narrowerPicture = new Picture ( picWidth - 1 , picHeight ) ; int [ ] [ ] narrowerRgb = new int [ picWidth - 1 ] [ picHeight ] ; for ( int y = 0 ; y < picHeight ; y ++ ) { for ( int x = 0 , oldX = 0 ; x < picWidth - 1 ; x ++ , oldX ++ ) { if ( x == seam [ y ] ) oldX ++ ; narrowerPicture . set ( x , y , picture . get ( oldX , y ) ) ; narrowerRgb [ x ] [ y ] = rgb [ oldX ] [ y ] ; } } picture = narrowerPicture ; rgb = narrowerRgb ; picWidth -- ; }
remove vertical seam from current picture
remove vertical seam from current picture