本文整理汇总了Java中javax.media.jai.PlanarImage.XToTileX方法的典型用法代码示例。如果您正苦于以下问题:Java PlanarImage.XToTileX方法的具体用法?Java PlanarImage.XToTileX怎么用?Java PlanarImage.XToTileX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.media.jai.PlanarImage
的用法示例。
在下文中一共展示了PlanarImage.XToTileX方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jumpPixels
import javax.media.jai.PlanarImage; //导入方法依赖的package包/类
public void jumpPixels(int num) {
int jumpX = x + num;
if (jumpX < bounds.x || jumpX > lastX) {
// Jumped outside the image.
throw new IndexOutOfBoundsException(JaiI18N.getString("RectIterFallback0"));
}
x = jumpX;
localX += num;
if (x < prevXBoundary || x > nextXBoundary) {
this.tileX = PlanarImage.XToTileX(x,
tileGridXOffset,
tileWidth);
setTileXBounds();
setDataBuffer();
}
}
示例2: jumpPixels
import javax.media.jai.PlanarImage; //导入方法依赖的package包/类
public void jumpPixels(int num) {
int jumpX = x + num;
if (jumpX < bounds.x || jumpX > lastX) {
// Jumped outside the image.
throw new IndexOutOfBoundsException(JaiI18N.getString("RectIterFallback0"));
}
x = jumpX;
offset += num*pixelStride;
if (x < prevXBoundary || x > nextXBoundary) {
this.tileX = PlanarImage.XToTileX(x,
tileGridXOffset,
tileWidth);
setTileXBounds();
setDataBuffer();
}
}
示例3: RectIterFallback
import javax.media.jai.PlanarImage; //导入方法依赖的package包/类
public RectIterFallback(RenderedImage im, Rectangle bounds) {
this.im = im;
this.bounds = bounds;
this.sampleModel = im.getSampleModel();
this.numBands = sampleModel.getNumBands();
this.tileGridXOffset = im.getTileGridXOffset();
this.tileGridYOffset = im.getTileGridYOffset();
this.tileWidth = im.getTileWidth();
this.tileHeight = im.getTileHeight();
this.startTileX = PlanarImage.XToTileX(bounds.x,
tileGridXOffset,
tileWidth);
this.startTileY = PlanarImage.YToTileY(bounds.y,
tileGridYOffset,
tileHeight);
this.tileX = startTileX;
this.tileY = startTileY;
this.lastX = bounds.x + bounds.width - 1;
this.lastY = bounds.y + bounds.height - 1;
localX = x = bounds.x;
localY = y = bounds.y;
b = 0;
setTileXBounds();
setTileYBounds();
setDataBuffer();
}
示例4: jumpPixels
import javax.media.jai.PlanarImage; //导入方法依赖的package包/类
public void jumpPixels(int num) {
x += num;
localX += num;
if (x < tileXStart || x > tileXEnd) {
this.tileX = PlanarImage.XToTileX(x,
tileGridXOffset,
tileWidth);
setTileXBounds();
setDataBuffer();
}
}
示例5: getRaster
import javax.media.jai.PlanarImage; //导入方法依赖的package包/类
private Raster getRaster(int x, int y) {
int xt = PlanarImage.XToTileX(x, 0, tileWidth);
int yt = PlanarImage.YToTileY(y, 0, tileHeight);
Raster raster = getImage().getTile(xt, yt);
return raster;
}
示例6: RandomIterFallback
import javax.media.jai.PlanarImage; //导入方法依赖的package包/类
public RandomIterFallback(RenderedImage im, Rectangle bounds) {
this.im = im;
Rectangle imBounds = new Rectangle(im.getMinX(), im.getMinY(),
im.getWidth(), im.getHeight());
this.boundsRect = imBounds.intersection(bounds);
this.sampleModel = im.getSampleModel();
int x = boundsRect.x;
int y = boundsRect.y;
int width = boundsRect.width;
int height = boundsRect.height;
this.boundsX = boundsRect.x;
this.boundsY = boundsRect.y;
this.xTiles = new int[width];
this.yTiles = new int[height];
int tileWidth = im.getTileWidth();
int tileGridXOffset = im.getTileGridXOffset();
int minTileX = PlanarImage.XToTileX(x, tileGridXOffset, tileWidth);
int offsetX =
x - PlanarImage.tileXToX(minTileX, tileGridXOffset, tileWidth);
int tileX = minTileX;
for (int i = 0; i < width; i++) {
xTiles[i] = tileX;
++offsetX;
if (offsetX == tileWidth) {
++tileX;
offsetX = 0;
}
}
int tileHeight = im.getTileHeight();
int tileGridYOffset = im.getTileGridYOffset();
int minTileY = PlanarImage.YToTileY(y, tileGridYOffset, tileHeight);
int offsetY =
y - PlanarImage.tileYToY(minTileY, tileGridYOffset, tileHeight);
int tileY = minTileY;
for (int i = 0; i < height; i++) {
yTiles[i] = tileY;
++offsetY;
if (offsetY == tileHeight) {
++tileY;
offsetY = 0;
}
}
}
示例7: RookIterFallback
import javax.media.jai.PlanarImage; //导入方法依赖的package包/类
public RookIterFallback(RenderedImage im, Rectangle bounds) {
this.im = im;
this.bounds = bounds;
this.sampleModel = im.getSampleModel();
this.numBands = sampleModel.getNumBands();
this.tileGridXOffset = im.getTileGridXOffset();
this.tileGridYOffset = im.getTileGridYOffset();
this.tileWidth = im.getTileWidth();
this.tileHeight = im.getTileHeight();
this.startTileX = PlanarImage.XToTileX(bounds.x,
tileGridXOffset,
tileWidth);
this.endTileX = PlanarImage.XToTileX(bounds.x + bounds.width - 1,
tileGridXOffset,
tileWidth);
this.startTileY = PlanarImage.YToTileY(bounds.y,
tileGridYOffset,
tileHeight);
this.endTileY = PlanarImage.YToTileY(bounds.y + bounds.height - 1,
tileGridYOffset,
tileHeight);
this.tileX = startTileX;
this.tileY = startTileY;
this.firstX = bounds.x;
this.firstY = bounds.y;
this.lastX = bounds.x + bounds.width - 1;
this.lastY = bounds.y + bounds.height - 1;
x = bounds.x;
y = bounds.y;
b = 0;
setTileXBounds();
setTileYBounds();
setDataBuffer();
}
示例8: getRasterTile
import javax.media.jai.PlanarImage; //导入方法依赖的package包/类
private Raster getRasterTile(PlanarImage image, int pixelX, int pixelY) {
final int tileX = image.XToTileX(pixelX);
final int tileY = image.YToTileY(pixelY);
return image.getTile(tileX, tileY);
}