Skip to content
Snippets Groups Projects
Select Git revision
  • 9915409c44149a5b1bb1374e797f56a5a5e9ab2c
  • main default protected
2 results

AuthenticationService.java

Blame
  • Forked from LABOUREL Arnaud / M1 INFO FSI TP Template
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    CrissCross.java 612 B
    /**
     * Created by Arnaud Labourel on 04/10/2018.
     */
    public class CrissCross implements Transform{
    
        private final int size;
    
        public CrissCross(int size){
            this.size = size;
        }
    
        @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) {
            if(x % size == 0 || y % size ==0){
                image.setPixel(ByteGrayColor.BLACK, x, y);
            }
        }
    }