API consistency changes

This commit is contained in:
Paul Schaller 2023-11-23 16:39:50 +01:00
parent fe3ecd84a0
commit d8531012a6
3 changed files with 142 additions and 142 deletions

View File

@ -12,14 +12,14 @@ public class FourSidedScanner extends SingleColorScanner {
private SideScanner behindSideScanner; private SideScanner behindSideScanner;
private SideScanner leftSideScanner; private SideScanner leftSideScanner;
public FourSidedScanner(BufferedImage frontSideImages[], BufferedImage rightSideImages[], BufferedImage behindSideImages[], BufferedImage leftSideImages[], byte gammaDelta) { public FourSidedScanner(BufferedImage frontSideImages[], BufferedImage rightSideImages[], BufferedImage behindSideImages[], BufferedImage leftSideImages[]) {
//TODO //TODO
frontSideScanner = new SingleColoredSideScanner(frontSideImages, gammaDelta, , , ); frontSideScanner = new SingleColoredSideScanner(frontSideImages, this.gammaDelta, , , );
rightSideScanner = new SingleColoredSideScanner(rightSideImages, gammaDelta, , , ); rightSideScanner = new SingleColoredSideScanner(rightSideImages, this.gammaDelta, , , );
behindSideScanner = new SingleColoredSideScanner(behindSideScanner, gammaDelta, , , ); behindSideScanner = new SingleColoredSideScanner(behindSideScanner, this.gammaDelta, , , );
leftSideScanner = new SingleColoredSideScanner(leftSideScanner, gammaDelta, , , ); leftSideScanner = new SingleColoredSideScanner(leftSideScanner, this.gammaDelta, , , );
} }
@Override @Override

View File

@ -54,140 +54,140 @@ public abstract Point3D[] scan();
// return null; // 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
// BufferedImage image = new BufferedImage(width, height,BufferedImage.TYPE_INT_RGB); // // BufferedImage image = new BufferedImage(width, height,BufferedImage.TYPE_INT_RGB);
//Graphics g = image.getGraphics(); // //Graphics g = image.getGraphics();
//g.drawImage(colorImage, 0, 0, null); // //g.drawImage(colorImage, 0, 0, null);
//g.dispose(); // //g.dispose();
//
if(distinctColorChannels == null || sideCount == null); //TODO error // if(distinctColorChannels == null || sideCount == null); //TODO error
//
if(distinctColorChannels.booleanValue() == false) { // if(distinctColorChannels.booleanValue() == false) {
if(dataType.ordinal() >= ScannerData.IMAGE_FRONT_RED.ordinal() && dataType.ordinal() <= ScannerData.IMAGE_LEFT_BLUE.ordinal()); //TODO error // if(dataType.ordinal() >= ScannerData.IMAGE_FRONT_RED.ordinal() && dataType.ordinal() <= ScannerData.IMAGE_LEFT_BLUE.ordinal()); //TODO error
//
if(sideCount.booleanValue() == false) { // if(sideCount.booleanValue() == false) {
switch (dataType){ // switch (dataType){
case IMAGE_FRONT: // case IMAGE_FRONT:
{ // {
frontSideImages = images; // frontSideImages = images;
break; // break;
} // }
case IMAGE_RIGHT: // case IMAGE_RIGHT:
{ // {
rightSideImages = images; // rightSideImages = images;
break; // break;
} // }
//
case IMAGE_BEHIND: // case IMAGE_BEHIND:
case IMAGE_LEFT: // case IMAGE_LEFT:
default: // default:
//TODO error // //TODO error
} // }
}else { // }else {
switch (dataType){ // switch (dataType){
case IMAGE_FRONT: // case IMAGE_FRONT:
{ // {
frontSideImages = images; // frontSideImages = images;
break; // break;
} // }
case IMAGE_RIGHT: // case IMAGE_RIGHT:
{ // {
rightSideImages = images; // rightSideImages = images;
break; // break;
} // }
//
case IMAGE_BEHIND: // case IMAGE_BEHIND:
{ // {
behindSideImages = images; // behindSideImages = images;
break; // break;
} // }
case IMAGE_LEFT: // case IMAGE_LEFT:
{ // {
leftSideImages = images; // leftSideImages = images;
break; // break;
} // }
default: // default:
//TODO error // //TODO error
} // }
} // }
}else{ // }else{
if(dataType.ordinal() >= ScannerData.IMAGE_FRONT.ordinal() && dataType.ordinal() <= ScannerData.IMAGE_LEFT.ordinal()); //TODO error // if(dataType.ordinal() >= ScannerData.IMAGE_FRONT.ordinal() && dataType.ordinal() <= ScannerData.IMAGE_LEFT.ordinal()); //TODO error
if(sideCount.booleanValue() == false) { // if(sideCount.booleanValue() == false) {
if(dataType.ordinal() >= ScannerData.IMAGE_BEHIND_RED.ordinal() && dataType.ordinal() <= ScannerData.IMAGE_LEFT_BLUE.ordinal()){ // if(dataType.ordinal() >= ScannerData.IMAGE_BEHIND_RED.ordinal() && dataType.ordinal() <= ScannerData.IMAGE_LEFT_BLUE.ordinal()){
//Todo error // //Todo error
} // }
} // }
//
switch (dataType) { // switch (dataType) {
case IMAGE_FRONT_RED: // case IMAGE_FRONT_RED:
{ // {
frontSideImagesRed = images; // frontSideImagesRed = images;
break; // break;
} // }
case IMAGE_FRONT_GREEN: // case IMAGE_FRONT_GREEN:
{ // {
frontSideImagesGreen = images; // frontSideImagesGreen = images;
break; // break;
} // }
case IMAGE_FRONT_BLUE: // case IMAGE_FRONT_BLUE:
{ // {
frontSideImagesBlue = images; // frontSideImagesBlue = images;
break; // break;
} // }
//
case IMAGE_RIGHT_RED: // case IMAGE_RIGHT_RED:
{ // {
rightSideImagesRed = images; // rightSideImagesRed = images;
break; // break;
} // }
case IMAGE_RIGHT_GREEN: // case IMAGE_RIGHT_GREEN:
{ // {
rightSideImagesGreen = images; // rightSideImagesGreen = images;
break; // break;
} // }
case IMAGE_RIGHT_BLUE: // case IMAGE_RIGHT_BLUE:
{ // {
rightSideImagesBlue = images; // rightSideImagesBlue = images;
break; // break;
} // }
//
case IMAGE_BEHIND_RED: // case IMAGE_BEHIND_RED:
{ // {
behindSideImagesRed = images; // behindSideImagesRed = images;
break; // break;
} // }
case IMAGE_BEHIND_GREEN: // case IMAGE_BEHIND_GREEN:
{ // {
behindSideImagesGreen = images; // behindSideImagesGreen = images;
break; // break;
} // }
case IMAGE_BEHIND_BLUE: // case IMAGE_BEHIND_BLUE:
{ // {
behindSideImagesBlue = images; // behindSideImagesBlue = images;
break; // break;
} // }
//
case IMAGE_LEFT_RED: // case IMAGE_LEFT_RED:
{ // {
leftSideImagesRed = images; // leftSideImagesRed = images;
break; // break;
} // }
case IMAGE_LEFT_GREEN: // case IMAGE_LEFT_GREEN:
{ // {
leftSideImagesGreen = images; // leftSideImagesGreen = images;
break; // break;
} // }
case IMAGE_LEFT_BLUE: // case IMAGE_LEFT_BLUE:
{ // {
leftSideImagesBlue = images; // leftSideImagesBlue = images;
break; // break;
} // }
default: // default:
//TODO error // //TODO error
} // }
} // }
} // }
/** /**
* Sets how many of the brightests pixels are looked for in the images * Sets how many of the brightests pixels are looked for in the images

View File

@ -10,12 +10,12 @@ public class TwoSidedScanner extends SingleColorScanner {
private SideScanner frontSideScanner; private SideScanner frontSideScanner;
private SideScanner rightSideScanner; private SideScanner rightSideScanner;
public TwoSidedScanner(BufferedImage frontSideImages[], BufferedImage rightSideImages[], byte gammaDelta) { public TwoSidedScanner(BufferedImage frontSideImages[], BufferedImage rightSideImages[]) {
//TODO //TODO
frontSideScanner = new SingleColoredSideScanner(frontSideImages, gammaDelta, , , ); frontSideScanner = new SingleColoredSideScanner(frontSideImages, this.gammaDelta, , , );
rightSideScanner = new SingleColoredSideScanner(rightSideImages, gammaDelta, , , ); rightSideScanner = new SingleColoredSideScanner(rightSideImages, this.gammaDelta, , , );
} }
@Override @Override