java.awt.image.Raster.createTranslatedChild()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中java.awt.image.Raster.createTranslatedChild方法的一些代码示例,展示了Raster.createTranslatedChild的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Raster.createTranslatedChild方法的具体详情如下:
包路径:java.awt.image.Raster
类名称:Raster
方法名:createTranslatedChild

Raster.createTranslatedChild介绍

暂无

代码示例

代码示例来源:origin: geotools/geotools

@Override
public Raster computeTile(int tileX, int tileY) {
  int posx = tileX * tileWidth + tileGridXOffset;
  int posy = tileY * tileHeight + tileGridYOffset;
  ImageInTile candidate =
      sources.stream()
          .filter(it -> it.posx == posx && it.posy == posy)
          .findFirst()
          .orElse(null);
  if (candidate != null) {
    return candidate.image.getData().createTranslatedChild(posx, posy);
  }
  // not inside the available grid, build a white cell then
  WritableRaster dest =
      createWritableRaster(
          sampleModel, new Point(tileXToX(tileX), tileYToY(tileY)));
  BufferedImage bi = new BufferedImage(getColorModel(), dest, false, null);
  Graphics2D g2D = (Graphics2D) bi.getGraphics();
  g2D.setColor(Color.WHITE);
  g2D.fillRect(0, 0, bi.getWidth(), bi.getHeight());
  g2D.dispose();
  return dest;
}

代码示例来源:origin: AntiqueAtlasTeam/AntiqueAtlas

@Override
public Raster getData(Rectangle rect) {
  if(rect.height > scanBuffer.getHeight())
    return null;
      
  if(rect.y >= bufY+scanBuffer.getHeight() || rect.y + rect.height <= bufY) {
    bufY = rect.y;
    redrawToBuffer();
  }
  rowListener.accept(rect.y-bufY);
  Raster r = scanBuffer.getData(new Rectangle(rect.x, rect.y-bufY, rect.width, rect.height));
  
  r = r.createTranslatedChild(r.getMinX(), r.getMinY()+bufY);
  return r;
}

代码示例来源:origin: org.apache.xmlgraphics/xmlgraphics-commons

public Raster getData() {
  Raster r = bi.getData();
  return r.createTranslatedChild(getMinX(), getMinY());
}

代码示例来源:origin: apache/batik

public Raster getData() {
  Raster r = bi.getData();
  return r.createTranslatedChild(getMinX(), getMinY());
}

代码示例来源:origin: org.apache.xmlgraphics/batik-awt-util

public Raster getData() {
  Raster r = bi.getData();
  return r.createTranslatedChild(getMinX(), getMinY());
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

public Raster getData() {
  Raster r = bi.getData();
  return r.createTranslatedChild(getMinX(), getMinY());
}

代码示例来源:origin: apache/batik

public Raster getTile(int tileX, int tileY) {
  Raster r = getSource().getTile(tileX, tileY);
  return r.createTranslatedChild(r.getMinX()+deltaX,
                  r.getMinY()+deltaY);
}

代码示例来源:origin: org.apache.xmlgraphics/batik-awt-util

public Raster getData() {
  Raster r = getSource().getData();
  return r.createTranslatedChild(r.getMinX()+deltaX,
                  r.getMinY()+deltaY);
}

代码示例来源:origin: org.apache.xmlgraphics/batik-awt-util

public Raster getTile(int tileX, int tileY) {
  Raster r = getSource().getTile(tileX, tileY);
  return r.createTranslatedChild(r.getMinX()+deltaX,
                  r.getMinY()+deltaY);
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

public Raster getTile(int tileX, int tileY) {
  Raster r = getSource().getTile(tileX, tileY);
  return r.createTranslatedChild(r.getMinX()+deltaX,
                  r.getMinY()+deltaY);
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

public Raster getData() {
  Raster r = getSource().getData();
  return r.createTranslatedChild(r.getMinX()+deltaX,
                  r.getMinY()+deltaY);
}

代码示例来源:origin: apache/batik

public Raster getData() {
  Raster r = getSource().getData();
  return r.createTranslatedChild(r.getMinX()+deltaX,
                  r.getMinY()+deltaY);
}

代码示例来源:origin: geosolutions-it/jai-ext

/**
 * Get a tile.
 *
 * @param tileX The X index of the tile.
 * @param tileY The Y index of the tile.
 */
public Raster getTile(int tileX, int tileY) {
  Raster tile = getSource(0).getTile(tileX, tileY);
if (tile == null)
  return null;
return tile.createTranslatedChild(tileXToX(tileX), tileYToY(tileY));
}

代码示例来源:origin: org.apache.xmlgraphics/batik-awt-util

public Raster getData(Rectangle rect) {
  Rectangle r = (Rectangle)rect.clone();
  r.translate(-deltaX, -deltaY);
  Raster ret = getSource().getData(r);
  return ret.createTranslatedChild(ret.getMinX()+deltaX,
                   ret.getMinY()+deltaY);
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

public Raster getData(Rectangle rect) {
  Rectangle r = (Rectangle)rect.clone();
  r.translate(-deltaX, -deltaY);
  Raster ret = getSource().getData(r);
  return ret.createTranslatedChild(ret.getMinX()+deltaX,
                   ret.getMinY()+deltaY);
}

代码示例来源:origin: apache/batik

public Raster getData(Rectangle rect) {
  Rectangle r = (Rectangle)rect.clone();
  r.translate(-deltaX, -deltaY);
  Raster ret = getSource().getData(r);
  return ret.createTranslatedChild(ret.getMinX()+deltaX,
                   ret.getMinY()+deltaY);
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

public Raster getData(Rectangle rect) {
  Rectangle r = (Rectangle)rect.clone();
  if ( ! r.intersects(getBounds()) )
    return null;
  r = r.intersection(getBounds());
  r.translate(-getMinX(), - getMinY());
  Raster ret = bi.getData(r);
  return ret.createTranslatedChild(ret.getMinX()+getMinX(),
                   ret.getMinY()+getMinY());
}

代码示例来源:origin: org.apache.xmlgraphics/xmlgraphics-commons

public Raster getData(Rectangle rect) {
  Rectangle r = (Rectangle)rect.clone();
  if (!r.intersects(getBounds())) {
    return null;
  }
  r = r.intersection(getBounds());
  r.translate(-getMinX(), -getMinY());
  Raster ret = bi.getData(r);
  return ret.createTranslatedChild(ret.getMinX() + getMinX(),
                   ret.getMinY() + getMinY());
}

代码示例来源:origin: org.apache.xmlgraphics/batik-awt-util

public Raster getData(Rectangle rect) {
  Rectangle r = (Rectangle)rect.clone();
  if ( ! r.intersects(getBounds()) )
    return null;
  r = r.intersection(getBounds());
  r.translate(-getMinX(), - getMinY());
  Raster ret = bi.getData(r);
  return ret.createTranslatedChild(ret.getMinX()+getMinX(),
                   ret.getMinY()+getMinY());
}

代码示例来源:origin: apache/batik

public Raster getData(Rectangle rect) {
  Rectangle r = (Rectangle)rect.clone();
  if ( ! r.intersects(getBounds()) )
    return null;
  r = r.intersection(getBounds());
  r.translate(-getMinX(), - getMinY());
  Raster ret = bi.getData(r);
  return ret.createTranslatedChild(ret.getMinX()+getMinX(),
                   ret.getMinY()+getMinY());
}

相关文章