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 class SingleColoredSideScanner extends SideScanner {
	private BufferedImage sideImages[];

	byte gammaDelta = ImageScanner.GAMMA_DELTA_DEFAULT;
	double baseline = 0.0;
	double minX = Double.NEGATIVE_INFINITY;
	double maxX = Double.POSITIVE_INFINITY;

	boolean useDefaultValues;

	Point2D foundPoints[] = null;

	public SingleColoredSideScanner(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;
	}

	// Everything default values
	public SingleColoredSideScanner(BufferedImage[] images) {
		this.sideImages = images;

		this.useDefaultValues = true;
	}
	
	@Override
	public void scan() {
		int imagesLength = this.sideImages.length;

		foundPoints = new Point2D[imagesLength];

		for (int i = 0; i < imagesLength; i++) {
			if (this.useDefaultValues) {
				//TODO
				//foundPoints[i] = ImageScanner.getBrightestSpot(sideImages[i]);
			} else {
				//TODO
				//foundPoints[i] = ImageScanner.getBrightestSpot(sideImages[i], this.gammaDelta);
			}
		}
	}
	
	@Override
	public Point2D[] getPoints() {
		return foundPoints;
	}
}
