Dither.java
917 Bytes
/*
* Decompiled with CFR 0_118.
*/
package com.day.image;
import com.day.image.DitherOp;
import java.awt.*;
import java.awt.image.BufferedImage;
@Deprecated
public class Dither {
@Deprecated
public static final int DITHER_NONE = 1;
@Deprecated
public static final int DITHER_SIMPLE_ERROR_CORRECTION = 2;
private Dither() {
}
@Deprecated
public static BufferedImage dither(BufferedImage image, int nCol, long transparency, long bgcolor, int algorithm) {
Color transparentCol = transparency == -1 ? null : new Color((int)transparency, true);
Color bgCol = bgcolor == -1 ? null : new Color((int)bgcolor, true);
DitherOp.DitherAlgorithm algo = algorithm == 2 ? DitherOp.DITHER_SIMPLE_ERROR_CORRECTION : DitherOp.DITHER_NONE;
DitherOp dither = new DitherOp(nCol, transparentCol, bgCol, algo, null);
return dither.filter(image, null);
}
}