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


Java GraphicsUtil.is_INT_PACK_Data方法代码示例

本文整理汇总了Java中org.apache.batik.ext.awt.image.GraphicsUtil.is_INT_PACK_Data方法的典型用法代码示例。如果您正苦于以下问题:Java GraphicsUtil.is_INT_PACK_Data方法的具体用法?Java GraphicsUtil.is_INT_PACK_Data怎么用?Java GraphicsUtil.is_INT_PACK_Data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.batik.ext.awt.image.GraphicsUtil的用法示例。


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

示例1: copyData

import org.apache.batik.ext.awt.image.GraphicsUtil; //导入方法依赖的package包/类
public WritableRaster copyData(WritableRaster wr) {
    int tx0 = getXTile(wr.getMinX());
    int ty0 = getYTile(wr.getMinY());
    int tx1 = getXTile(wr.getMinX()+wr.getWidth() -1);
    int ty1 = getYTile(wr.getMinY()+wr.getHeight()-1);

    final boolean is_INT_PACK = 
        GraphicsUtil.is_INT_PACK_Data(getSampleModel(), false);

    for (int y=ty0; y<=ty1; y++)
        for (int x=tx0; x<=tx1; x++) {
            Raster r = getTile(x, y);
            if (is_INT_PACK)
                GraphicsUtil.copyData_INT_PACK(r, wr);
            else
                GraphicsUtil.copyData_FALLBACK(r, wr);
        }

    return wr;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:21,代码来源:FloodRed.java

示例2: copyToRaster

import org.apache.batik.ext.awt.image.GraphicsUtil; //导入方法依赖的package包/类
/**
 * Copies data from this images tile grid into wr.  wr may
 * extend outside the bounds of this image in which case the
 * data in wr outside the bounds will not be touched.
 * @param wr Raster to fill with image data.
 */
public void copyToRaster(WritableRaster wr) {
    int tx0 = getXTile(wr.getMinX());
    int ty0 = getYTile(wr.getMinY());
    int tx1 = getXTile(wr.getMinX()+wr.getWidth() -1);
    int ty1 = getYTile(wr.getMinY()+wr.getHeight()-1);

    if (tx0 < minTileX) tx0 = minTileX;
    if (ty0 < minTileY) ty0 = minTileY;

    if (tx1 >= minTileX+numXTiles) tx1 = minTileX+numXTiles-1;
    if (ty1 >= minTileY+numYTiles) ty1 = minTileY+numYTiles-1;

    final boolean is_INT_PACK =
        GraphicsUtil.is_INT_PACK_Data(getSampleModel(), false);

    for (int y=ty0; y<=ty1; y++)
        for (int x=tx0; x<=tx1; x++) {
            Raster r = getTile(x, y);
            if (is_INT_PACK)
                GraphicsUtil.copyData_INT_PACK(r, wr);
            else
                GraphicsUtil.copyData_FALLBACK(r, wr);
        }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:31,代码来源:AbstractRed.java

示例3: fixAlpha

import org.apache.batik.ext.awt.image.GraphicsUtil; //导入方法依赖的package包/类
public void fixAlpha(BufferedImage bi) {
    if ((!bi.getColorModel().hasAlpha()) ||
        (!bi.isAlphaPremultiplied()))
        // No need to fix alpha if it isn't premultiplied...
        return;
    if (GraphicsUtil.is_INT_PACK_Data(bi.getSampleModel(), true))
        fixAlpha_INT_PACK(bi.getRaster());
    else
        fixAlpha_FALLBACK(bi.getRaster());
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:11,代码来源:ConvolveMatrixRable8Bit.java

示例4: getZeroRecter

import org.apache.batik.ext.awt.image.GraphicsUtil; //导入方法依赖的package包/类
public static ZeroRecter getZeroRecter(WritableRaster wr) {
    if (GraphicsUtil.is_INT_PACK_Data(wr.getSampleModel(), false))
        return new ZeroRecter_INT_PACK(wr);
    else
        return new ZeroRecter(wr);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:7,代码来源:PadRed.java

示例5: TileRed

import org.apache.batik.ext.awt.image.GraphicsUtil; //导入方法依赖的package包/类
public TileRed(RenderedImage tile, 
               Rectangle tiledRegion,
               int xStep, int yStep,
               RenderingHints hints) {
    if(tiledRegion == null){
        throw new IllegalArgumentException();
    }

    if(tile == null){
        throw new IllegalArgumentException();
    }

    // org.apache.batik.test.gvt.ImageDisplay.showImage("Tile: ", tile);
    this.tiledRegion  = tiledRegion;
    this.xStep        = xStep;
    this.yStep        = yStep;
    this.hints        = hints;

    SampleModel sm = fixSampleModel(tile, xStep, yStep, 
                                    tiledRegion.width,
                                    tiledRegion.height);
    ColorModel cm  = tile.getColorModel();

    double smSz   = AbstractTiledRed.getDefaultTileSize();
    smSz = smSz*smSz;

    double stepSz = (xStep*(double)yStep);
    // be prepaired to grow the default tile size quite a bit if
    // it means the image tile will fit in it...
    if (16.1*smSz > stepSz) {
        int xSz = xStep;
        int ySz = yStep;

        // If the pattern size is small then have multiple copies
        // in our tile.
        if (4*stepSz <= smSz) {
            int mult = (int)Math.ceil(Math.sqrt(smSz/stepSz));
            xSz *= mult;
            ySz *= mult;
        }
        // System.out.println("Using Raster for pattern");
        sm = sm.createCompatibleSampleModel(xSz, ySz);
        raster = Raster.createWritableRaster
            (sm, new Point(tile.getMinX(), tile.getMinY()));
    }
    
    is_INT_PACK = GraphicsUtil.is_INT_PACK_Data(sm, false);
    // System.out.println("Is INT PACK: " + is_INT_PACK);

    // Initialize our base class We set our bounds be we will
    // respond with data for any area we cover.  This is needed
    // because the userRegion passed into PatterPaintContext
    // doesn't account for stroke So we use that as a basis but
    // when the context asks us for stuff outside that region we
    // complie.
    init((CachableRed)null, tiledRegion, cm, sm, 
         tile.getMinX(), tile.getMinY(), null);

    if (raster != null) {
        WritableRaster fromRaster = raster.createWritableChild
            (tile.getMinX(), tile.getMinY(), 
             xStep, yStep, tile.getMinX(), tile.getMinY(), null);

        // Fill one 'tile' of the input....
        fillRasterFrom(fromRaster, tile);
        fillOutRaster(raster);
    }
    else {
        this.tile        = new TileCacheRed(GraphicsUtil.wrap(tile));
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:72,代码来源:TileRed.java


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