Search in sources :

Example 11 with ConvolveOp

use of java.awt.image.ConvolveOp in project jdk8u_jdk by JetBrains.

the class EdgeNoOpCrash method crashTest.

private static void crashTest() {
    Raster src = createSrcRaster();
    WritableRaster dst = createDstRaster();
    ConvolveOp op = createConvolveOp(ConvolveOp.EDGE_NO_OP);
    try {
        op.filter(src, dst);
    } catch (ImagingOpException e) {
    /*
             * The test pair of source and destination rasters
             * may cause failure of the medialib convolution routine,
             * so this exception is expected.
             *
             * The JVM crash is the only manifestation of this
             * test failure.
             */
    }
    System.out.println("Test PASSED.");
}
Also used : WritableRaster(java.awt.image.WritableRaster) Raster(java.awt.image.Raster) WritableRaster(java.awt.image.WritableRaster) ImagingOpException(java.awt.image.ImagingOpException) ConvolveOp(java.awt.image.ConvolveOp)

Example 12 with ConvolveOp

use of java.awt.image.ConvolveOp in project jdk8u_jdk by JetBrains.

the class MlibOpsTest method getConvolveOp.

private static BufferedImageOp getConvolveOp() {
    int kw = 3;
    int kh = 3;
    int size = kw * kh;
    float[] kdata = new float[size];
    Arrays.fill(kdata, 1.0f / size);
    Kernel k = new Kernel(kw, kh, kdata);
    return new ConvolveOp(k);
}
Also used : ConvolveOp(java.awt.image.ConvolveOp) Kernel(java.awt.image.Kernel) RadialGradientPaint(java.awt.RadialGradientPaint)

Aggregations

ConvolveOp (java.awt.image.ConvolveOp)12 Kernel (java.awt.image.Kernel)7 BufferedImage (java.awt.image.BufferedImage)5 LookupOp (java.awt.image.LookupOp)4 Color (java.awt.Color)3 GradientPaint (java.awt.GradientPaint)3 Graphics2D (java.awt.Graphics2D)3 Font (java.awt.Font)2 FontMetrics (java.awt.FontMetrics)2 Rectangle2D (java.awt.geom.Rectangle2D)2 RoundRectangle2D (java.awt.geom.RoundRectangle2D)2 AffineTransformOp (java.awt.image.AffineTransformOp)2 ByteLookupTable (java.awt.image.ByteLookupTable)2 LookupTable (java.awt.image.LookupTable)2 RescaleOp (java.awt.image.RescaleOp)2 WritableRaster (java.awt.image.WritableRaster)2 SurfaceData (sun.java2d.SurfaceData)2 BasicStroke (java.awt.BasicStroke)1 Point (java.awt.Point)1 RadialGradientPaint (java.awt.RadialGradientPaint)1