Select Git revision
Invert.java
Forked from
LABOUREL Arnaud / Mandelbrot Template
7 commits behind, 7 commits ahead of the upstream repository.
LABOUREL Arnaud authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Invert.java 475 B
/**
* Created by Arnaud Labourel on 04/10/2018.
*/
public class Invert implements Transform{
@Override
public void applyTo(GrayImage image) {
for(int x = 0; x < image.getWidth(); x++) {
for (int y = 0; y < image.getHeight(); y++) {
modifyPixel(image, x, y);
}
}
}
private void modifyPixel(GrayImage image, int x, int y) {
image.setPixel(image.getPixelGrayColor(x, y).invert(), x, y);
}
}