Class ColorfulFilter
- java.lang.Object
-
- org.openstreetmap.josm.gui.layer.imagery.ColorfulFilter
-
- All Implemented Interfaces:
BufferedImageOp
public class ColorfulFilter extends Object implements BufferedImageOp
Colorful filter.- Since:
- 11914 (extracted from ColorfulImageProcessor)
-
-
Field Summary
Fields Modifier and Type Field Description private double
colorfulness
private static double
LUMINOSITY_BLUE
private static double
LUMINOSITY_GREEN
private static double
LUMINOSITY_RED
-
Constructor Summary
Constructors Constructor Description ColorfulFilter(double colorfulness)
Create a new colorful filter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BufferedImage
createCompatibleDestImage(BufferedImage src, ColorModel destCM)
private void
doFilter(DataBufferByte src, DataBufferByte dest, int redOffset, int greenOffset, int blueOffset, int alphaOffset, boolean hasAlpha)
private BufferedImage
doFilterRGB(BufferedImage src)
BufferedImage
filter(BufferedImage src, BufferedImage dst)
private BufferedImage
filterIndexed(BufferedImage src, BufferedImage dest)
Fast alternative for indexed images: We can change the palette here.Rectangle2D
getBounds2D(BufferedImage src)
private static byte[]
getIndexColorModelData(int size, Consumer<byte[]> consumer)
Point2D
getPoint2D(Point2D srcPt, Point2D dstPt)
RenderingHints
getRenderingHints()
private byte
mix(int color, double luminosity)
private int
mixInt(int color, double luminosity)
-
-
-
Field Detail
-
LUMINOSITY_RED
private static final double LUMINOSITY_RED
- See Also:
- Constant Field Values
-
LUMINOSITY_GREEN
private static final double LUMINOSITY_GREEN
- See Also:
- Constant Field Values
-
LUMINOSITY_BLUE
private static final double LUMINOSITY_BLUE
- See Also:
- Constant Field Values
-
colorfulness
private final double colorfulness
-
-
Constructor Detail
-
ColorfulFilter
ColorfulFilter(double colorfulness)
Create a new colorful filter.- Parameters:
colorfulness
- The colorfulness as defined in theColorfulImageProcessor
class.
-
-
Method Detail
-
filter
public BufferedImage filter(BufferedImage src, BufferedImage dst)
- Specified by:
filter
in interfaceBufferedImageOp
-
filterIndexed
private BufferedImage filterIndexed(BufferedImage src, BufferedImage dest)
Fast alternative for indexed images: We can change the palette here.- Parameters:
src
- The source imagedest
- The image to copy the source to- Returns:
- The image.
-
getIndexColorModelData
private static byte[] getIndexColorModelData(int size, Consumer<byte[]> consumer)
-
doFilter
private void doFilter(DataBufferByte src, DataBufferByte dest, int redOffset, int greenOffset, int blueOffset, int alphaOffset, boolean hasAlpha)
-
doFilterRGB
private BufferedImage doFilterRGB(BufferedImage src)
-
mixInt
private int mixInt(int color, double luminosity)
-
mix
private byte mix(int color, double luminosity)
-
getBounds2D
public Rectangle2D getBounds2D(BufferedImage src)
- Specified by:
getBounds2D
in interfaceBufferedImageOp
-
createCompatibleDestImage
public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel destCM)
- Specified by:
createCompatibleDestImage
in interfaceBufferedImageOp
-
getPoint2D
public Point2D getPoint2D(Point2D srcPt, Point2D dstPt)
- Specified by:
getPoint2D
in interfaceBufferedImageOp
-
getRenderingHints
public RenderingHints getRenderingHints()
- Specified by:
getRenderingHints
in interfaceBufferedImageOp
-
-