Java Code Examples for java.awt.image.LookupTable#getOffset()

The following examples show how to use java.awt.image.LookupTable#getOffset() . 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 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 2
Source File: ImagingLib.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public static BufferedImage filter(BufferedImageOp op, BufferedImage src,
                                   BufferedImage dst)
{
    if (verbose) {
        System.out.println("in filter and op is "+op
                           + "bufimage is "+src+" and "+dst);
    }

    if (useLib == false) {
        return null;
    }

    // Create the destination image
    if (dst == null) {
        dst = op.createCompatibleDestImage(src, null);
    }

    BufferedImage retBI = 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 (lookupByteBI(src, dst, bt.getTable()) > 0) {
                retBI = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        AffineTransform xform = bOp.getTransform();
        bOp.getTransform().getMatrix(matrix);

        if (transformBI(src, dst, matrix,
                        bOp.getInterpolationType())>0) {
            retBI = dst;
        }
        break;

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

      default:
        break;
    }

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

    return retBI;
}
 
Example 3
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 4
Source File: ImagingLib.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static BufferedImage filter(BufferedImageOp op, BufferedImage src,
                                   BufferedImage dst)
{
    if (verbose) {
        System.out.println("in filter and op is "+op
                           + "bufimage is "+src+" and "+dst);
    }

    if (useLib == false) {
        return null;
    }

    // Create the destination image
    if (dst == null) {
        dst = op.createCompatibleDestImage(src, null);
    }

    BufferedImage retBI = 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 (lookupByteBI(src, dst, bt.getTable()) > 0) {
                retBI = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        AffineTransform xform = bOp.getTransform();
        bOp.getTransform().getMatrix(matrix);

        if (transformBI(src, dst, matrix,
                        bOp.getInterpolationType())>0) {
            retBI = dst;
        }
        break;

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

      default:
        break;
    }

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

    return retBI;
}
 
Example 5
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 6
Source File: ImagingLib.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static BufferedImage filter(BufferedImageOp op, BufferedImage src,
                                   BufferedImage dst)
{
    if (verbose) {
        System.out.println("in filter and op is "+op
                           + "bufimage is "+src+" and "+dst);
    }

    if (useLib == false) {
        return null;
    }

    // Create the destination image
    if (dst == null) {
        dst = op.createCompatibleDestImage(src, null);
    }

    BufferedImage retBI = 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 (lookupByteBI(src, dst, bt.getTable()) > 0) {
                retBI = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        AffineTransform xform = bOp.getTransform();
        bOp.getTransform().getMatrix(matrix);

        if (transformBI(src, dst, matrix,
                        bOp.getInterpolationType())>0) {
            retBI = dst;
        }
        break;

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

      default:
        break;
    }

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

    return retBI;
}
 
Example 7
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 8
Source File: ImagingLib.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public static BufferedImage filter(BufferedImageOp op, BufferedImage src,
                                   BufferedImage dst)
{
    if (verbose) {
        System.out.println("in filter and op is "+op
                           + "bufimage is "+src+" and "+dst);
    }

    if (useLib == false) {
        return null;
    }

    // Create the destination image
    if (dst == null) {
        dst = op.createCompatibleDestImage(src, null);
    }

    BufferedImage retBI = 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 (lookupByteBI(src, dst, bt.getTable()) > 0) {
                retBI = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        AffineTransform xform = bOp.getTransform();
        bOp.getTransform().getMatrix(matrix);

        if (transformBI(src, dst, matrix,
                        bOp.getInterpolationType())>0) {
            retBI = dst;
        }
        break;

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

      default:
        break;
    }

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

    return retBI;
}
 
Example 9
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 10
Source File: ImagingLib.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
public static BufferedImage filter(BufferedImageOp op, BufferedImage src,
                                   BufferedImage dst)
{
    if (verbose) {
        System.out.println("in filter and op is "+op
                           + "bufimage is "+src+" and "+dst);
    }

    if (useLib == false) {
        return null;
    }

    // Create the destination image
    if (dst == null) {
        dst = op.createCompatibleDestImage(src, null);
    }

    BufferedImage retBI = 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 (lookupByteBI(src, dst, bt.getTable()) > 0) {
                retBI = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        AffineTransform xform = bOp.getTransform();
        bOp.getTransform().getMatrix(matrix);

        if (transformBI(src, dst, matrix,
                        bOp.getInterpolationType())>0) {
            retBI = dst;
        }
        break;

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

      default:
        break;
    }

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

    return retBI;
}
 
Example 11
Source File: ImagingLib.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static BufferedImage filter(BufferedImageOp op, BufferedImage src,
                                   BufferedImage dst)
{
    if (verbose) {
        System.out.println("in filter and op is "+op
                           + "bufimage is "+src+" and "+dst);
    }

    if (useLib == false) {
        return null;
    }

    // Create the destination image
    if (dst == null) {
        dst = op.createCompatibleDestImage(src, null);
    }

    BufferedImage retBI = 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 (lookupByteBI(src, dst, bt.getTable()) > 0) {
                retBI = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        AffineTransform xform = bOp.getTransform();
        bOp.getTransform().getMatrix(matrix);

        if (transformBI(src, dst, matrix,
                        bOp.getInterpolationType())>0) {
            retBI = dst;
        }
        break;

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

      default:
        break;
    }

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

    return retBI;
}
 
Example 12
Source File: ImagingLib.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public static BufferedImage filter(BufferedImageOp op, BufferedImage src,
                                   BufferedImage dst)
{
    if (verbose) {
        System.out.println("in filter and op is "+op
                           + "bufimage is "+src+" and "+dst);
    }

    if (useLib == false) {
        return null;
    }

    // Create the destination image
    if (dst == null) {
        dst = op.createCompatibleDestImage(src, null);
    }

    BufferedImage retBI = 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 (lookupByteBI(src, dst, bt.getTable()) > 0) {
                retBI = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        AffineTransform xform = bOp.getTransform();
        bOp.getTransform().getMatrix(matrix);

        if (transformBI(src, dst, matrix,
                        bOp.getInterpolationType())>0) {
            retBI = dst;
        }
        break;

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

      default:
        break;
    }

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

    return retBI;
}
 
Example 13
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 14
Source File: ImagingLib.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static BufferedImage filter(BufferedImageOp op, BufferedImage src,
                                   BufferedImage dst)
{
    if (verbose) {
        System.out.println("in filter and op is "+op
                           + "bufimage is "+src+" and "+dst);
    }

    if (useLib == false) {
        return null;
    }

    // Create the destination image
    if (dst == null) {
        dst = op.createCompatibleDestImage(src, null);
    }

    BufferedImage retBI = 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 (lookupByteBI(src, dst, bt.getTable()) > 0) {
                retBI = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        AffineTransform xform = bOp.getTransform();
        bOp.getTransform().getMatrix(matrix);

        if (transformBI(src, dst, matrix,
                        bOp.getInterpolationType())>0) {
            retBI = dst;
        }
        break;

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

      default:
        break;
    }

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

    return retBI;
}
 
Example 15
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 16
Source File: ImagingLib.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public static BufferedImage filter(BufferedImageOp op, BufferedImage src,
                                   BufferedImage dst)
{
    if (verbose) {
        System.out.println("in filter and op is "+op
                           + "bufimage is "+src+" and "+dst);
    }

    if (useLib == false) {
        return null;
    }

    // Create the destination image
    if (dst == null) {
        dst = op.createCompatibleDestImage(src, null);
    }

    BufferedImage retBI = 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 (lookupByteBI(src, dst, bt.getTable()) > 0) {
                retBI = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        AffineTransform xform = bOp.getTransform();
        bOp.getTransform().getMatrix(matrix);

        if (transformBI(src, dst, matrix,
                        bOp.getInterpolationType())>0) {
            retBI = dst;
        }
        break;

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

      default:
        break;
    }

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

    return retBI;
}
 
Example 17
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;
}
 
Example 18
Source File: ImagingLib.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static BufferedImage filter(BufferedImageOp op, BufferedImage src,
                                   BufferedImage dst)
{
    if (verbose) {
        System.out.println("in filter and op is "+op
                           + "bufimage is "+src+" and "+dst);
    }

    if (useLib == false) {
        return null;
    }

    // Create the destination image
    if (dst == null) {
        dst = op.createCompatibleDestImage(src, null);
    }

    BufferedImage retBI = 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 (lookupByteBI(src, dst, bt.getTable()) > 0) {
                retBI = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        AffineTransform xform = bOp.getTransform();
        bOp.getTransform().getMatrix(matrix);

        if (transformBI(src, dst, matrix,
                        bOp.getInterpolationType())>0) {
            retBI = dst;
        }
        break;

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

      default:
        break;
    }

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

    return retBI;
}
 
Example 19
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 20
Source File: ImagingLib.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static BufferedImage filter(BufferedImageOp op, BufferedImage src,
                                   BufferedImage dst)
{
    if (verbose) {
        System.out.println("in filter and op is "+op
                           + "bufimage is "+src+" and "+dst);
    }

    if (useLib == false) {
        return null;
    }

    // Create the destination image
    if (dst == null) {
        dst = op.createCompatibleDestImage(src, null);
    }

    BufferedImage retBI = 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 (lookupByteBI(src, dst, bt.getTable()) > 0) {
                retBI = dst;
            }
        }
        break;

      case AFFINE_OP:
        AffineTransformOp bOp = (AffineTransformOp) op;
        double[] matrix = new double[6];
        AffineTransform xform = bOp.getTransform();
        bOp.getTransform().getMatrix(matrix);

        if (transformBI(src, dst, matrix,
                        bOp.getInterpolationType())>0) {
            retBI = dst;
        }
        break;

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

      default:
        break;
    }

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

    return retBI;
}