Added a Scanner and Side Scanner Class and a scanning package;
everything in the scanning package is internal stuff
This commit is contained in:
parent
1b56dd47f0
commit
b750ae9344
@ -0,0 +1,203 @@
|
||||
package com.cringe_studios.christmastreescanning;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
public 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[];
|
||||
|
||||
byte gammaDelta = 0;
|
||||
|
||||
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 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) {
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setData(ScannerData dataType, BufferedImage images[]) {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.cringe_studios.christmastreescanning;
|
||||
|
||||
public enum ScannerData{
|
||||
IMAGE_FRONT_RED,
|
||||
IMAGE_FRONT_GREEN,
|
||||
IMAGE_FRONT_BLUE,
|
||||
|
||||
IMAGE_RIGHT_RED,
|
||||
IMAGE_RIGHT_GREEN,
|
||||
IMAGE_RIGHT_BLUE,
|
||||
|
||||
IMAGE_BEHIND_RED,
|
||||
IMAGE_BEHIND_GREEN,
|
||||
IMAGE_BEHIND_BLUE,
|
||||
|
||||
IMAGE_LEFT_RED,
|
||||
IMAGE_LEFT_GREEN,
|
||||
IMAGE_LEFT_BLUE,
|
||||
|
||||
IMAGE_FRONT,
|
||||
IMAGE_RIGHT,
|
||||
IMAGE_BEHIND,
|
||||
IMAGE_LEFT
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.cringe_studios.christmastreescanning;
|
||||
package com.cringe_studios.christmastreescanning.scanning;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Point;
|
||||
@ -7,6 +7,8 @@ import java.awt.image.BufferedImage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.cringe_studios.christmastreescanning.Point3D;
|
||||
|
||||
public class ChristmasTreeScanning {
|
||||
//TODO maybe use Point2D.Double as return type, so the Points don't have to be converted to Points2D later down the pipeline during the normalization step
|
||||
private Point getBrightestSpotGrayscale(BufferedImage grayScaleImage, byte gammaDelta) {
|
@ -1,4 +1,4 @@
|
||||
package com.cringe_studios.christmastreescanning;
|
||||
package com.cringe_studios.christmastreescanning.scanning;
|
||||
|
||||
import java.awt.Point;
|
||||
|
@ -0,0 +1,5 @@
|
||||
package com.cringe_studios.christmastreescanning.scanning;
|
||||
|
||||
public class SideScanner {
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user