26 lines
678 B
Java
26 lines
678 B
Java
package io.gitlab.jfronny.ImgJava.imageProcessing;
|
|
|
|
import io.gitlab.jfronny.ImgJava.util.MColor;
|
|
import io.gitlab.jfronny.ImgJava.util.Picture;
|
|
|
|
import java.awt.*;
|
|
|
|
public class UtilColor {
|
|
public static Picture tint(Picture picture, Color tint) {
|
|
int w = picture.getWidth();
|
|
int h = picture.getHeight();
|
|
|
|
Color[][] pixel = picture.getPixelArray();
|
|
Color[][] pixelNeu = new Color[w][h];
|
|
|
|
for (int x = 0; x < w; x++) {
|
|
for (int y = 0; y < h; y++) {
|
|
pixelNeu[x][y] = new MColor(pixel[x][y]).tint(tint).get();
|
|
}
|
|
}
|
|
|
|
picture.setPixelArray(pixelNeu);
|
|
return picture;
|
|
}
|
|
}
|