package com.cringe_studios.christmastreescanning;

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

import com.cringe_studios.christmastreescanning.scanning.SideScanner;
import com.cringe_studios.christmastreescanning.scanning.SingleColoredSideScanner;

public class TwoSidedScanner extends SingleColorScanner {
	private SideScanner frontSideScanner;
	private SideScanner rightSideScanner;
	
	BufferedImage frontSideImages[];
	BufferedImage rightSideImages[];
	
	public TwoSidedScanner(BufferedImage frontSideImages[], BufferedImage rightSideImages[]) {
		this.frontSideImages = frontSideImages;
		this.rightSideImages = rightSideImages;
		//TODO
	}
	
	@Override	
	public Homograph scan() {
		frontSideScanner = new SingleColoredSideScanner(frontSideImages, this.gammaDelta);
		rightSideScanner = new SingleColoredSideScanner(rightSideImages, this.gammaDelta);
		
		frontSideScanner.scan();
		frontSideScanner.normalizePoints();
		Point2D[] frontPoints = frontSideScanner.getPoints();
		
		rightSideScanner.scan();
		rightSideScanner.normalizePoints();
		Point2D[] rightSidePoints = rightSideScanner.getPoints();
		
		return new Homograph2(frontPoints, rightSidePoints);
	}
}
