package pl.edu.uj.JImageStream.filters.color;

import pl.edu.uj.JImageStream.api.core.Filter;
import pl.edu.uj.JImageStream.model.Pixel;

public class InvertFilter extends Filter {
    @Override
    public void apply(int x, int y) {
        Pixel pixel = getPixel(x, y);
        int red = 255 - pixel.getRed();
        int green = 255 - pixel.getGreen();
        int blue = 255 - pixel.getBlue();
        setPixel(x, y, new Pixel(red, green, blue, pixel.getAlpha()));
    }
}

@@ -276,18 +276,21 @@
     
-int red = 
+pixel.setRed(
 255 
@@ -305,16 +305,17 @@
 getRed()
+)
 ;%0A      
@@ -320,20 +320,23 @@
     
-int g
+pixel.setG
 reen
- = 
+(
 255 
@@ -353,16 +353,17 @@
 tGreen()
+)
 ;%0A      
@@ -368,19 +368,22 @@
     
-int blue = 
+pixel.setBlue(
 255 
@@ -399,16 +399,17 @@
 etBlue()
+)
 ;%0A      
@@ -429,53 +429,13 @@
  y, 
-new Pixel(red, green, blue, pixel.getAlpha())
+pixel
 );%0A 

Remove ints from InvertFilter