package io.gitlab.jfronny.ImgJava;

import io.gitlab.jfronny.ImgJava.imageProcessing.ImageUtil;
import io.gitlab.jfronny.ImgJava.util.ImageStackViewer;
import io.gitlab.jfronny.ImgJava.util.Picture;

import java.awt.*;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class Main {
    public static void main(String[] args) {
        try {
            ImageStackViewer stackViewer = new ImageStackViewer(new Dimension(1000, 1000));
            stackViewer.setTitle("Jf Example");
            Path run = Paths.get("./run/");
            if (!Files.isDirectory(run))
                Files.createDirectory(run);
            stackViewer.push(ImageUtil.mirror(stackViewer.push(new Picture("iris.jpg")))).save(run.resolve("cum.png"));
            stackViewer.repaint();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
