mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
ColorUtil.Channel getChannel() -> from()
This commit is contained in:
@@ -31,7 +31,7 @@ public class ImageSampler implements NoiseSampler {
|
||||
|
||||
@Override
|
||||
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
|
||||
|
||||
@@ -36,35 +36,35 @@ public class ColorUtil {
|
||||
public enum Channel {
|
||||
RED {
|
||||
@Override
|
||||
public int getChannel(int rgb) {
|
||||
public int from(int rgb) {
|
||||
return getRed(rgb);
|
||||
}
|
||||
},
|
||||
GREEN {
|
||||
@Override
|
||||
public int getChannel(int rgb) {
|
||||
public int from(int rgb) {
|
||||
return getGreen(rgb);
|
||||
}
|
||||
},
|
||||
BLUE {
|
||||
@Override
|
||||
public int getChannel(int rgb) {
|
||||
public int from(int rgb) {
|
||||
return getBlue(rgb);
|
||||
}
|
||||
},
|
||||
GRAYSCALE {
|
||||
@Override
|
||||
public int getChannel(int rgb) {
|
||||
public int from(int rgb) {
|
||||
return getGrayscale(rgb);
|
||||
}
|
||||
},
|
||||
ALPHA {
|
||||
@Override
|
||||
public int getChannel(int rgb) {
|
||||
public int from(int rgb) {
|
||||
return getAlpha(rgb);
|
||||
}
|
||||
};
|
||||
|
||||
public abstract int getChannel(int rgb);
|
||||
public abstract int from(int rgb);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user