Skip to content
Snippets Groups Projects
Select Git revision
  • main
  • melissa
  • yanis
  • variant
4 results

build.gradle

Blame
  • Forked from COUETOUX Basile / FirefighterStarter
    Source project has a limited visibility.
    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);
        }
    }