package com.cringe_studios.christmastreescanning.scanning;

import java.awt.geom.Point2D;
import java.awt.image.BufferedImage;

import com.cringe_studios.christmastreescanning.scanning.image_scanning.ImageScanner;

public abstract class SideScanner {
//	private BufferedImage sideImages[];
//	private BufferedImage sideImagesRed[];
//	private BufferedImage sideImagesGreen[];
//	private BufferedImage sideImagesBlue[];
//	
	protected byte gammaDelta = ImageScanner.GAMMA_DELTA_DEFAULT;
	protected double baseline = 0.0;
	protected double minX = Double.NEGATIVE_INFINITY;
	protected double maxX = Double.POSITIVE_INFINITY;
	
	protected boolean useDefaultValues;
	
	protected Point2D foundPoints[] = null;
//	
//	public SideScanner(BufferedImage[] images, byte gammaDelta, double baseline, double minX, double maxX) {
//		this.sideImages = images;
//		
//		this.gammaDelta = gammaDelta;
//		this.baseline = baseline;
//		this.minX = minX;
//		this.maxX = maxX;
//		
//		this.useDefaultValues = false;
//	}
//	
//	public SideScanner(BufferedImage[] imagesRed, BufferedImage[] imagesGreen, BufferedImage[] imagesBlue, byte gammaDelta, double baseline, double minX, double maxX) {
//		if(!(imagesRed.length == imagesGreen.length && imagesGreen.length == imagesBlue.length)); // TODO error
//		this.sideImagesRed = imagesRed;
//		this.sideImagesGreen = imagesGreen;
//		this.sideImagesBlue = imagesBlue;
//		
//		this.gammaDelta = gammaDelta;
//		this.baseline = baseline;
//		this.minX = minX;
//		this.maxX = maxX;
//		
//		this.useDefaultValues = false;
//	}
//	
//	// Everything default values
//	public SideScanner(BufferedImage[] images) {
//		this.sideImages = images;
//		
//		this.useDefaultValues = true;
//	}
//	
//	public SideScanner(BufferedImage[] imagesRed, BufferedImage[] imagesGreen, BufferedImage[] imagesBlue) {
//		if(!(imagesRed.length == imagesGreen.length && imagesGreen.length == imagesBlue.length)); // TODO error
//		
//		this.sideImagesRed = imagesRed;
//		this.sideImagesGreen = imagesGreen;
//		this.sideImagesBlue = imagesBlue;
//		
//		this.useDefaultValues = true;
//	}
	
	public abstract void scan();// {
//		int imagesLength = 0;
//		if(this.sideImages != null) {
//			imagesLength = this.sideImages.length;
//		}else {
//			imagesLength = this.sideImagesRed.length;	
//		}
//		
//		foundPoints = new Point2D[imagesLength];
//		
//		for(int i = 0; i < imagesLength; i++) {
//			if(this.sideImages != null) {
//				if(this.useDefaultValues) {
//					foundPoints[i] = ImageScanner.getBrightestSpot(sideImages[i]);
//				}else {
//					foundPoints[i] = ImageScanner.getBrightestSpot(sideImages[i], this.gammaDelta);
//				}
//			}else {
//				foundPoints[i] = ImageScanner.getBrightestSpot(this.sideImagesRed[i], this.sideImagesGreen[i], this.sideImagesBlue[i], this.gammaDelta);
//			}
//		}
//	}
	
	public abstract Point2D[] getPoints(); //{
//		return foundPoints;
//	}
	
	public void normalizePoints() {
		if(foundPoints == null); //TODO error
		//TODO
	}
	
}
