Methods Summary |
---|
public java.awt.image.BufferedImage | createCompatibleDestImage(java.awt.image.BufferedImage src, java.awt.image.ColorModel dstCM)
BufferedImage image;
if (dstCM == null) dstCM = src.getColorModel();
int width = src.getWidth();
int height = src.getHeight();
image = new BufferedImage (dstCM,
dstCM.createCompatibleWritableRaster(width, height),
dstCM.isAlphaPremultiplied(), null);
return image;
|
public final java.awt.image.BufferedImage | filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
if (dst == null) dst = createCompatibleDestImage(src, null);
for (int y = 0; y < src.getHeight(); y++) {
for (int x = 0; x < src.getWidth(); x++) {
int srcPixel = src.getRGB(x, y);
Color c = new Color(srcPixel);
int red = threshold(c.getRed());
int green = threshold(c.getGreen());
int blue = threshold(c.getBlue());
dst.setRGB(x, y, new Color(red, green, blue).getRGB());
}
}
return dst;
|
public final java.awt.geom.Rectangle2D | getBounds2D(java.awt.image.BufferedImage src)
return src.getRaster().getBounds();
|
public final java.awt.geom.Point2D | getPoint2D(java.awt.geom.Point2D srcPt, java.awt.geom.Point2D dstPt)
if (dstPt == null) dstPt = new Point2D.Float();
dstPt.setLocation(srcPt.getX(), srcPt.getY());
return dstPt;
|
public final java.awt.RenderingHints | getRenderingHints() return null;
|
public int | threshold(int input)
if (input < mThreshold) return mMinimum;
else return mMaximum;
|