java.awt.image.ImagingOpException Java Examples

The following examples show how to use java.awt.image.ImagingOpException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EdgeNoOpCrash.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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.");
}
 
Example #2
Source File: EdgeNoOpCrash.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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.");
}
 
Example #3
Source File: EdgeNoOpCrash.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
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.");
}
 
Example #4
Source File: EdgeNoOpCrash.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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.");
}
 
Example #5
Source File: EdgeNoOpCrash.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
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.");
}
 
Example #6
Source File: OpCompatibleImageTest.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void doTest(int type) {
    System.out.println("Test for type " + describeType(type));

    BufferedImage src = createTestImage(type);

    BufferedImage res = null;

    System.out.println("Testing null destination...");
    try {
        res = op.filter(src, null);
    } catch (ImagingOpException e) {
        throw new RuntimeException("Test FAILED!", e);
    }

    if (res == null ||
        ((src.getType() != BufferedImage.TYPE_BYTE_INDEXED) &&
         (res.getType() != src.getType())))
    {
        throw new RuntimeException("Test FAILED!");
    }
    System.out.println("Test PASSED.");
}
 
Example #7
Source File: OpCompatibleImageTest.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void doTest(int type) {
    System.out.println("Test for type " + describeType(type));

    BufferedImage src = createTestImage(type);

    BufferedImage res = null;

    System.out.println("Testing null destination...");
    try {
        res = op.filter(src, null);
    } catch (ImagingOpException e) {
        throw new RuntimeException("Test FAILED!", e);
    }

    if (res == null ||
        ((src.getType() != BufferedImage.TYPE_BYTE_INDEXED) &&
         (res.getType() != src.getType())))
    {
        throw new RuntimeException("Test FAILED!");
    }
    System.out.println("Test PASSED.");
}
 
Example #8
Source File: EdgeNoOpCrash.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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.");
}
 
Example #9
Source File: OpCompatibleImageTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void doTest(int type) {
    System.out.println("Test for type " + describeType(type));

    BufferedImage src = createTestImage(type);

    BufferedImage res = null;

    System.out.println("Testing null destination...");
    try {
        res = op.filter(src, null);
    } catch (ImagingOpException e) {
        throw new RuntimeException("Test FAILED!", e);
    }

    if (res == null ||
        ((src.getType() != BufferedImage.TYPE_BYTE_INDEXED) &&
         (res.getType() != src.getType())))
    {
        throw new RuntimeException("Test FAILED!");
    }
    System.out.println("Test PASSED.");
}
 
Example #10
Source File: OpCompatibleImageTest.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void doTest(int type) {
    System.out.println("Test for type " + describeType(type));

    BufferedImage src = createTestImage(type);

    BufferedImage res = null;

    System.out.println("Testing null destination...");
    try {
        res = op.filter(src, null);
    } catch (ImagingOpException e) {
        throw new RuntimeException("Test FAILED!", e);
    }

    if (res == null ||
        ((src.getType() != BufferedImage.TYPE_BYTE_INDEXED) &&
         (res.getType() != src.getType())))
    {
        throw new RuntimeException("Test FAILED!");
    }
    System.out.println("Test PASSED.");
}
 
Example #11
Source File: OpCompatibleImageTest.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void doTest(int type) {
    System.out.println("Test for type " + describeType(type));

    BufferedImage src = createTestImage(type);

    BufferedImage res = null;

    System.out.println("Testing null destination...");
    try {
        res = op.filter(src, null);
    } catch (ImagingOpException e) {
        throw new RuntimeException("Test FAILED!", e);
    }

    if (res == null ||
        ((src.getType() != BufferedImage.TYPE_BYTE_INDEXED) &&
         (res.getType() != src.getType())))
    {
        throw new RuntimeException("Test FAILED!");
    }
    System.out.println("Test PASSED.");
}
 
Example #12
Source File: EdgeNoOpCrash.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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.");
}
 
Example #13
Source File: EdgeNoOpCrash.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
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.");
}
 
Example #14
Source File: EdgeNoOpCrash.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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.");
}
 
Example #15
Source File: OpCompatibleImageTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void doTest(int type) {
    System.out.println("Test for type " + describeType(type));

    BufferedImage src = createTestImage(type);

    BufferedImage res = null;

    System.out.println("Testing null destination...");
    try {
        res = op.filter(src, null);
    } catch (ImagingOpException e) {
        throw new RuntimeException("Test FAILED!", e);
    }

    if (res == null ||
        ((src.getType() != BufferedImage.TYPE_BYTE_INDEXED) &&
         (res.getType() != src.getType())))
    {
        throw new RuntimeException("Test FAILED!");
    }
    System.out.println("Test PASSED.");
}
 
Example #16
Source File: EdgeNoOpCrash.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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.");
}
 
Example #17
Source File: OpCompatibleImageTest.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void doTest(int type) {
    System.out.println("Test for type " + describeType(type));

    BufferedImage src = createTestImage(type);

    BufferedImage res = null;

    System.out.println("Testing null destination...");
    try {
        res = op.filter(src, null);
    } catch (ImagingOpException e) {
        throw new RuntimeException("Test FAILED!", e);
    }

    if (res == null ||
        ((src.getType() != BufferedImage.TYPE_BYTE_INDEXED) &&
         (res.getType() != src.getType())))
    {
        throw new RuntimeException("Test FAILED!");
    }
    System.out.println("Test PASSED.");
}
 
Example #18
Source File: OpCompatibleImageTest.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void doTest(int type) {
    System.out.println("Test for type " + describeType(type));

    BufferedImage src = createTestImage(type);

    BufferedImage res = null;

    System.out.println("Testing null destination...");
    try {
        res = op.filter(src, null);
    } catch (ImagingOpException e) {
        throw new RuntimeException("Test FAILED!", e);
    }

    if (res == null ||
        ((src.getType() != BufferedImage.TYPE_BYTE_INDEXED) &&
         (res.getType() != src.getType())))
    {
        throw new RuntimeException("Test FAILED!");
    }
    System.out.println("Test PASSED.");
}
 
Example #19
Source File: OpCompatibleImageTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void doTest(int type) {
    System.out.println("Test for type " + describeType(type));

    BufferedImage src = createTestImage(type);

    BufferedImage res = null;

    System.out.println("Testing null destination...");
    try {
        res = op.filter(src, null);
    } catch (ImagingOpException e) {
        throw new RuntimeException("Test FAILED!", e);
    }

    if (res == null ||
        ((src.getType() != BufferedImage.TYPE_BYTE_INDEXED) &&
         (res.getType() != src.getType())))
    {
        throw new RuntimeException("Test FAILED!");
    }
    System.out.println("Test PASSED.");
}
 
Example #20
Source File: EdgeNoOpCrash.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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.");
}
 
Example #21
Source File: AsyncScalr.java    From java-disassembler with GNU General Public License v3.0 5 votes vote down vote up
/**
 * @see Scalr#pad(BufferedImage, int, Color, BufferedImageOp...)
 */
public static Future<BufferedImage> pad(final BufferedImage src, final int padding, final Color color, final BufferedImageOp... ops) throws IllegalArgumentException, ImagingOpException {
    checkService();

    return service.submit(new Callable<BufferedImage>() {
        public BufferedImage call() throws Exception {
            return Scalr.pad(src, padding, color, ops);
        }
    });
}
 
Example #22
Source File: AsyncScalr.java    From java-disassembler with GNU General Public License v3.0 5 votes vote down vote up
/**
 * @see Scalr#resize(BufferedImage, int, BufferedImageOp...)
 */
public static Future<BufferedImage> resize(final BufferedImage src, final int targetSize, final BufferedImageOp... ops) throws IllegalArgumentException, ImagingOpException {
    checkService();

    return service.submit(new Callable<BufferedImage>() {
        public BufferedImage call() throws Exception {
            return Scalr.resize(src, targetSize, ops);
        }
    });
}
 
Example #23
Source File: SamePackingTypeTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    BufferedImageOp op = createTestOp();

    try {
        System.out.print("Integer-based images... ");
        doTest(op, TYPE_INT_ARGB, TYPE_INT_ARGB_PRE);
        System.out.println("done.");

        System.out.print("Byte-based images... ");
        doTest(op, TYPE_4BYTE_ABGR, TYPE_4BYTE_ABGR_PRE);
        System.out.println("done");
    } catch (ImagingOpException e) {
        throw new RuntimeException("Test FAILED", e);
    }
}
 
Example #24
Source File: SamePackingTypeTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    BufferedImageOp op = createTestOp();

    try {
        System.out.print("Integer-based images... ");
        doTest(op, TYPE_INT_ARGB, TYPE_INT_ARGB_PRE);
        System.out.println("done.");

        System.out.print("Byte-based images... ");
        doTest(op, TYPE_4BYTE_ABGR, TYPE_4BYTE_ABGR_PRE);
        System.out.println("done");
    } catch (ImagingOpException e) {
        throw new RuntimeException("Test FAILED", e);
    }
}
 
Example #25
Source File: AsyncScalr.java    From RemoteSupportTool with Apache License 2.0 5 votes vote down vote up
/**
 * @see Scalr#crop(BufferedImage, int, int, BufferedImageOp...)
 */
public static Future<BufferedImage> crop(final BufferedImage src,
                                         final int width, final int height, final BufferedImageOp... ops)
        throws IllegalArgumentException, ImagingOpException {
    checkService();

    return service.submit(new Callable<BufferedImage>() {
        public BufferedImage call() throws Exception {
            return Scalr.crop(src, width, height, ops);
        }
    });
}
 
Example #26
Source File: AsyncScalr.java    From RemoteSupportTool with Apache License 2.0 5 votes vote down vote up
/**
 * @see Scalr#rotate(BufferedImage, Rotation, BufferedImageOp...)
 */
public static Future<BufferedImage> rotate(final BufferedImage src,
                                           final Rotation rotation, final BufferedImageOp... ops)
        throws IllegalArgumentException, ImagingOpException {
    checkService();

    return service.submit(new Callable<BufferedImage>() {
        public BufferedImage call() throws Exception {
            return Scalr.rotate(src, rotation, ops);
        }
    });
}
 
Example #27
Source File: SamePackingTypeTest.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    BufferedImageOp op = createTestOp();

    try {
        System.out.print("Integer-based images... ");
        doTest(op, TYPE_INT_ARGB, TYPE_INT_ARGB_PRE);
        System.out.println("done.");

        System.out.print("Byte-based images... ");
        doTest(op, TYPE_4BYTE_ABGR, TYPE_4BYTE_ABGR_PRE);
        System.out.println("done");
    } catch (ImagingOpException e) {
        throw new RuntimeException("Test FAILED", e);
    }
}
 
Example #28
Source File: AsyncScalr.java    From RemoteSupportTool with Apache License 2.0 5 votes vote down vote up
/**
 * @see Scalr#resize(BufferedImage, Mode, int, int, BufferedImageOp...)
 */
public static Future<BufferedImage> resize(final BufferedImage src,
                                           final Mode resizeMode, final int targetWidth,
                                           final int targetHeight, final BufferedImageOp... ops)
        throws IllegalArgumentException, ImagingOpException {
    checkService();

    return service.submit(new Callable<BufferedImage>() {
        public BufferedImage call() throws Exception {
            return Scalr.resize(src, resizeMode, targetWidth, targetHeight,
                    ops);
        }
    });
}
 
Example #29
Source File: AsyncScalr.java    From RemoteSupportTool with Apache License 2.0 5 votes vote down vote up
/**
 * @see Scalr#apply(BufferedImage, BufferedImageOp...)
 */
public static Future<BufferedImage> apply(final BufferedImage src,
                                          final BufferedImageOp... ops) throws IllegalArgumentException,
        ImagingOpException {
    checkService();

    return service.submit(new Callable<BufferedImage>() {
        public BufferedImage call() throws Exception {
            return Scalr.apply(src, ops);
        }
    });
}
 
Example #30
Source File: AsyncScalr.java    From java-disassembler with GNU General Public License v3.0 5 votes vote down vote up
/**
 * @see Scalr#resize(BufferedImage, Method, Mode, int, int,
 * BufferedImageOp...)
 */
public static Future<BufferedImage> resize(final BufferedImage src, final Method scalingMethod, final Mode resizeMode, final int targetWidth, final int targetHeight, final BufferedImageOp... ops) throws IllegalArgumentException, ImagingOpException {
    checkService();

    return service.submit(new Callable<BufferedImage>() {
        public BufferedImage call() throws Exception {
            return Scalr.resize(src, scalingMethod, resizeMode, targetWidth, targetHeight, ops);
        }
    });
}