Renamed dither class because it now superceeds Floyd-Steinberg dithering

This commit is contained in:
Brendan Robert 2014-09-28 12:47:12 -05:00
parent f5eda11edd
commit a5f4117d68
4 changed files with 9 additions and 9 deletions

View File

@ -429,7 +429,7 @@ public class AppleImageEditor extends ImageEditor implements EventHandler<MouseE
} }
private void importImage(javafx.scene.image.Image image) { private void importImage(javafx.scene.image.Image image) {
FloydSteinbergDither ditherEngine = new FloydSteinbergDither(getPlatform()); ImageDitherEngine ditherEngine = new ImageDitherEngine(getPlatform());
ditherEngine.setTargetCoordinates(0,0); ditherEngine.setTargetCoordinates(0,0);
UIAction.openImageConversionModal(image, ditherEngine, getWidth(), getHeight(), this::setData); UIAction.openImageConversionModal(image, ditherEngine, getWidth(), getHeight(), this::setData);
} }

View File

@ -44,7 +44,7 @@ import static org.badvision.outlaweditor.apple.AppleNTSCGraphics.hgrToDhgr;
* Modified and adapted to work with Apple Game Server by Brendan Robert (2013) * Modified and adapted to work with Apple Game Server by Brendan Robert (2013)
* Some of the original code of this class was migrated over to the Palette class which already manages colors in AGS. * Some of the original code of this class was migrated over to the Palette class which already manages colors in AGS.
*/ */
public class FloydSteinbergDither { public class ImageDitherEngine {
int byteRenderWidth; int byteRenderWidth;
final int errorWindow = 6; final int errorWindow = 6;
@ -59,9 +59,9 @@ public class FloydSteinbergDither {
int[][] coefficients; int[][] coefficients;
boolean resetOutput = true; boolean resetOutput = true;
public FloydSteinbergDither(org.badvision.outlaweditor.Platform platform) { public ImageDitherEngine(Platform platform) {
this.platform = platform; this.platform = platform;
byteRenderWidth = platform == org.badvision.outlaweditor.Platform.AppleII_DHGR ? 7 : 14; byteRenderWidth = platform == Platform.AppleII_DHGR ? 7 : 14;
} }
public void setSourceImage(Image img) { public void setSourceImage(Image img) {

View File

@ -32,7 +32,7 @@ import javax.xml.bind.JAXB;
import org.badvision.outlaweditor.Application; import org.badvision.outlaweditor.Application;
import org.badvision.outlaweditor.FileUtils; import org.badvision.outlaweditor.FileUtils;
import org.badvision.outlaweditor.MythosEditor; import org.badvision.outlaweditor.MythosEditor;
import org.badvision.outlaweditor.apple.FloydSteinbergDither; import org.badvision.outlaweditor.apple.ImageDitherEngine;
import org.badvision.outlaweditor.data.TilesetUtils; import org.badvision.outlaweditor.data.TilesetUtils;
import org.badvision.outlaweditor.data.xml.GameData; import org.badvision.outlaweditor.data.xml.GameData;
import org.badvision.outlaweditor.data.xml.Script; import org.badvision.outlaweditor.data.xml.Script;
@ -209,7 +209,7 @@ public class UIAction {
return script; return script;
} }
public static ImageConversionWizardController openImageConversionModal(Image image, FloydSteinbergDither ditherEngine, int targetWidth, int targetHeight, ImageConversionPostAction postAction) { public static ImageConversionWizardController openImageConversionModal(Image image, ImageDitherEngine ditherEngine, int targetWidth, int targetHeight, ImageConversionPostAction postAction) {
FXMLLoader fxmlLoader = new FXMLLoader(UIAction.class.getResource("/fxml/ImageConversionWizard.fxml")); FXMLLoader fxmlLoader = new FXMLLoader(UIAction.class.getResource("/fxml/ImageConversionWizard.fxml"));
try { try {
Stage primaryStage = new Stage(); Stage primaryStage = new Stage();

View File

@ -17,7 +17,7 @@ import javafx.scene.image.ImageView;
import javafx.scene.image.WritableImage; import javafx.scene.image.WritableImage;
import javafx.stage.Stage; import javafx.stage.Stage;
import org.badvision.outlaweditor.Application; import org.badvision.outlaweditor.Application;
import org.badvision.outlaweditor.apple.FloydSteinbergDither; import org.badvision.outlaweditor.apple.ImageDitherEngine;
import org.badvision.outlaweditor.ui.ImageConversionPostAction; import org.badvision.outlaweditor.ui.ImageConversionPostAction;
/** /**
@ -115,7 +115,7 @@ public class ImageConversionWizardController implements Initializable {
private Image sourceImage; private Image sourceImage;
private WritableImage preprocessedImage; private WritableImage preprocessedImage;
private WritableImage outputPreviewImage; private WritableImage outputPreviewImage;
private FloydSteinbergDither ditherEngine; private ImageDitherEngine ditherEngine;
public void setStage(Stage stage) { public void setStage(Stage stage) {
this.stage = stage; this.stage = stage;
@ -125,7 +125,7 @@ public class ImageConversionWizardController implements Initializable {
this.postAction = postAction; this.postAction = postAction;
} }
public void setDitherEngine(FloydSteinbergDither engine) { public void setDitherEngine(ImageDitherEngine engine) {
this.ditherEngine = engine; this.ditherEngine = engine;
} }