선생이 흑백에서부터 네거티브 효과내는 이미지 필터 만들래서 일단 흑백은 만들어봤다

package filters;
import imagelab.*;


public class Negative implements ImageFilter {

        // Attribute to store the modified image
        ImgProvider filteredImage;

        public void filter (ImgProvider ip) {

                // Grab the pixel information and put it into a 2D array
                short[][] im = ip.getBWImage();

                // Make variables for image height and width
                int height = im.length;
                int width  = im[0].length;

                // Create a new array to store the modified image
                short[][] newImage = new short[height][width];

                // Loop through the original image and store the modified
                // version in the newImage array
                for (int row = 0; row < height; row++) {
                        for (int col = 0; col < width; col++) {
                                // flips the image horizontally by reversing the column direction
                                newImage[row][col] = im[row][(width - 1) - col];
                        }
                }

                // Create a new ImgProvider and set the filtered image to our new image
                filteredImage = new ImgProvider();
                filteredImage.setBWImage(newImage);

                // Show the new image in a new window with title "Flipped Horizontally"
                filteredImage.showPix("Flipped Horizontally");
        }

        public ImgProvider getImgProvider() {
                return filteredImage;
        }

        // This is what users see in the Filter menu
        public String getMenuLabel() {
                return "Horizontal Flip (BW)";
        }

}

여기서 네거티브 어떻게 만들어요?
0~255 인트에서 정한 숫자만큼 네거티브 강도 조절하는거임

참고로 유학하는 고딩인데 지금 이수업때문에 성적운지함
제발 이번학기라도 B좀 맞아보자는 심정에 어렵게 묻는거에요
자세한 도움이 필요합니다 ㅠ