本文整理汇总了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;
}
示例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);
}
}
示例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());
}
示例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);
}
示例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));
}
}