[DEBUG] correct image transformation

This commit is contained in:
Edouard DUPIN 2021-05-29 00:53:45 +02:00
parent d5d68542ed
commit 6a90749d4d

View File

@ -3,7 +3,7 @@ package org.atriasoft.egami;
public class ToolImage {
public static ImageByte convertImageByte(final ImageFloat input) {
if (input.hasAlpha()) {
ImageByte out = new ImageByteRGBA(input.getHeight(), input.getWidth());
ImageByte out = new ImageByteRGBA(input.getWidth(), input.getHeight());
for (int xxx = 0; xxx < input.getWidth(); ++xxx) {
for (int yyy = 0; yyy < input.getHeight(); ++yyy) {
out.setRByte(xxx, yyy, input.getRByte(xxx, yyy));
@ -14,7 +14,7 @@ public class ToolImage {
}
return out;
}
ImageByte out = new ImageByteRGB(input.getHeight(), input.getWidth());
ImageByte out = new ImageByteRGB(input.getWidth(), input.getHeight());
for (int xxx = 0; xxx < input.getWidth(); ++xxx) {
for (int yyy = 0; yyy < input.getHeight(); ++yyy) {
out.setRByte(xxx, yyy, input.getRByte(xxx, yyy));
@ -28,7 +28,7 @@ public class ToolImage {
public static ImageFloat convertImageFloat(final ImageByte input) {
if (input.hasAlpha()) {
ImageFloat out = new ImageFloatRGBA(input.getHeight(), input.getWidth());
ImageFloat out = new ImageFloatRGBA(input.getWidth(), input.getHeight());
for (int xxx = 0; xxx < input.getWidth(); ++xxx) {
for (int yyy = 0; yyy < input.getHeight(); ++yyy) {
out.setRFloat(xxx, yyy, input.getRFloat(xxx, yyy));
@ -39,7 +39,7 @@ public class ToolImage {
}
return out;
}
ImageFloat out = new ImageFloatRGB(input.getHeight(), input.getWidth());
ImageFloat out = new ImageFloatRGB(input.getWidth(), input.getHeight());
for (int xxx = 0; xxx < input.getWidth(); ++xxx) {
for (int yyy = 0; yyy < input.getHeight(); ++yyy) {
out.setRFloat(xxx, yyy, input.getRFloat(xxx, yyy));