diff --git a/ImageConverter/.idea/workspace.xml b/ImageConverter/.idea/workspace.xml
index b7e562c0..026df89a 100644
--- a/ImageConverter/.idea/workspace.xml
+++ b/ImageConverter/.idea/workspace.xml
@@ -62,7 +62,66 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -139,6 +217,8 @@
+
+
@@ -157,12 +237,17 @@
+
+
+
+
+
+
+
-
-
@@ -177,10 +262,14 @@
-
+
+
+
+
+
@@ -436,14 +525,16 @@
-
+
+
-
+
+
-
+
@@ -463,7 +554,6 @@
-
@@ -492,20 +582,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -526,6 +602,7 @@
+
@@ -561,10 +638,6 @@
-
-
-
-
@@ -589,6 +662,7 @@
+
@@ -624,10 +698,6 @@
-
-
-
-
@@ -652,6 +722,7 @@
+
@@ -687,10 +758,6 @@
-
-
-
-
@@ -715,6 +782,7 @@
+
@@ -750,10 +818,6 @@
-
-
-
-
@@ -778,6 +842,7 @@
+
@@ -802,10 +867,6 @@
-
-
-
-
@@ -815,13 +876,6 @@
-
-
-
-
-
-
-
@@ -839,31 +893,35 @@
-
-
-
-
-
-
-
+
-
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
@@ -871,27 +929,39 @@
-
-
+
-
-
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
diff --git a/ImageConverter/out/artifacts/ImageConverter_jar/ImageConverter.jar b/ImageConverter/out/artifacts/ImageConverter_jar/ImageConverter.jar
index a7f39e23..1c311fd2 100644
Binary files a/ImageConverter/out/artifacts/ImageConverter_jar/ImageConverter.jar and b/ImageConverter/out/artifacts/ImageConverter_jar/ImageConverter.jar differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/ImageConverter.fxml b/ImageConverter/out/production/ImageConverter/sample/ImageConverter.fxml
index 483fe1ea..12b17e70 100644
--- a/ImageConverter/out/production/ImageConverter/sample/ImageConverter.fxml
+++ b/ImageConverter/out/production/ImageConverter/sample/ImageConverter.fxml
@@ -29,15 +29,15 @@
-
+
-
+
-
+
@@ -46,17 +46,41 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
diff --git a/ImageConverter/out/production/ImageConverter/sample/Main$1.class b/ImageConverter/out/production/ImageConverter/sample/Main$1.class
index 48d989d4..0089c6ec 100644
Binary files a/ImageConverter/out/production/ImageConverter/sample/Main$1.class and b/ImageConverter/out/production/ImageConverter/sample/Main$1.class differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/Main$2$1.class b/ImageConverter/out/production/ImageConverter/sample/Main$2$1.class
index 91e8debc..783402fd 100644
Binary files a/ImageConverter/out/production/ImageConverter/sample/Main$2$1.class and b/ImageConverter/out/production/ImageConverter/sample/Main$2$1.class differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/Main$2.class b/ImageConverter/out/production/ImageConverter/sample/Main$2.class
index 2b840b39..3e2740d9 100644
Binary files a/ImageConverter/out/production/ImageConverter/sample/Main$2.class and b/ImageConverter/out/production/ImageConverter/sample/Main$2.class differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/Main.class b/ImageConverter/out/production/ImageConverter/sample/Main.class
index 74f62329..83804def 100644
Binary files a/ImageConverter/out/production/ImageConverter/sample/Main.class and b/ImageConverter/out/production/ImageConverter/sample/Main.class differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/OCIF.class b/ImageConverter/out/production/ImageConverter/sample/OCIF.class
index 28d47a17..dad66577 100644
Binary files a/ImageConverter/out/production/ImageConverter/sample/OCIF.class and b/ImageConverter/out/production/ImageConverter/sample/OCIF.class differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/Palette.class b/ImageConverter/out/production/ImageConverter/sample/Palette.class
index d0b1e4ae..c9738476 100644
Binary files a/ImageConverter/out/production/ImageConverter/sample/Palette.class and b/ImageConverter/out/production/ImageConverter/sample/Palette.class differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/Resources/Background.png b/ImageConverter/out/production/ImageConverter/sample/Resources/Background.png
new file mode 100644
index 00000000..e0c7852d
Binary files /dev/null and b/ImageConverter/out/production/ImageConverter/sample/Resources/Background.png differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/Resources/Background2.png b/ImageConverter/out/production/ImageConverter/sample/Resources/Background2.png
deleted file mode 100644
index c4998bb7..00000000
Binary files a/ImageConverter/out/production/ImageConverter/sample/Resources/Background2.png and /dev/null differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/Resources/Files.psd b/ImageConverter/out/production/ImageConverter/sample/Resources/Files.psd
index 81ddce12..8cd6cc97 100644
Binary files a/ImageConverter/out/production/ImageConverter/sample/Resources/Files.psd and b/ImageConverter/out/production/ImageConverter/sample/Resources/Files.psd differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/Resources/Без имени-2.psd b/ImageConverter/out/production/ImageConverter/sample/Resources/Без имени-2.psd
deleted file mode 100644
index 425d023b..00000000
Binary files a/ImageConverter/out/production/ImageConverter/sample/Resources/Без имени-2.psd and /dev/null differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/Styles/button.css b/ImageConverter/out/production/ImageConverter/sample/Styles/button.css
index 32975a72..dd580fd8 100644
--- a/ImageConverter/out/production/ImageConverter/sample/Styles/button.css
+++ b/ImageConverter/out/production/ImageConverter/sample/Styles/button.css
@@ -6,7 +6,6 @@
-fx-border-radius: 0;
-fx-background-radius: 0;
- -fx-font-family: "Graphon", Arial, sans-serif;
-fx-font-size: 10pt;
-fx-text-fill: #FFFFFF88;
}
@@ -17,4 +16,10 @@
-fx-effect: dropshadow( three-pass-box , rgba(255,255,255,0.6) , 10, 0.2 , 0 , 1 );
}
+.defaultButton:disabled {
+ -fx-background-color: #FFFFFF22;
+ -fx-text-fill: #FFFFFF77;
+}
+
+
diff --git a/ImageConverter/src/sample/ImageConverter.fxml b/ImageConverter/src/sample/ImageConverter.fxml
index 01e0bc6e..12b17e70 100644
--- a/ImageConverter/src/sample/ImageConverter.fxml
+++ b/ImageConverter/src/sample/ImageConverter.fxml
@@ -29,15 +29,15 @@
-
+
-
+
-
+
@@ -46,17 +46,41 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -71,12 +95,12 @@
-
+
-
+
@@ -86,26 +110,24 @@
-
-
+
+
-
+
-
-
-
+
+
+
-
-
+
+
+
-
-
-
-
+
diff --git a/ImageConverter/src/sample/Main.java b/ImageConverter/src/sample/Main.java
index 0a312db3..64a6c66d 100644
--- a/ImageConverter/src/sample/Main.java
+++ b/ImageConverter/src/sample/Main.java
@@ -10,8 +10,10 @@ import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.image.ImageView;
+import javafx.scene.input.DragEvent;
import javafx.scene.input.Dragboard;
import javafx.scene.input.TransferMode;
+import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Pane;
import javafx.scene.text.Text;
@@ -21,6 +23,7 @@ import javafx.util.Callback;
import javafx.util.Duration;
import java.io.File;
import java.io.IOException;
+import java.util.Locale;
import java.util.regex.Pattern;
public class Main extends Application {
@@ -36,19 +39,23 @@ public class Main extends Application {
public Text imageSizeText;
public Slider ditheringSlider;
public ComboBox encodingMethodComboBox;
- public Pane dragDropAnimationGridPane;
public GridPane imageGridPane;
public ImageView dragDropFilesImageView;
public Pane settingsPane;
public Pane mainPane;
- private String currentImagePath = "sample/Resources/Background.jpg";
+ public GridPane hintsGridPane;
+ public GridPane dragImageGridPane;
+ public FlowPane OCIFStringResultFlowPane;
+ public TextField OCIFStringResultTextField;
+
+
+ private String currentImagePath = "sample/Resources/Background.png";
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setResizable(false);
- Scene scene = new Scene(FXMLLoader.load(getClass().getResource("ImageConverter.fxml")));
- primaryStage.setScene(scene);
+ primaryStage.setScene(new Scene(FXMLLoader.load(getClass().getResource("ImageConverter.fxml")), 840, 489));
primaryStage.show();
}
@@ -61,27 +68,34 @@ public class Main extends Application {
return timeline;
}
- private void playDragDropFileAnimation(boolean start, boolean moveSettingsPane, double targetOpacity, double fromScale, double toScale)
- {
+ private void playAnimation(boolean start, double targetOpacity, double fromScale, double toScale) {
Timeline timeline = newTimeLine(
150,
new KeyValue[] {
- new KeyValue(dragDropAnimationGridPane.opacityProperty(), dragDropAnimationGridPane.getOpacity()),
+ new KeyValue(hintsGridPane.opacityProperty(), hintsGridPane.getOpacity()),
new KeyValue(dragDropFilesImageView.fitWidthProperty(), dragDropFilesImageView.getImage().getWidth() * fromScale),
- moveSettingsPane ? new KeyValue(settingsPane.layoutXProperty(), start ? mainPane.getWidth() - settingsPane.getWidth() : mainPane.getWidth()) : null
+ new KeyValue(settingsPane.layoutXProperty(), start ? mainPane.getWidth() - settingsPane.getWidth() : mainPane.getWidth())
},
new KeyValue[] {
- new KeyValue(dragDropAnimationGridPane.opacityProperty(), targetOpacity),
+ new KeyValue(hintsGridPane.opacityProperty(), targetOpacity),
new KeyValue(dragDropFilesImageView.fitWidthProperty(), dragDropFilesImageView.getImage().getWidth() * toScale),
- moveSettingsPane ? new KeyValue(settingsPane.layoutXProperty(), start ? mainPane.getWidth() : mainPane.getWidth() - settingsPane.getWidth()) : null
+ new KeyValue(settingsPane.layoutXProperty(), start ? mainPane.getWidth() : mainPane.getWidth() - settingsPane.getWidth())
}
);
timeline.play();
}
+ private void playAnimationStart() {
+ playAnimation(true, 1.0d, 0.8d, 1.0d);
+ }
+
+ private void playAnimationEnd() {
+ playAnimation(false, 0.0d, 1.0d, 0.8d);
+ }
+
public void initialize() {
- // Пидорасим текст по центру комбобокса
+ // Центрируем хуйню самого комбобокса
encodingMethodComboBox.setButtonCell(new ListCell() {
@Override
public void updateItem(String item, boolean empty) {
@@ -95,7 +109,7 @@ public class Main extends Application {
}
});
- // А это уже в выпадающем списке
+ // Центрируем хуйню в выпадающем списке комбобокса
encodingMethodComboBox.setCellFactory(new Callback, ListCell>() {
@Override
public ListCell call(ListView list) {
@@ -112,25 +126,38 @@ public class Main extends Application {
}
});
- //Ебучий драг-дроп
- dragDropAnimationGridPane.setOnDragEntered(event -> {
- if (event.getDragboard().hasFiles()) {
- playDragDropFileAnimation(true, true,1.0d, 0.8d, 1.0d);
- event.acceptTransferModes(TransferMode.COPY);
- }
- });
+ encodingMethodComboBox.setValue("OCIF6 (Optimized)");
+ }
- dragDropAnimationGridPane.setOnDragExited(event -> {
- playDragDropFileAnimation(false, true, 0.0d, 1.0d, 0.8d);
+ //Ебучий драг-дроп
+ public void onHintsGridPaneDragEntered(DragEvent event) {
+ dragImageGridPane.setVisible(true);
+ OCIFStringResultFlowPane.setVisible(false);
- Dragboard dragboard = event.getDragboard();
- if (dragboard.hasFiles()) {
- File file = new File(dragboard.getFiles().get(0).getAbsolutePath());
- if (file.getAbsolutePath().toLowerCase().matches("^.+\\.(png)?(jpg)?(jpeg)?$")) {
- loadImage(file);
- }
+ if (event.getDragboard().hasFiles()) {
+ playAnimationStart();
+ event.acceptTransferModes(TransferMode.COPY);
+ }
+ }
+
+ public void onHintsGridPaneDragExited(DragEvent event) {
+ playAnimationEnd();
+
+ Dragboard dragboard = event.getDragboard();
+ if (dragboard.hasFiles()) {
+ File file = new File(dragboard.getFiles().get(0).getAbsolutePath());
+ if (file.getAbsolutePath().toLowerCase().matches("^.+\\.(png)?(jpg)?(jpeg)?$")) {
+ loadImage(file);
}
- });
+ }
+
+ dragImageGridPane.setVisible(false);
+ }
+
+ public void onHintsGridPaneDragMouseClicked() {
+ if (hintsGridPane.getOpacity() == 1) {
+ playAnimationEnd();
+ }
}
public static void main(String[] args) {
@@ -152,21 +179,11 @@ public class Main extends Application {
}
public void onTextFieldTextChanged() {
- boolean state = checkTextField(widthTextField) && checkTextField(heightTextField);
+ boolean state = (checkTextField(widthTextField) && checkTextField(heightTextField)) || encodingMethodComboBox.getValue().contains("OCIF5");
-// convertButton.setDisable(!state);
imageSizeText.setVisible(state);
wrongSizesText.setVisible(!state);
-
- encodingMethodComboBox.getItems().clear();
- if (state) {
- encodingMethodComboBox.setValue("OCIF6");
- encodingMethodComboBox.getItems().add("OCIF5");
- encodingMethodComboBox.getItems().add("OCIF6");
- } else {
- encodingMethodComboBox.setValue("OCIF5");
- encodingMethodComboBox.getItems().add("OCIF5");
- }
+ convertButton.setDisable(!state);
}
private void loadImage(File file) {
@@ -206,22 +223,40 @@ public class Main extends Application {
}
public void save() throws IOException {
- FileChooser fileChooser = new FileChooser();
- fileChooser.setTitle("Сохранить файл");
- fileChooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("Изображение OpenComputers", "*.pic"));
- File file = fileChooser.showSaveDialog(openButton.getScene().getWindow());
-
- if (file != null) {
- OCIF.convert(
- currentImagePath,
- file.getPath(),
- Integer.parseInt(widthTextField.getText()),
- Integer.parseInt(heightTextField.getText()),
- encodingMethodComboBox.getValue().equals("OCIF6") ? 6 : 5,
- brailleCheckBox.isSelected(),
- ditheringCheckBox.isSelected(),
- ditheringSlider.getValue()
+ if (encodingMethodComboBox.getValue().contains("OCIFString")) {
+ String result = OCIF.convertToString(
+ currentImagePath,
+ Integer.parseInt(widthTextField.getText()),
+ Integer.parseInt(heightTextField.getText()),
+ brailleCheckBox.isSelected(),
+ ditheringCheckBox.isSelected(),
+ ditheringSlider.getValue()
);
+
+ dragImageGridPane.setVisible(false);
+ OCIFStringResultFlowPane.setVisible(true);
+ playAnimationStart();
+
+ OCIFStringResultTextField.setText(result);
+ }
+ else {
+ FileChooser fileChooser = new FileChooser();
+ fileChooser.setTitle("Сохранить файл");
+ fileChooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("Изображение OpenComputers", "*.pic"));
+ File file = fileChooser.showSaveDialog(openButton.getScene().getWindow());
+
+ if (file != null) {
+ OCIF.convert(
+ currentImagePath,
+ file.getPath(),
+ Integer.parseInt(widthTextField.getText()),
+ Integer.parseInt(heightTextField.getText()),
+ encodingMethodComboBox.getValue().contains("OCIF6") ? 6 : 5,
+ brailleCheckBox.isSelected(),
+ ditheringCheckBox.isSelected(),
+ ditheringSlider.getValue()
+ );
+ }
}
}
}
\ No newline at end of file
diff --git a/ImageConverter/src/sample/OCIF.java b/ImageConverter/src/sample/OCIF.java
index 6a0ff373..4f4fa6bd 100644
--- a/ImageConverter/src/sample/OCIF.java
+++ b/ImageConverter/src/sample/OCIF.java
@@ -5,18 +5,10 @@ import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
-import sample.Palette;
public class OCIF {
- private static void writePixelToFileAsOCIF1(FileOutputStream out, Pixel pixel) throws IOException {
-// out.write((byte) pixel.background.red);
-// out.write((byte) pixel.background.green);
-// out.write((byte) pixel.background.blue);
-// out.write((byte) pixel.foreground.red);
-// out.write((byte) pixel.foreground.green);
-// out.write((byte) pixel.foreground.blue);
-
+ private static void writePixelToFileAsOCIF5(FileOutputStream out, Pixel pixel) throws IOException {
out.write((byte) Palette.getClosestIndex(pixel.background));
out.write((byte) Palette.getClosestIndex(pixel.foreground));
@@ -89,36 +81,7 @@ public class OCIF {
}
}
- private static void OCIF1ConvertAsBraille(FileOutputStream out, sample.Image image) throws IOException {
- for (int y = 0; y < image.height; y += 4) {
- for (int x = 0; x < image.width; x += 2) {
- writePixelToFileAsOCIF1(out, sample.Image.getBraillePixel(image, x, y));
- }
- }
- }
-
- private static void OCIF1ConvertAsSemiPixel(FileOutputStream out, sample.Image image) throws IOException {
- for (int y = 0; y < image.height; y += 2) {
- for (int x = 0; x < image.width; x++) {
- writePixelToFileAsOCIF1(out, sample.Image.getSemiPixel(image, x, y));
- }
- }
- }
-
- public static void convert(String imagePath, String convertedImagePath, int requestedWidth, int requestedHeight, int encodingMethod, boolean convertAsBraille, boolean enableDithering, double ditheringIntensity) throws IOException {
- FileOutputStream out = new FileOutputStream(convertedImagePath);
-
- out.write("OCIF".getBytes(StandardCharsets.US_ASCII));
- out.write((byte) encodingMethod);
-
- if (encodingMethod == 5) {
- out.write(integerToByteArray(requestedWidth, 2));
- out.write(integerToByteArray(requestedHeight, 2));
- } else {
- out.write((byte) requestedWidth);
- out.write((byte) requestedHeight);
- }
-
+ private static sample.Image loadImage(String imagePath, int requestedWidth, int requestedHeight, boolean convertAsBraille, boolean enableDithering, double ditheringIntensity) {
sample.Image image = new sample.Image(new javafx.scene.image.Image(imagePath,
requestedWidth * (convertAsBraille ? 2 : 1),
requestedHeight * (convertAsBraille ? 4 : 2),
@@ -130,16 +93,79 @@ public class OCIF {
image = sample.Image.dither(image, ditheringIntensity);
}
+ return image;
+ }
+
+ private static void appendPixel(StringBuilder result, Pixel pixel) {
+ result.append(String.format("%02X", Palette.getClosestIndex(pixel.background)));
+ result.append(String.format("%02X", Palette.getClosestIndex(pixel.foreground)));
+ result.append(String.format("%02X", pixel.alpha));
+ result.append(pixel.symbol);
+ }
+
+ static String convertToString(String imagePath, int requestedWidth, int requestedHeight, boolean convertAsBraille, boolean enableDithering, double ditheringIntensity) {
+ sample.Image image = loadImage(imagePath, requestedWidth, requestedHeight, convertAsBraille, enableDithering, ditheringIntensity);
+
+ StringBuilder result = new StringBuilder();
+ result.append(String.format("%02X", requestedWidth));
+ result.append(String.format("%02X", requestedHeight));
+
+ if (convertAsBraille) {
+ for (int y = 0; y < image.height; y += 4) {
+ for (int x = 0; x < image.width; x += 2) {
+ appendPixel(result, sample.Image.getBraillePixel(image, x, y));
+ }
+ }
+ }
+ else {
+ for (int y = 0; y < image.height; y += 2) {
+ for (int x = 0; x < image.width; x += 1) {
+ appendPixel(result, sample.Image.getSemiPixel(image, x, y));
+ }
+ }
+ }
+
+ return result.toString();
+ }
+
+ static void convert(String imagePath, String convertedImagePath, int requestedWidth, int requestedHeight, int encodingMethod, boolean convertAsBraille, boolean enableDithering, double ditheringIntensity) throws IOException {
+ FileOutputStream out = new FileOutputStream(convertedImagePath);
+
+ out.write("OCIF".getBytes(StandardCharsets.US_ASCII));
+ out.write((byte) encodingMethod);
+
+ if (encodingMethod == 5) {
+ out.write(integerToByteArray(requestedWidth, 2));
+ out.write(integerToByteArray(requestedHeight, 2));
+ }
+ else{
+ out.write((byte) requestedWidth);
+ out.write((byte) requestedHeight);
+ }
+
+ sample.Image image = loadImage(imagePath, requestedWidth, requestedHeight, convertAsBraille, enableDithering, ditheringIntensity);
+
if (convertAsBraille) {
if (encodingMethod == 5) {
- OCIF1ConvertAsBraille(out, image);
- } else {
+ for (int y = 0; y < image.height; y += 4) {
+ for (int x = 0; x < image.width; x += 2) {
+ writePixelToFileAsOCIF5(out, sample.Image.getBraillePixel(image, x, y));
+ }
+ }
+ }
+ else {
writeGroupedImage(out, sample.Image.groupAsBraille(image));
}
- } else {
+ }
+ else {
if (encodingMethod == 5) {
- OCIF1ConvertAsSemiPixel(out, image);
- } else {
+ for (int y = 0; y < image.height; y += 2) {
+ for (int x = 0; x < image.width; x += 1) {
+ writePixelToFileAsOCIF5(out, sample.Image.getSemiPixel(image, x, y));
+ }
+ }
+ }
+ else {
writeGroupedImage(out, sample.Image.groupAsSemiPixel(image));
}
}
diff --git a/ImageConverter/src/sample/Palette.java b/ImageConverter/src/sample/Palette.java
index 0cc02db7..f7dfaaf9 100644
--- a/ImageConverter/src/sample/Palette.java
+++ b/ImageConverter/src/sample/Palette.java
@@ -4,14 +4,12 @@ package sample;
public class Palette {
private static int[] palette = { 0x000000, 0x000040, 0x000080, 0x0000BF, 0x0000FF, 0x002400, 0x002440, 0x002480, 0x0024BF, 0x0024FF, 0x004900, 0x004940, 0x004980, 0x0049BF, 0x0049FF, 0x006D00, 0x006D40, 0x006D80, 0x006DBF, 0x006DFF, 0x009200, 0x009240, 0x009280, 0x0092BF, 0x0092FF, 0x00B600, 0x00B640, 0x00B680, 0x00B6BF, 0x00B6FF, 0x00DB00, 0x00DB40, 0x00DB80, 0x00DBBF, 0x00DBFF, 0x00FF00, 0x00FF40, 0x00FF80, 0x00FFBF, 0x00FFFF, 0x0F0F0F, 0x1E1E1E, 0x2D2D2D, 0x330000, 0x330040, 0x330080, 0x3300BF, 0x3300FF, 0x332400, 0x332440, 0x332480, 0x3324BF, 0x3324FF, 0x334900, 0x334940, 0x334980, 0x3349BF, 0x3349FF, 0x336D00, 0x336D40, 0x336D80, 0x336DBF, 0x336DFF, 0x339200, 0x339240, 0x339280, 0x3392BF, 0x3392FF, 0x33B600, 0x33B640, 0x33B680, 0x33B6BF, 0x33B6FF, 0x33DB00, 0x33DB40, 0x33DB80, 0x33DBBF, 0x33DBFF, 0x33FF00, 0x33FF40, 0x33FF80, 0x33FFBF, 0x33FFFF, 0x3C3C3C, 0x4B4B4B, 0x5A5A5A, 0x660000, 0x660040, 0x660080, 0x6600BF, 0x6600FF, 0x662400, 0x662440, 0x662480, 0x6624BF, 0x6624FF, 0x664900, 0x664940, 0x664980, 0x6649BF, 0x6649FF, 0x666D00, 0x666D40, 0x666D80, 0x666DBF, 0x666DFF, 0x669200, 0x669240, 0x669280, 0x6692BF, 0x6692FF, 0x66B600, 0x66B640, 0x66B680, 0x66B6BF, 0x66B6FF, 0x66DB00, 0x66DB40, 0x66DB80, 0x66DBBF, 0x66DBFF, 0x66FF00, 0x66FF40, 0x66FF80, 0x66FFBF, 0x66FFFF, 0x696969, 0x787878, 0x878787, 0x969696, 0x990000, 0x990040, 0x990080, 0x9900BF, 0x9900FF, 0x992400, 0x992440, 0x992480, 0x9924BF, 0x9924FF, 0x994900, 0x994940, 0x994980, 0x9949BF, 0x9949FF, 0x996D00, 0x996D40, 0x996D80, 0x996DBF, 0x996DFF, 0x999200, 0x999240, 0x999280, 0x9992BF, 0x9992FF, 0x99B600, 0x99B640, 0x99B680, 0x99B6BF, 0x99B6FF, 0x99DB00, 0x99DB40, 0x99DB80, 0x99DBBF, 0x99DBFF, 0x99FF00, 0x99FF40, 0x99FF80, 0x99FFBF, 0x99FFFF, 0xA5A5A5, 0xB4B4B4, 0xC3C3C3, 0xCC0000, 0xCC0040, 0xCC0080, 0xCC00BF, 0xCC00FF, 0xCC2400, 0xCC2440, 0xCC2480, 0xCC24BF, 0xCC24FF, 0xCC4900, 0xCC4940, 0xCC4980, 0xCC49BF, 0xCC49FF, 0xCC6D00, 0xCC6D40, 0xCC6D80, 0xCC6DBF, 0xCC6DFF, 0xCC9200, 0xCC9240, 0xCC9280, 0xCC92BF, 0xCC92FF, 0xCCB600, 0xCCB640, 0xCCB680, 0xCCB6BF, 0xCCB6FF, 0xCCDB00, 0xCCDB40, 0xCCDB80, 0xCCDBBF, 0xCCDBFF, 0xCCFF00, 0xCCFF40, 0xCCFF80, 0xCCFFBF, 0xCCFFFF, 0xD2D2D2, 0xE1E1E1, 0xF0F0F0, 0xFF0000, 0xFF0040, 0xFF0080, 0xFF00BF, 0xFF00FF, 0xFF2400, 0xFF2440, 0xFF2480, 0xFF24BF, 0xFF24FF, 0xFF4900, 0xFF4940, 0xFF4980, 0xFF49BF, 0xFF49FF, 0xFF6D00, 0xFF6D40, 0xFF6D80, 0xFF6DBF, 0xFF6DFF, 0xFF9200, 0xFF9240, 0xFF9280, 0xFF92BF, 0xFF92FF, 0xFFB600, 0xFFB640, 0xFFB680, 0xFFB6BF, 0xFFB6FF, 0xFFDB00, 0xFFDB40, 0xFFDB80, 0xFFDBBF, 0xFFDBFF, 0xFFFF00, 0xFFFF40, 0xFFFF80, 0xFFFFBF, 0xFFFFFF };
- public static int getClosestIndex(Color color)
- {
+ public static int getClosestIndex(Color color) {
int closestIndex = 0;
double delta, closestDelta = 999999999.0d;
Color paletteColor;
- for (int i = 0; i < palette.length; i++)
- {
+ for (int i = 0; i < palette.length; i++) {
paletteColor = new Color(
0x0,
palette[i] >> 16,
@@ -23,8 +21,7 @@ public class Palette {
Math.pow((double) (paletteColor.green - color.green), 2) +
Math.pow((double) (paletteColor.blue - color.blue), 2);
- if (delta < closestDelta)
- {
+ if (delta < closestDelta) {
closestDelta = delta;
closestIndex = i;
}
diff --git a/ImageConverter/src/sample/Resources/Background.png b/ImageConverter/src/sample/Resources/Background.png
new file mode 100644
index 00000000..e0c7852d
Binary files /dev/null and b/ImageConverter/src/sample/Resources/Background.png differ
diff --git a/ImageConverter/src/sample/Resources/Background2.png b/ImageConverter/src/sample/Resources/Background2.png
deleted file mode 100644
index c4998bb7..00000000
Binary files a/ImageConverter/src/sample/Resources/Background2.png and /dev/null differ
diff --git a/ImageConverter/src/sample/Resources/Files.psd b/ImageConverter/src/sample/Resources/Files.psd
index 81ddce12..8cd6cc97 100644
Binary files a/ImageConverter/src/sample/Resources/Files.psd and b/ImageConverter/src/sample/Resources/Files.psd differ
diff --git a/ImageConverter/src/sample/Resources/Без имени-2.psd b/ImageConverter/src/sample/Resources/Без имени-2.psd
deleted file mode 100644
index 425d023b..00000000
Binary files a/ImageConverter/src/sample/Resources/Без имени-2.psd and /dev/null differ
diff --git a/ImageConverter/src/sample/Styles/button.css b/ImageConverter/src/sample/Styles/button.css
index 32975a72..dd580fd8 100644
--- a/ImageConverter/src/sample/Styles/button.css
+++ b/ImageConverter/src/sample/Styles/button.css
@@ -6,7 +6,6 @@
-fx-border-radius: 0;
-fx-background-radius: 0;
- -fx-font-family: "Graphon", Arial, sans-serif;
-fx-font-size: 10pt;
-fx-text-fill: #FFFFFF88;
}
@@ -17,4 +16,10 @@
-fx-effect: dropshadow( three-pass-box , rgba(255,255,255,0.6) , 10, 0.2 , 0 , 1 );
}
+.defaultButton:disabled {
+ -fx-background-color: #FFFFFF22;
+ -fx-text-fill: #FFFFFF77;
+}
+
+