Java Code Examples for java.awt.image.RasterOp#createCompatibleDestRaster()

The following examples show how to use java.awt.image.RasterOp#createCompatibleDestRaster() . 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: ImagingLib.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static WritableRaster filter(RasterOp op, Raster src,
                                    WritableRaster dst) {
    if (useLib == false) {
        return null;
    }

    // Create the destination tile
    if (dst == null) {
        dst = op.createCompatibleDestRaster(src);
    }


    WritableRaster retRaster = null;
    switch (getNativeOpIndex(op.getClass())) {

      case LOOKUP_OP:
        // REMIND: Fix this!
        LookupTable table = ((LookupOp)op).getTable();
        if (table.getOffset() != 0) {
            // Right now the native code doesn't support offsets
            return null;
        }
        if (table instanceof ByteLookupTable) {
            ByteLookupTable bt = (ByteLookupTable) table;
            if (lookupByteRaster(src, dst, bt.getTable()) > 0) {
                retRaster = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        bOp.getTransform().getMatrix(matrix);
        if (transformRaster(src, dst, matrix,
                            bOp.getInterpolationType()) > 0) {
            retRaster =  dst;
        }
        break;

      case CONVOLVE_OP:
        ConvolveOp cOp = (ConvolveOp) op;
        if (convolveRaster(src, dst,
                           cOp.getKernel(), cOp.getEdgeCondition()) > 0) {
            retRaster = dst;
        }
        break;

      default:
        break;
    }

    if (retRaster != null) {
        SunWritableRaster.markDirty(retRaster);
    }

    return retRaster;
}
 
Example 2
Source File: ImagingLib.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static WritableRaster filter(RasterOp op, Raster src,
                                    WritableRaster dst) {
    if (useLib == false) {
        return null;
    }

    // Create the destination tile
    if (dst == null) {
        dst = op.createCompatibleDestRaster(src);
    }


    WritableRaster retRaster = null;
    switch (getNativeOpIndex(op.getClass())) {

      case LOOKUP_OP:
        // REMIND: Fix this!
        LookupTable table = ((LookupOp)op).getTable();
        if (table.getOffset() != 0) {
            // Right now the native code doesn't support offsets
            return null;
        }
        if (table instanceof ByteLookupTable) {
            ByteLookupTable bt = (ByteLookupTable) table;
            if (lookupByteRaster(src, dst, bt.getTable()) > 0) {
                retRaster = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        bOp.getTransform().getMatrix(matrix);
        if (transformRaster(src, dst, matrix,
                            bOp.getInterpolationType()) > 0) {
            retRaster =  dst;
        }
        break;

      case CONVOLVE_OP:
        ConvolveOp cOp = (ConvolveOp) op;
        if (convolveRaster(src, dst,
                           cOp.getKernel(), cOp.getEdgeCondition()) > 0) {
            retRaster = dst;
        }
        break;

      default:
        break;
    }

    if (retRaster != null) {
        SunWritableRaster.markDirty(retRaster);
    }

    return retRaster;
}
 
Example 3
Source File: ImagingLib.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public static WritableRaster filter(RasterOp op, Raster src,
                                    WritableRaster dst) {
    if (useLib == false) {
        return null;
    }

    // Create the destination tile
    if (dst == null) {
        dst = op.createCompatibleDestRaster(src);
    }


    WritableRaster retRaster = null;
    switch (getNativeOpIndex(op.getClass())) {

      case LOOKUP_OP:
        // REMIND: Fix this!
        LookupTable table = ((LookupOp)op).getTable();
        if (table.getOffset() != 0) {
            // Right now the native code doesn't support offsets
            return null;
        }
        if (table instanceof ByteLookupTable) {
            ByteLookupTable bt = (ByteLookupTable) table;
            if (lookupByteRaster(src, dst, bt.getTable()) > 0) {
                retRaster = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        bOp.getTransform().getMatrix(matrix);
        if (transformRaster(src, dst, matrix,
                            bOp.getInterpolationType()) > 0) {
            retRaster =  dst;
        }
        break;

      case CONVOLVE_OP:
        ConvolveOp cOp = (ConvolveOp) op;
        if (convolveRaster(src, dst,
                           cOp.getKernel(), cOp.getEdgeCondition()) > 0) {
            retRaster = dst;
        }
        break;

      default:
        break;
    }

    if (retRaster != null) {
        SunWritableRaster.markDirty(retRaster);
    }

    return retRaster;
}
 
Example 4
Source File: ImagingLib.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static WritableRaster filter(RasterOp op, Raster src,
                                    WritableRaster dst) {
    if (useLib == false) {
        return null;
    }

    // Create the destination tile
    if (dst == null) {
        dst = op.createCompatibleDestRaster(src);
    }


    WritableRaster retRaster = null;
    switch (getNativeOpIndex(op.getClass())) {

      case LOOKUP_OP:
        // REMIND: Fix this!
        LookupTable table = ((LookupOp)op).getTable();
        if (table.getOffset() != 0) {
            // Right now the native code doesn't support offsets
            return null;
        }
        if (table instanceof ByteLookupTable) {
            ByteLookupTable bt = (ByteLookupTable) table;
            if (lookupByteRaster(src, dst, bt.getTable()) > 0) {
                retRaster = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        bOp.getTransform().getMatrix(matrix);
        if (transformRaster(src, dst, matrix,
                            bOp.getInterpolationType()) > 0) {
            retRaster =  dst;
        }
        break;

      case CONVOLVE_OP:
        ConvolveOp cOp = (ConvolveOp) op;
        if (convolveRaster(src, dst,
                           cOp.getKernel(), cOp.getEdgeCondition()) > 0) {
            retRaster = dst;
        }
        break;

      default:
        break;
    }

    if (retRaster != null) {
        SunWritableRaster.markDirty(retRaster);
    }

    return retRaster;
}
 
Example 5
Source File: ImagingLib.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public static WritableRaster filter(RasterOp op, Raster src,
                                    WritableRaster dst) {
    if (useLib == false) {
        return null;
    }

    // Create the destination tile
    if (dst == null) {
        dst = op.createCompatibleDestRaster(src);
    }


    WritableRaster retRaster = null;
    switch (getNativeOpIndex(op.getClass())) {

      case LOOKUP_OP:
        // REMIND: Fix this!
        LookupTable table = ((LookupOp)op).getTable();
        if (table.getOffset() != 0) {
            // Right now the native code doesn't support offsets
            return null;
        }
        if (table instanceof ByteLookupTable) {
            ByteLookupTable bt = (ByteLookupTable) table;
            if (lookupByteRaster(src, dst, bt.getTable()) > 0) {
                retRaster = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        bOp.getTransform().getMatrix(matrix);
        if (transformRaster(src, dst, matrix,
                            bOp.getInterpolationType()) > 0) {
            retRaster =  dst;
        }
        break;

      case CONVOLVE_OP:
        ConvolveOp cOp = (ConvolveOp) op;
        if (convolveRaster(src, dst,
                           cOp.getKernel(), cOp.getEdgeCondition()) > 0) {
            retRaster = dst;
        }
        break;

      default:
        break;
    }

    if (retRaster != null) {
        SunWritableRaster.markDirty(retRaster);
    }

    return retRaster;
}
 
Example 6
Source File: ImagingLib.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
public static WritableRaster filter(RasterOp op, Raster src,
                                    WritableRaster dst) {
    if (useLib == false) {
        return null;
    }

    // Create the destination tile
    if (dst == null) {
        dst = op.createCompatibleDestRaster(src);
    }


    WritableRaster retRaster = null;
    switch (getNativeOpIndex(op.getClass())) {

      case LOOKUP_OP:
        // REMIND: Fix this!
        LookupTable table = ((LookupOp)op).getTable();
        if (table.getOffset() != 0) {
            // Right now the native code doesn't support offsets
            return null;
        }
        if (table instanceof ByteLookupTable) {
            ByteLookupTable bt = (ByteLookupTable) table;
            if (lookupByteRaster(src, dst, bt.getTable()) > 0) {
                retRaster = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        bOp.getTransform().getMatrix(matrix);
        if (transformRaster(src, dst, matrix,
                            bOp.getInterpolationType()) > 0) {
            retRaster =  dst;
        }
        break;

      case CONVOLVE_OP:
        ConvolveOp cOp = (ConvolveOp) op;
        if (convolveRaster(src, dst,
                           cOp.getKernel(), cOp.getEdgeCondition()) > 0) {
            retRaster = dst;
        }
        break;

      default:
        break;
    }

    if (retRaster != null) {
        SunWritableRaster.markDirty(retRaster);
    }

    return retRaster;
}
 
Example 7
Source File: ImagingLib.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public static WritableRaster filter(RasterOp op, Raster src,
                                    WritableRaster dst) {
    if (useLib == false) {
        return null;
    }

    // Create the destination tile
    if (dst == null) {
        dst = op.createCompatibleDestRaster(src);
    }


    WritableRaster retRaster = null;
    switch (getNativeOpIndex(op.getClass())) {

      case LOOKUP_OP:
        // REMIND: Fix this!
        LookupTable table = ((LookupOp)op).getTable();
        if (table.getOffset() != 0) {
            // Right now the native code doesn't support offsets
            return null;
        }
        if (table instanceof ByteLookupTable) {
            ByteLookupTable bt = (ByteLookupTable) table;
            if (lookupByteRaster(src, dst, bt.getTable()) > 0) {
                retRaster = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        bOp.getTransform().getMatrix(matrix);
        if (transformRaster(src, dst, matrix,
                            bOp.getInterpolationType()) > 0) {
            retRaster =  dst;
        }
        break;

      case CONVOLVE_OP:
        ConvolveOp cOp = (ConvolveOp) op;
        if (convolveRaster(src, dst,
                           cOp.getKernel(), cOp.getEdgeCondition()) > 0) {
            retRaster = dst;
        }
        break;

      default:
        break;
    }

    if (retRaster != null) {
        SunWritableRaster.markDirty(retRaster);
    }

    return retRaster;
}
 
Example 8
Source File: ImagingLib.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static WritableRaster filter(RasterOp op, Raster src,
                                    WritableRaster dst) {
    if (useLib == false) {
        return null;
    }

    // Create the destination tile
    if (dst == null) {
        dst = op.createCompatibleDestRaster(src);
    }


    WritableRaster retRaster = null;
    switch (getNativeOpIndex(op.getClass())) {

      case LOOKUP_OP:
        // REMIND: Fix this!
        LookupTable table = ((LookupOp)op).getTable();
        if (table.getOffset() != 0) {
            // Right now the native code doesn't support offsets
            return null;
        }
        if (table instanceof ByteLookupTable) {
            ByteLookupTable bt = (ByteLookupTable) table;
            if (lookupByteRaster(src, dst, bt.getTable()) > 0) {
                retRaster = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        bOp.getTransform().getMatrix(matrix);
        if (transformRaster(src, dst, matrix,
                            bOp.getInterpolationType()) > 0) {
            retRaster =  dst;
        }
        break;

      case CONVOLVE_OP:
        ConvolveOp cOp = (ConvolveOp) op;
        if (convolveRaster(src, dst,
                           cOp.getKernel(), cOp.getEdgeCondition()) > 0) {
            retRaster = dst;
        }
        break;

      default:
        break;
    }

    if (retRaster != null) {
        SunWritableRaster.markDirty(retRaster);
    }

    return retRaster;
}
 
Example 9
Source File: ImagingLib.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static WritableRaster filter(RasterOp op, Raster src,
                                    WritableRaster dst) {
    if (useLib == false) {
        return null;
    }

    // Create the destination tile
    if (dst == null) {
        dst = op.createCompatibleDestRaster(src);
    }


    WritableRaster retRaster = null;
    switch (getNativeOpIndex(op.getClass())) {

      case LOOKUP_OP:
        // REMIND: Fix this!
        LookupTable table = ((LookupOp)op).getTable();
        if (table.getOffset() != 0) {
            // Right now the native code doesn't support offsets
            return null;
        }
        if (table instanceof ByteLookupTable) {
            ByteLookupTable bt = (ByteLookupTable) table;
            if (lookupByteRaster(src, dst, bt.getTable()) > 0) {
                retRaster = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        bOp.getTransform().getMatrix(matrix);
        if (transformRaster(src, dst, matrix,
                            bOp.getInterpolationType()) > 0) {
            retRaster =  dst;
        }
        break;

      case CONVOLVE_OP:
        ConvolveOp cOp = (ConvolveOp) op;
        if (convolveRaster(src, dst,
                           cOp.getKernel(), cOp.getEdgeCondition()) > 0) {
            retRaster = dst;
        }
        break;

      default:
        break;
    }

    if (retRaster != null) {
        SunWritableRaster.markDirty(retRaster);
    }

    return retRaster;
}
 
Example 10
Source File: ImagingLib.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public static WritableRaster filter(RasterOp op, Raster src,
                                    WritableRaster dst) {
    if (useLib == false) {
        return null;
    }

    // Create the destination tile
    if (dst == null) {
        dst = op.createCompatibleDestRaster(src);
    }


    WritableRaster retRaster = null;
    switch (getNativeOpIndex(op.getClass())) {

      case LOOKUP_OP:
        // REMIND: Fix this!
        LookupTable table = ((LookupOp)op).getTable();
        if (table.getOffset() != 0) {
            // Right now the native code doesn't support offsets
            return null;
        }
        if (table instanceof ByteLookupTable) {
            ByteLookupTable bt = (ByteLookupTable) table;
            if (lookupByteRaster(src, dst, bt.getTable()) > 0) {
                retRaster = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        bOp.getTransform().getMatrix(matrix);
        if (transformRaster(src, dst, matrix,
                            bOp.getInterpolationType()) > 0) {
            retRaster =  dst;
        }
        break;

      case CONVOLVE_OP:
        ConvolveOp cOp = (ConvolveOp) op;
        if (convolveRaster(src, dst,
                           cOp.getKernel(), cOp.getEdgeCondition()) > 0) {
            retRaster = dst;
        }
        break;

      default:
        break;
    }

    if (retRaster != null) {
        SunWritableRaster.markDirty(retRaster);
    }

    return retRaster;
}
 
Example 11
Source File: ImagingLib.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public static WritableRaster filter(RasterOp op, Raster src,
                                    WritableRaster dst) {
    if (useLib == false) {
        return null;
    }

    // Create the destination tile
    if (dst == null) {
        dst = op.createCompatibleDestRaster(src);
    }


    WritableRaster retRaster = null;
    switch (getNativeOpIndex(op.getClass())) {

      case LOOKUP_OP:
        // REMIND: Fix this!
        LookupTable table = ((LookupOp)op).getTable();
        if (table.getOffset() != 0) {
            // Right now the native code doesn't support offsets
            return null;
        }
        if (table instanceof ByteLookupTable) {
            ByteLookupTable bt = (ByteLookupTable) table;
            if (lookupByteRaster(src, dst, bt.getTable()) > 0) {
                retRaster = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        bOp.getTransform().getMatrix(matrix);
        if (transformRaster(src, dst, matrix,
                            bOp.getInterpolationType()) > 0) {
            retRaster =  dst;
        }
        break;

      case CONVOLVE_OP:
        ConvolveOp cOp = (ConvolveOp) op;
        if (convolveRaster(src, dst,
                           cOp.getKernel(), cOp.getEdgeCondition()) > 0) {
            retRaster = dst;
        }
        break;

      default:
        break;
    }

    if (retRaster != null) {
        SunWritableRaster.markDirty(retRaster);
    }

    return retRaster;
}
 
Example 12
Source File: ImagingLib.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static WritableRaster filter(RasterOp op, Raster src,
                                    WritableRaster dst) {
    if (useLib == false) {
        return null;
    }

    // Create the destination tile
    if (dst == null) {
        dst = op.createCompatibleDestRaster(src);
    }


    WritableRaster retRaster = null;
    switch (getNativeOpIndex(op.getClass())) {

      case LOOKUP_OP:
        // REMIND: Fix this!
        LookupTable table = ((LookupOp)op).getTable();
        if (table.getOffset() != 0) {
            // Right now the native code doesn't support offsets
            return null;
        }
        if (table instanceof ByteLookupTable) {
            ByteLookupTable bt = (ByteLookupTable) table;
            if (lookupByteRaster(src, dst, bt.getTable()) > 0) {
                retRaster = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        bOp.getTransform().getMatrix(matrix);
        if (transformRaster(src, dst, matrix,
                            bOp.getInterpolationType()) > 0) {
            retRaster =  dst;
        }
        break;

      case CONVOLVE_OP:
        ConvolveOp cOp = (ConvolveOp) op;
        if (convolveRaster(src, dst,
                           cOp.getKernel(), cOp.getEdgeCondition()) > 0) {
            retRaster = dst;
        }
        break;

      default:
        break;
    }

    if (retRaster != null) {
        SunWritableRaster.markDirty(retRaster);
    }

    return retRaster;
}
 
Example 13
Source File: ImagingLib.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static WritableRaster filter(RasterOp op, Raster src,
                                    WritableRaster dst) {
    if (useLib == false) {
        return null;
    }

    // Create the destination tile
    if (dst == null) {
        dst = op.createCompatibleDestRaster(src);
    }


    WritableRaster retRaster = null;
    switch (getNativeOpIndex(op.getClass())) {

      case LOOKUP_OP:
        // REMIND: Fix this!
        LookupTable table = ((LookupOp)op).getTable();
        if (table.getOffset() != 0) {
            // Right now the native code doesn't support offsets
            return null;
        }
        if (table instanceof ByteLookupTable) {
            ByteLookupTable bt = (ByteLookupTable) table;
            if (lookupByteRaster(src, dst, bt.getTable()) > 0) {
                retRaster = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        bOp.getTransform().getMatrix(matrix);
        if (transformRaster(src, dst, matrix,
                            bOp.getInterpolationType()) > 0) {
            retRaster =  dst;
        }
        break;

      case CONVOLVE_OP:
        ConvolveOp cOp = (ConvolveOp) op;
        if (convolveRaster(src, dst,
                           cOp.getKernel(), cOp.getEdgeCondition()) > 0) {
            retRaster = dst;
        }
        break;

      default:
        break;
    }

    if (retRaster != null) {
        SunWritableRaster.markDirty(retRaster);
    }

    return retRaster;
}
 
Example 14
Source File: ImagingLib.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static WritableRaster filter(RasterOp op, Raster src,
                                    WritableRaster dst) {
    if (useLib == false) {
        return null;
    }

    // Create the destination tile
    if (dst == null) {
        dst = op.createCompatibleDestRaster(src);
    }


    WritableRaster retRaster = null;
    switch (getNativeOpIndex(op.getClass())) {

      case LOOKUP_OP:
        // REMIND: Fix this!
        LookupTable table = ((LookupOp)op).getTable();
        if (table.getOffset() != 0) {
            // Right now the native code doesn't support offsets
            return null;
        }
        if (table instanceof ByteLookupTable) {
            ByteLookupTable bt = (ByteLookupTable) table;
            if (lookupByteRaster(src, dst, bt.getTable()) > 0) {
                retRaster = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        bOp.getTransform().getMatrix(matrix);
        if (transformRaster(src, dst, matrix,
                            bOp.getInterpolationType()) > 0) {
            retRaster =  dst;
        }
        break;

      case CONVOLVE_OP:
        ConvolveOp cOp = (ConvolveOp) op;
        if (convolveRaster(src, dst,
                           cOp.getKernel(), cOp.getEdgeCondition()) > 0) {
            retRaster = dst;
        }
        break;

      default:
        break;
    }

    if (retRaster != null) {
        SunWritableRaster.markDirty(retRaster);
    }

    return retRaster;
}