class Mutation { Mutation() { } void mutate(PGraphics pg) { pg.filter(INVERT); } } class InvertMutation extends Mutation { } class PosterizeMutation extends Mutation { void mutate(PGraphics pg) { pg.filter(POSTERIZE, 4); } } class BlurMutation extends Mutation { void mutate(PGraphics pg) { pg.filter(BLUR, 3); } } class ReddenMutation extends Mutation { void mutate(PGraphics pg) { pg.beginDraw(); pg.noStroke(); pg.fill(255, 0, 0, 64); pg.rect(0, 0, 32, 32); pg.endDraw(); } } class VerticalMirrorMutation extends Mutation { void mutate(PGraphics pg) { pg.beginDraw(); for (int i = 0; i < 16; i++) { for (int j = 0; j < 32; j++) { pg.set(i, j, pg.get(32-i, j)); } } pg.endDraw(); } } class HorizontalMirrorMutation extends Mutation { void mutate(PGraphics pg) { pg.beginDraw(); for (int i = 0; i < 32; i++) { for (int j = 0; j < 16; j++) { pg.set(i, j, pg.get(i, 32-j)); } } pg.endDraw(); } }