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


Java RenderedOp.dispose方法代码示例

本文整理汇总了Java中javax.media.jai.RenderedOp.dispose方法的典型用法代码示例。如果您正苦于以下问题:Java RenderedOp.dispose方法的具体用法?Java RenderedOp.dispose怎么用?Java RenderedOp.dispose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.media.jai.RenderedOp的用法示例。


在下文中一共展示了RenderedOp.dispose方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: graphicFillLineString

import javax.media.jai.RenderedOp; //导入方法依赖的package包/类
private static void graphicFillLineString(final LineSymbolizer symbolizer, final Shape shape, final Image image, final float size, final double opacity) {
    Double width = new Double(Math.max(1, shape.getBounds2D().getWidth()));
    Double height = new Double(Math.max(1, shape.getBounds2D().getHeight()));
    Double shapeHeight = new Double(size);
    double factor = shapeHeight.doubleValue() / image.getHeight(null);
    Double shapeWidth = new Double(image.getWidth(null) * factor);
    AffineTransform transform = AffineTransform.getTranslateInstance(shape.getBounds2D().getMinX(), shape.getBounds2D().getMinY());
    Image scaledImage = image.getScaledInstance(shapeWidth.intValue(), shapeHeight.intValue(), Image.SCALE_FAST);
    BufferedImage buff = new BufferedImage(shapeWidth.intValue(), shapeHeight.intValue(), BufferedImage.TYPE_INT_ARGB);
    buff.getGraphics().drawImage(scaledImage, 0, 0, null);
    ParameterBlock p = new ParameterBlock();
    p.addSource(buff);
    p.add(width.intValue());
    p.add(height.intValue());
    RenderedOp im = JAI.create("pattern", p);//$NON-NLS-1$
    BufferedImage bufferedImage = im.getAsBufferedImage();
    glDrawImage(bufferedImage, transform, null);
    bufferedImage.flush();
    im.dispose();
    scaledImage.flush();
    buff.flush();
}
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:23,代码来源:RenderGL11Util.java

示例2: drawGraphicFillPolygon

import javax.media.jai.RenderedOp; //导入方法依赖的package包/类
private static void drawGraphicFillPolygon(Image image, float size, Graphics2D graphics, double opacity, double widthSymbol, double heightSymbol, double offsetYSymbol, double offsetXSymbol) {
    Double shapeHeight = new Double(size);
    double factor = shapeHeight / image.getHeight(null);
    Double shapeWidth = new Double(Math.max(image.getWidth(null) * factor, 1));
    AffineTransform transform = AffineTransform.getTranslateInstance(offsetXSymbol, offsetYSymbol);
    Image scaledImage = image.getScaledInstance(shapeWidth.intValue(), shapeHeight.intValue(), Image.SCALE_FAST);
    BufferedImage buff = new BufferedImage(shapeWidth.intValue(), shapeHeight.intValue(), BufferedImage.TYPE_INT_ARGB);
    buff.getGraphics().drawImage(scaledImage, 0, 0, null);
    ParameterBlock p = new ParameterBlock();
    p.addSource(buff);
    p.add((int) widthSymbol);
    p.add((int) heightSymbol);
    RenderedOp im = JAI.create("pattern", p);//$NON-NLS-1$
    BufferedImage bufferedImage = im.getAsBufferedImage();
    graphics.drawImage(bufferedImage, transform, null);
    bufferedImage.flush();
    im.dispose();
    scaledImage.flush();
    buff.flush();
}
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:21,代码来源:LayerStylesPanel.java

示例3: scale

import javax.media.jai.RenderedOp; //导入方法依赖的package包/类
public BufferedImage scale(final URL resource, final float factor) throws IOException {
  final IResourceReference resourceReference = this.factory.create(resource);
  try (InputStream stream = this.handler.openInputStream(resourceReference)) {
    final RenderedOp scaledRenderedOp = ImageContainerUtilities.scale(createRenderOp(stream), factor);
    try {
      final BufferedImage image = scaledRenderedOp.getAsBufferedImage();
      return image;
    } finally {
      scaledRenderedOp.dispose();
    }
  }
}
 
开发者ID:AndreasWBartels,项目名称:libraries,代码行数:13,代码来源:ImageReader.java

示例4: readBufferedImage

import javax.media.jai.RenderedOp; //导入方法依赖的package包/类
public BufferedImage readBufferedImage(final InputStream inputStream) throws IOException {
  try {
    final RenderedOp renderedOp = createRenderOp(inputStream);
    try {
      return renderedOp.getAsBufferedImage();
    } finally {
      renderedOp.dispose();
    }
  } catch (final RuntimeException exception) {
    throw new IOException(exception);
  }
}
 
开发者ID:AndreasWBartels,项目名称:libraries,代码行数:13,代码来源:ImageReader.java

示例5: graphicFillLineString

import javax.media.jai.RenderedOp; //导入方法依赖的package包/类
private static void graphicFillLineString(Shape shape, Image image,
        float size, Graphics2D graphics, double opacity) {
    Double width = new Double(Math.max(1, shape.getBounds2D().getWidth()));
    Double height = new Double(
            Math.max(1, shape.getBounds2D().getHeight()));
    Double shapeHeight = new Double(size);
    double factor = shapeHeight.doubleValue() / image.getHeight(null);
    Double shapeWidth = new Double(image.getWidth(null) * factor);
    AffineTransform transform = AffineTransform.getTranslateInstance(
            shape.getBounds2D().getMinX(), shape.getBounds2D().getMinY());
    Image scaledImage = image.getScaledInstance(shapeWidth.intValue(),
            shapeHeight.intValue(), Image.SCALE_FAST);
    BufferedImage buff = new BufferedImage(shapeWidth.intValue(),
            shapeHeight.intValue(), BufferedImage.TYPE_INT_ARGB);
    buff.getGraphics().drawImage(scaledImage, 0, 0, null);
    ParameterBlock p = new ParameterBlock();
    p.addSource(buff);
    p.add(width.intValue());
    p.add(height.intValue());
    RenderedOp im = JAI.create("pattern", p);//$NON-NLS-1$
    BufferedImage bufferedImage = im.getAsBufferedImage();
    graphics.drawImage(bufferedImage, transform, null);
    bufferedImage.flush();
    im.dispose();
    scaledImage.flush();
    buff.flush();
}
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:28,代码来源:RenderUtil.java

示例6: graphicFillPolygon

import javax.media.jai.RenderedOp; //导入方法依赖的package包/类
private static void graphicFillPolygon(Shape shape, Image image, float size,
        Graphics2D graphics, double opacity) {
    Double width = new Double(Math.max(1, shape.getBounds2D().getWidth()));
    Double height = new Double(
            Math.max(1, shape.getBounds2D().getHeight()));
    Double shapeHeight = new Double(size);
    double factor = shapeHeight / image.getHeight(null);
    Double shapeWidth = new Double(
            Math.max(image.getWidth(null) * factor, 1));
    AffineTransform transform = AffineTransform.getTranslateInstance(
            shape.getBounds2D().getMinX(), shape.getBounds2D().getMinY());
    Image scaledImage = image.getScaledInstance(shapeWidth.intValue(),
            shapeHeight.intValue(), Image.SCALE_FAST);
    BufferedImage buff = new BufferedImage(shapeWidth.intValue(),
            shapeHeight.intValue(), BufferedImage.TYPE_INT_ARGB);
    buff.getGraphics().drawImage(scaledImage, 0, 0, null);
    ParameterBlock p = new ParameterBlock();
    p.addSource(buff);
    p.add(width.intValue());
    p.add(height.intValue());
    RenderedOp im = JAI.create("pattern", p);//$NON-NLS-1$
    BufferedImage bufferedImage = im.getAsBufferedImage();
    graphics.setComposite(AlphaComposite
            .getInstance(AlphaComposite.SRC_OVER, (float) opacity));
    graphics.drawImage(bufferedImage, transform, null);
    bufferedImage.flush();
    im.dispose();
    scaledImage.flush();
    buff.flush();
}
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:31,代码来源:RenderUtil.java


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