package com.cringe_studios.christmastreescanning;

import java.awt.image.BufferedImage;

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

public abstract class Scanner {	
//	BufferedImage frontSideImages[];
//	BufferedImage frontSideImagesRed[];
//	BufferedImage frontSideImagesGreen[];
//	BufferedImage frontSideImagesBlue[];
//	
//	BufferedImage rightSideImages[];
//	BufferedImage rightSideImagesRed[];
//	BufferedImage rightSideImagesGreen[];
//	BufferedImage rightSideImagesBlue[];
//	
//	BufferedImage behindSideImages[];
//	BufferedImage behindSideImagesRed[];
//	BufferedImage behindSideImagesGreen[];
//	BufferedImage behindSideImagesBlue[];
//	
//	BufferedImage leftSideImages[];
//	BufferedImage leftSideImagesRed[];
//	BufferedImage leftSideImagesGreen[];
//	BufferedImage leftSideImagesBlue[];
	
	protected byte gammaDelta = ImageScanner.GAMMA_DELTA_DEFAULT;
	protected boolean toMultipleGrayscaleImages = false;
	
//	Boolean distinctColorChannels = null; // use the non-primitive datatype, so the user has to set the state
//	Boolean sideCount = null; // use the non-primitive datatype, so the user has to set the state
	
//	public Scanner() {}

public abstract Homograph scan();	
	
//	public Point3D[] scan() {
//		if(distinctColorChannels == null || sideCount == null); //TODO error
//		
//		Point3D[] ret;
//		
//		if(distinctColorChannels == true && sideCount == true) {
//			
//		}else if(distinctColorChannels == true && sideCount == false) {
//			
//		}else if(distinctColorChannels == false && sideCount == true) {
//			
//		}else if(distinctColorChannels == false && sideCount == false) {
//			
//		}
//		
//		//TODO call SideScanner.scan for every side and merge the four sides into 3d points
//		
//		return null;
//	}
	
//	public void setData(ScannerData dataType, BufferedImage images[]) {
//		//TODO convert image to known format utilizing
//		// BufferedImage image = new BufferedImage(width, height,BufferedImage.TYPE_INT_RGB);
//		//Graphics g = image.getGraphics();  
//		//g.drawImage(colorImage, 0, 0, null);  
//		//g.dispose();
//		
//		if(distinctColorChannels == null || sideCount == null); //TODO error
//		
//		if(distinctColorChannels.booleanValue() == false) {
//			if(dataType.ordinal() >= ScannerData.IMAGE_FRONT_RED.ordinal() && dataType.ordinal() <= ScannerData.IMAGE_LEFT_BLUE.ordinal()); //TODO error
//			
//			if(sideCount.booleanValue() == false) {
//				switch (dataType){
//					case IMAGE_FRONT:
//					{
//						frontSideImages = images;
//						break;
//					}
//					case IMAGE_RIGHT:
//					{
//						rightSideImages = images;
//						break;
//					}
//						
//					case IMAGE_BEHIND:
//					case IMAGE_LEFT:
//					default:
//						//TODO error
//				}
//			}else {
//				switch (dataType){
//					case IMAGE_FRONT:
//					{
//						frontSideImages = images;
//						break;
//					}
//					case IMAGE_RIGHT:
//					{
//						rightSideImages = images;
//						break;
//					}
//						
//					case IMAGE_BEHIND:
//					{
//						behindSideImages = images;
//						break;
//					}
//					case IMAGE_LEFT:
//					{
//						leftSideImages = images;
//						break;
//					}
//					default:
//						//TODO error
//				}
//			}
//		}else{
//			if(dataType.ordinal() >= ScannerData.IMAGE_FRONT.ordinal() && dataType.ordinal() <= ScannerData.IMAGE_LEFT.ordinal()); //TODO error
//			if(sideCount.booleanValue() == false) {
//				if(dataType.ordinal() >= ScannerData.IMAGE_BEHIND_RED.ordinal() && dataType.ordinal() <= ScannerData.IMAGE_LEFT_BLUE.ordinal()){
//					//Todo error
//				}
//			}
//			
//			switch (dataType) {				
//				case IMAGE_FRONT_RED:
//				{
//					frontSideImagesRed = images;
//					break;
//				}
//				case IMAGE_FRONT_GREEN:
//				{
//					frontSideImagesGreen = images;
//					break;
//				}
//				case IMAGE_FRONT_BLUE:
//				{
//					frontSideImagesBlue = images;
//					break;
//				}
//				
//				case IMAGE_RIGHT_RED:
//				{
//					rightSideImagesRed = images;
//					break;
//				}
//				case IMAGE_RIGHT_GREEN:
//				{
//					rightSideImagesGreen = images;
//					break;
//				}
//				case IMAGE_RIGHT_BLUE:
//				{
//					rightSideImagesBlue = images;
//					break;
//				}
//				
//				case IMAGE_BEHIND_RED:
//				{
//					behindSideImagesRed = images;
//					break;
//				}
//				case IMAGE_BEHIND_GREEN:
//				{
//					behindSideImagesGreen = images;
//					break;
//				}
//				case IMAGE_BEHIND_BLUE:
//				{
//					behindSideImagesBlue = images;
//					break;
//				}
//				
//				case IMAGE_LEFT_RED:
//				{
//					leftSideImagesRed = images;
//					break;
//				}
//				case IMAGE_LEFT_GREEN:
//				{
//					leftSideImagesGreen = images;
//					break;
//				}
//				case IMAGE_LEFT_BLUE:
//				{
//					leftSideImagesBlue = images;
//					break;
//				}
//				default:
//					//TODO error
//			}
//		}
//	}
	
	/**
	 * Sets how many of the brightests pixels are looked for in the images
	 * @param gammaDelta the new gammaDeltaValue, default is 0 (only the brightest pixels)
	 */
	public void setGammaDelta(byte gammaDelta) {
		this.gammaDelta = gammaDelta;
	}
	
	/**
	 * Set, wether an image should be converted to multiple grayscale images (per color channel), or to a single grayscale image
	 * Default: false
	 * @param toMultipleGrayscaleImages
	 */
	public void setMultipleGrayScaleImages(boolean toMultipleGrayscaleImages) {
		this.toMultipleGrayscaleImages = toMultipleGrayscaleImages;
	}
	
//	/**
//	 * 
//	 * @param useDistinctRGBImages if this parameter is true, you have to use the IMAGE_*_RED/_GREEN/_BLUE enum types in the setData method
//	 */
//	public void setDistinctColorChannels(boolean useDistinctRGBImages) {
//		this.distinctColorChannels = Boolean.valueOf(useDistinctRGBImages);
//	}
//	
//	/**
//	 * 
//	 * @param useAllFourSides if this Parameter is true, you have to give images for all sides with the "setData" method, if false, you may only give two sides: front and right
//	 */
//	public void setSideCount(boolean useAllFourSides) {
//		this.sideCount = Boolean.valueOf(useAllFourSides);
//	}
}
