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


Java PlanarImage.XToTileX方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:19,代码来源:RectIterFallback.java

示例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();
    }
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:20,代码来源:RectIterCSM.java

示例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();
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:34,代码来源:RectIterFallback.java

示例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();
    }
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:13,代码来源:RookIterFallback.java

示例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;
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:7,代码来源:TiledImageWriter.java

示例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;
        }
    }
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:51,代码来源:RandomIterFallback.java

示例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();
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:42,代码来源:RookIterFallback.java

示例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);
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:6,代码来源:SpectrumTopComponent.java


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