ColorUtil.Channel getChannel() -> from()

This commit is contained in:
Astrash
2022-11-24 13:55:16 +11:00
parent 68875cc17b
commit c491ac5b24
2 changed files with 7 additions and 7 deletions
@@ -31,7 +31,7 @@ public class ImageSampler implements NoiseSampler {
@Override @Override
public double noise(long seed, double x, double y) { public double noise(long seed, double x, double y) {
return channel.getChannel(colorPicker.apply(image, (int) (x * frequency), (int) (y * frequency))) / 255D * 2 - 1; return channel.from(colorPicker.apply(image, (int) (x * frequency), (int) (y * frequency))) / 255D * 2 - 1;
} }
@Override @Override
@@ -36,35 +36,35 @@ public class ColorUtil {
public enum Channel { public enum Channel {
RED { RED {
@Override @Override
public int getChannel(int rgb) { public int from(int rgb) {
return getRed(rgb); return getRed(rgb);
} }
}, },
GREEN { GREEN {
@Override @Override
public int getChannel(int rgb) { public int from(int rgb) {
return getGreen(rgb); return getGreen(rgb);
} }
}, },
BLUE { BLUE {
@Override @Override
public int getChannel(int rgb) { public int from(int rgb) {
return getBlue(rgb); return getBlue(rgb);
} }
}, },
GRAYSCALE { GRAYSCALE {
@Override @Override
public int getChannel(int rgb) { public int from(int rgb) {
return getGrayscale(rgb); return getGrayscale(rgb);
} }
}, },
ALPHA { ALPHA {
@Override @Override
public int getChannel(int rgb) { public int from(int rgb) {
return getAlpha(rgb); return getAlpha(rgb);
} }
}; };
public abstract int getChannel(int rgb); public abstract int from(int rgb);
} }
} }