gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-27 02:31:05 28 4
gpt4 key购买 nike

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

WritableRenderedImage.getWidth介绍

暂无

代码示例

代码示例来源:origin: it.geosolutions.jaiext.iterators/jt-iterators

/**
 * Constructs and returns an instance of WritableRandomIter suitable for iterating over the given bounding rectangle within the given
 * WritableRenderedImage source. If the bounds parameter is null, the entire image will be used.
 * 
 * @param im a WritableRenderedImage source.
 * @param bounds the bounding Rectangle for the iterator, or null.
 * @return a WritableRandomIter allowing read/write access to the source.
 */
public static WritableRandomIter createWritable(WritableRenderedImage im, Rectangle bounds) {
  if (bounds == null) {
    bounds = new Rectangle(im.getMinX(), im.getMinY(), im.getWidth(), im.getHeight());
  }
  return new WritableRandomIterFallback(im, bounds);
}

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

/**
 * Constructs and returns an instance of WritableRandomIter suitable for iterating over the given bounding rectangle within the given
 * WritableRenderedImage source. If the bounds parameter is null, the entire image will be used.
 * 
 * @param im a WritableRenderedImage source.
 * @param bounds the bounding Rectangle for the iterator, or null.
 * @return a WritableRandomIter allowing read/write access to the source.
 */
public static WritableRandomIter createWritable(WritableRenderedImage im, Rectangle bounds) {
  if (bounds == null) {
    bounds = new Rectangle(im.getMinX(), im.getMinY(), im.getWidth(), im.getHeight());
  }
  return new WritableRandomIterFallback(im, bounds);
}

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

public void runScriptWithBuilder(String script, String destVar, WritableRenderedImage destImage) 
    throws JiffleException {
  
  // Image bounds are taken from the destination image
  Rectangle imageBounds = new Rectangle(
      destImage.getMinX(), destImage.getMinY(),
      destImage.getWidth(), destImage.getHeight());
  
  // The world bounds are the unit rectangle
  Rectangle2D worldBounds = new Rectangle2D.Double(0, 0, 1, 1);
  
  CoordinateTransform transform = CoordinateTransforms.unitBounds(imageBounds);
  
  JiffleBuilder builder = new JiffleBuilder();
  
  // Set the processing area (world units)
  builder.worldAndNumPixels(worldBounds, destImage.getWidth(), destImage.getHeight());
  
  // Set the script and the destination image with its transform
  builder.script(script).dest(destVar, destImage, transform);
  
  // This executes the script and writes the results into destImage
  builder.run();
}
// docs end builder method

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

public void createRipplesImage(WritableRenderedImage destImg) {
  // image dimensions
  final int width = destImg.getWidth();
  final int height = destImg.getHeight();
  // first pixel coordinates
  int x = destImg.getMinX();
  int y = destImg.getMinY();
  // center pixel coordinates
  final int xc = x + destImg.getWidth() / 2;
  final int yc = y + destImg.getHeight() / 2;
  // constant term
  double C = Math.PI * 8;
  WritableRectIter iter = RectIterFactory.createWritable(destImg, null);
  do {
    double dy = ((double) (y - yc)) / yc;
    do {
      double dx = ((double) (x - xc)) / xc;
      double d = Math.sqrt(dx * dx + dy * dy);
      iter.setSample(Math.sin(d * C));
      x++ ;
    } while (!iter.nextPixelDone());
    x = destImg.getMinX();
    y++;
    iter.startPixels();
  } while (!iter.nextLineDone());
}
// docs-end-method

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

destImage.getWidth(), destImage.getHeight());
runtimeObj.setWorldByNumPixels(worldBounds, destImage.getWidth(), destImage.getHeight());

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

} else if (input.getMinX()   != output.getMinX()  ||
      input.getMinY()   != output.getMinY()  ||
      input.getWidth()  != output.getWidth() ||
      input.getHeight() != output.getHeight())

代码示例来源:origin: Geomatys/geotoolkit

|| writableRI.getWidth() != areaIterateMaxX-areaIterateMinX//longueuriteration
|| renderedImage.getWidth()  != writableRI.getWidth()
|| renderedImage.getHeight() != writableRI.getHeight()
|| rimtx != wrimtx || rimty != wrimty

代码示例来源:origin: Geomatys/geotoolkit

|| renderedImage.getWidth()  != writableRI.getWidth()
|| renderedImage.getHeight() != writableRI.getHeight()
|| renderedImage.getSampleModel().getNumBands() != writableRI.getSampleModel().getNumBands())

代码示例来源:origin: Geomatys/geotoolkit

final int width  = image.getWidth();
final int height = image.getHeight();
final Rectangle bounds = new Rectangle(xmin, ymin, width, height);

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com