当前位置: 首页>>代码示例>>Java>>正文


Java RasterOp类代码示例

本文整理汇总了Java中java.awt.image.RasterOp的典型用法代码示例。如果您正苦于以下问题:Java RasterOp类的具体用法?Java RasterOp怎么用?Java RasterOp使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RasterOp类属于java.awt.image包,在下文中一共展示了RasterOp类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runTest

import java.awt.image.RasterOp; //导入依赖的package包/类
public void runTest(Object ctx, int numReps) {
    ImageOpTests.Context ictx = (ImageOpTests.Context)ctx;
    RasterOp op = ictx.rasterOp;
    Raster src = ictx.rasSrc;
    WritableRaster dst = ictx.rasDst;
    if (ictx.touchSrc) {
        Graphics gSrc = ictx.bufSrc.getGraphics();
        do {
            gSrc.fillRect(0, 0, 1, 1);
            op.filter(src, dst);
        } while (--numReps > 0);
    } else {
        do {
            op.filter(src, dst);
        } while (--numReps > 0);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:ImageTests.java

示例2: main

import java.awt.image.RasterOp; //导入依赖的package包/类
public static void main(String[] args) {

        byte[][] data = new byte[1][10];
        ByteLookupTable lut = new ByteLookupTable(0, data);
        RasterOp op = new LookupOp(lut, null);

        int[] bandOffsets = {0};
        Point location = new Point(0, 0);
        DataBuffer db = new DataBufferByte(10 * 10);
        SampleModel sm = new PixelInterleavedSampleModel(DataBuffer.TYPE_BYTE,
                                                         10, 10, 1, 10,
                                                         bandOffsets);

        Raster src = Raster.createRaster(sm, db, location);

        op.filter(src, null); // this used to result in NullPointerException
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:RasterOpNullDestinationRasterTest.java

示例3: filter

import java.awt.image.RasterOp; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:59,代码来源:ImagingLib.java

示例4: filter

import java.awt.image.RasterOp; //导入依赖的package包/类
public static WritableRaster filter(RasterOp op, Raster src,
                                    WritableRaster dst) {
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:ImagingLib.java


注:本文中的java.awt.image.RasterOp类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。