/*
 * This file is part of MiToBo, the Microscope Image Analysis Toolbox.
 *
 * Copyright (C) 2010 - 2020
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Fore more information on MiToBo, visit
 *
 *    http://www.informatik.uni-halle.de/mitobo/
 *
 */
package einfBV.serie_00.aufgabe_2;
import de.unihalle.informatik.Alida.exceptions.ALDOperatorException;
import de.unihalle.informatik.Alida.annotations.ALDAOperator;
import de.unihalle.informatik.Alida.annotations.ALDAOperator.Level;
import de.unihalle.informatik.Alida.annotations.Parameter;
import de.unihalle.informatik.MiToBo.core.datatypes.images.*;
import de.unihalle.informatik.MiToBo.core.operator.*;
/**
 * Operator to invert and/or flip an image.
 */
// This annotation is necessary for MiToBo to automatically index the operator.
@ALDAOperator(genericExecutionMode=ALDAOperator.ExecutionMode.ALL,
        level=Level.APPLICATION)
public class MiToBoTransformImage extends MTBOperator {
    /**
     * 8-bit input image.
     */
    @Parameter( label= "Input Image", required = true, dataIOOrder = 0,
        direction = Parameter.Direction.IN, description = "Input image.")
    private MTBImageByte inImg = null;
    /**
     * Flag to invert the image.
     */
    @Parameter( label= "Invert image", required = true, dataIOOrder = 1,
        direction = Parameter.Direction.IN, description = "Flag for inverting image.")
    private boolean doInvert = true;
    /**
     * Flag to flip the image.
     */
    @Parameter( label= "Flip image at center", required = true, dataIOOrder = 2,
        direction = Parameter.Direction.IN, description = "Flag for flipping.")
    private boolean doFlipping = true;
    /**
     * Contains inverted input image, if option is enabled.
     */
    @Parameter( label= "Inverted image", required = true,
            direction = Parameter.Direction.OUT, description = "Inverted image.")
    private MTBImageByte invertedImg = null;
    /**
     * Contains the flipped image, if option is enabled.
     */
    @Parameter( label= "Flipped image", required = true,
            direction = Parameter.Direction.OUT, description = "Flipped image.")
    private MTBImageByte flippedImg = null;
    /**
     * Default constructor, always required even if nothing happens here!
     *  @throws ALDOperatorException
     */
    public MiToBoTransformImage() throws ALDOperatorException {
        // nothing to do here
    }       
    /**
     * This method does the actual work and is mandatory.
     */
    @Override
    protected void operate() {
        if(this.doFlipping) {
            int x = this.inImg.getSizeX()/2;
            int y = this.inImg.getSizeY()/2;
            
        }
        
        if(this.doInvert) {
            
        }
        
        
    }
}