MlibOpsTest.java revision 6353
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * This code is free software; you can redistribute it and/or modify it
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * under the terms of the GNU General Public License version 2 only, as
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * published by the Free Software Foundation.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * This code is distributed in the hope that it will be useful, but WITHOUT
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * version 2 for more details (a copy is included in the LICENSE file that
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * accompanied this code).
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * You should have received a copy of the GNU General Public License version
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * 2 along with this work; if not, write to the Free Software Foundation,
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * or visit www.oracle.com if you need additional information or have any
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * questions.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * @bug 6556332 8011992 8012112
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * @summary Test verifies that on-demnad loading of medialib library does
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * not break imageing ops based on this library.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * @run main MlibOpsTest
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * @run main/othervm/policy=mlib.security.policy MlibOpsTest
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockpublic class MlibOpsTest {
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock } catch (Exception e) {
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock throw new RuntimeException("Test FAILED: null output");
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock System.out.println("Test PASSED for " + op.getClass().getName());
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock private static BufferedImageOp getAffineTransformOp() {
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock return new ConvolveOp(k);
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock ByteLookupTable table = new ByteLookupTable(0, inv);
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock private static int w = 100;
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock private static int h = 100;
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock return new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock Color[] colors = { Color.red, Color.green, Color.blue };
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock new RadialGradientPaint(center, 0.5f * w, dist, colors);