CODE WITH ERRORS, a small requirement change required a small API
change...
This commit is contained in:
parent
2ea8096200
commit
44f6a87ebf
@ -0,0 +1,45 @@
|
|||||||
|
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 FourSidedScanner extends SingleColorScanner {
|
||||||
|
private SideScanner frontSideScanner;
|
||||||
|
private SideScanner rightSideScanner;
|
||||||
|
private SideScanner behindSideScanner;
|
||||||
|
private SideScanner leftSideScanner;
|
||||||
|
|
||||||
|
public FourSidedScanner(BufferedImage frontSideImages[], BufferedImage rightSideImages[], BufferedImage behindSideImages[], BufferedImage leftSideImages[], byte gammaDelta) {
|
||||||
|
|
||||||
|
//TODO
|
||||||
|
|
||||||
|
frontSideScanner = new SingleColoredSideScanner(frontSideImages, gammaDelta, , , );
|
||||||
|
rightSideScanner = new SingleColoredSideScanner(rightSideImages, gammaDelta, , , );
|
||||||
|
behindSideScanner = new SingleColoredSideScanner(behindSideScanner, gammaDelta, , , );
|
||||||
|
leftSideScanner = new SingleColoredSideScanner(leftSideScanner, gammaDelta, , , );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Point3D[] scan() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
frontSideScanner.scan();
|
||||||
|
frontSideScanner.normalizePoints();
|
||||||
|
Point2D[] frontPoints = frontSideScanner.getPoints();
|
||||||
|
|
||||||
|
rightSideScanner.scan();
|
||||||
|
rightSideScanner.normalizePoints();
|
||||||
|
Point2D[] rightSidePoints = rightSideScanner.getPoints();
|
||||||
|
|
||||||
|
behindSideScanner.scan();
|
||||||
|
behindSideScanner.normalizePoints();
|
||||||
|
Point2D[] frontPoints = behindSideScanner.getPoints();
|
||||||
|
|
||||||
|
leftSideScanner.scan();
|
||||||
|
leftSideScanner.normalizePoints();
|
||||||
|
Point2D[] rightSidePoints = leftSideScanner.getPoints();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
package com.cringe_studios.christmastreescanning;
|
||||||
|
|
||||||
|
public abstract class MultiColorScanner extends Scanner {
|
||||||
|
|
||||||
|
}
|
@ -4,53 +4,55 @@ import java.awt.image.BufferedImage;
|
|||||||
|
|
||||||
import com.cringe_studios.christmastreescanning.scanning.image_scanning.ImageScanner;
|
import com.cringe_studios.christmastreescanning.scanning.image_scanning.ImageScanner;
|
||||||
|
|
||||||
public class Scanner {
|
public abstract class Scanner {
|
||||||
BufferedImage frontSideImages[];
|
// BufferedImage frontSideImages[];
|
||||||
BufferedImage frontSideImagesRed[];
|
// BufferedImage frontSideImagesRed[];
|
||||||
BufferedImage frontSideImagesGreen[];
|
// BufferedImage frontSideImagesGreen[];
|
||||||
BufferedImage frontSideImagesBlue[];
|
// 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[];
|
||||||
|
|
||||||
BufferedImage rightSideImages[];
|
protected byte gammaDelta = ImageScanner.GAMMA_DELTA_DEFAULT;
|
||||||
BufferedImage rightSideImagesRed[];
|
|
||||||
BufferedImage rightSideImagesGreen[];
|
|
||||||
BufferedImage rightSideImagesBlue[];
|
|
||||||
|
|
||||||
BufferedImage behindSideImages[];
|
// Boolean distinctColorChannels = null; // use the non-primitive datatype, so the user has to set the state
|
||||||
BufferedImage behindSideImagesRed[];
|
// Boolean sideCount = null; // use the non-primitive datatype, so the user has to set the state
|
||||||
BufferedImage behindSideImagesGreen[];
|
|
||||||
BufferedImage behindSideImagesBlue[];
|
|
||||||
|
|
||||||
BufferedImage leftSideImages[];
|
// public Scanner() {}
|
||||||
BufferedImage leftSideImagesRed[];
|
|
||||||
BufferedImage leftSideImagesGreen[];
|
|
||||||
BufferedImage leftSideImagesBlue[];
|
|
||||||
|
|
||||||
byte gammaDelta = ImageScanner.GAMMA_DELTA_DEFAULT;
|
public abstract Point3D[] scan();
|
||||||
|
|
||||||
Boolean distinctColorChannels = null; // use the non-primitive datatype, so the user has to set the state
|
// public Point3D[] scan() {
|
||||||
Boolean sideCount = null; // use the non-primitive datatype, so the user has to set the state
|
// if(distinctColorChannels == null || sideCount == null); //TODO error
|
||||||
|
//
|
||||||
public Scanner() {}
|
// Point3D[] ret;
|
||||||
|
//
|
||||||
public Point3D[] scan() {
|
// if(distinctColorChannels == true && sideCount == true) {
|
||||||
if(distinctColorChannels == null || sideCount == null); //TODO error
|
//
|
||||||
|
// }else if(distinctColorChannels == true && sideCount == false) {
|
||||||
Point3D[] ret;
|
//
|
||||||
|
// }else if(distinctColorChannels == false && sideCount == true) {
|
||||||
if(distinctColorChannels == true && sideCount == true) {
|
//
|
||||||
|
// }else if(distinctColorChannels == false && sideCount == false) {
|
||||||
}else if(distinctColorChannels == true && sideCount == false) {
|
//
|
||||||
|
// }
|
||||||
}else if(distinctColorChannels == false && sideCount == true) {
|
//
|
||||||
|
// //TODO call SideScanner.scan for every side and merge the four sides into 3d points
|
||||||
}else if(distinctColorChannels == false && sideCount == false) {
|
//
|
||||||
|
// return null;
|
||||||
}
|
// }
|
||||||
|
|
||||||
//TODO call SideScanner.scan for every side and merge the four sides into 3d points
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setData(ScannerData dataType, BufferedImage images[]) {
|
public void setData(ScannerData dataType, BufferedImage images[]) {
|
||||||
//TODO convert image to known format utilizing
|
//TODO convert image to known format utilizing
|
||||||
@ -195,19 +197,19 @@ public class Scanner {
|
|||||||
this.gammaDelta = 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
|
// * @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) {
|
// public void setDistinctColorChannels(boolean useDistinctRGBImages) {
|
||||||
this.distinctColorChannels = Boolean.valueOf(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
|
// * @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) {
|
// public void setSideCount(boolean useAllFourSides) {
|
||||||
this.sideCount = Boolean.valueOf(useAllFourSides);
|
// this.sideCount = Boolean.valueOf(useAllFourSides);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
package com.cringe_studios.christmastreescanning;
|
||||||
|
|
||||||
|
public abstract class SingleColorScanner extends Scanner{
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
public TwoSidedScanner(BufferedImage frontSideImages[], BufferedImage rightSideImages[], byte gammaDelta) {
|
||||||
|
|
||||||
|
//TODO
|
||||||
|
|
||||||
|
frontSideScanner = new SingleColoredSideScanner(frontSideImages, gammaDelta, , , );
|
||||||
|
rightSideScanner = new SingleColoredSideScanner(rightSideImages, gammaDelta, , , );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Point3D[] scan() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
frontSideScanner.scan();
|
||||||
|
frontSideScanner.normalizePoints();
|
||||||
|
Point2D[] frontPoints = frontSideScanner.getPoints();
|
||||||
|
|
||||||
|
rightSideScanner.scan();
|
||||||
|
rightSideScanner.normalizePoints();
|
||||||
|
Point2D[] rightSidePoints = rightSideScanner.getPoints();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user