Package java.awt

Examples of java.awt.RenderingHints


      }
    }
    JComponent c = builder.buildComponent();
    BufferedImage image = new BufferedImage(c.getWidth(), c.getHeight(), BufferedImage.TYPE_4BYTE_ABGR);
    Graphics2D graphics = image.createGraphics();
    RenderingHints renderingHints = new Hints();
    renderingHints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    graphics.setRenderingHints(renderingHints);
    c.print(graphics);
    return image;
  }
View Full Code Here


  @Autowired
  private RenderingService renderingService;

  public void execute(PipelineContext context, RasterizingContainer response) throws GeomajasException {
    MapContext mapContext = context.get(RasterizingPipelineCode.MAP_CONTEXT_KEY, MapContext.class);
    RenderingHints renderingHints = context.get(RasterizingPipelineCode.RENDERING_HINTS, RenderingHints.class);
    Rectangle paintArea = mapContext.getViewport().getScreenArea();
    MapRasterizingInfo mapRasterizingInfo = (MapRasterizingInfo) mapContext.getUserData().get(
        LayerFactory.USERDATA_RASTERIZING_INFO);
    BufferedImage image = createImage(paintArea.width, paintArea.height, mapRasterizingInfo.isTransparent());
    Graphics2D graphics = getGraphics(image, mapRasterizingInfo.isTransparent(), renderingHints);
View Full Code Here

            ParameterBlock pbMosaic = new ParameterBlock();
            pbMosaic.add(MosaicDescriptor.MOSAIC_TYPE_OVERLAY);
            for (RenderedImage renderedImage : images) {
              pbMosaic.addSource(renderedImage);
            }
            RenderedOp mosaic = JAI.create("mosaic", pbMosaic, new RenderingHints(JAI.KEY_IMAGE_LAYOUT,
                imageLayout));
            try {
              ByteArrayOutputStream baos = new ByteArrayOutputStream();
              log.debug("rendering to buffer...");
              ImageIO.write(mosaic, "png", baos);
View Full Code Here

    }

    public BufferedImage convertToColorSpace(BufferedImage bi, ColorSpace to) {
        ColorSpace from = bi.getColorModel().getColorSpace();

        RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING,
                RenderingHints.VALUE_RENDER_QUALITY);
        hints.put(RenderingHints.KEY_COLOR_RENDERING,
                RenderingHints.VALUE_COLOR_RENDER_QUALITY);
        hints.put(RenderingHints.KEY_DITHERING,
                RenderingHints.VALUE_DITHER_ENABLE);

        ColorConvertOp op = new ColorConvertOp(from, to, hints);

        BufferedImage result = op.filter(bi, null);
View Full Code Here

        return convertToColorSpace(bi, cs_to);
    }

    public BufferedImage convertBetweenColorSpacesX2(BufferedImage bi,
            ColorSpace from, ColorSpace to) {
        RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING,
                RenderingHints.VALUE_RENDER_QUALITY);
        hints.put(RenderingHints.KEY_COLOR_RENDERING,
                RenderingHints.VALUE_COLOR_RENDER_QUALITY);
        hints.put(RenderingHints.KEY_DITHERING,
                RenderingHints.VALUE_DITHER_ENABLE);

        // bi = relabelColorSpace(bi, cs);
        // dumpColorSpace("\tcs_sRGB", cs_sRGB);
        // dumpColorSpace("\tColorModel.getRGBdefaultc",
View Full Code Here

    }

    public BufferedImage convertBetweenColorSpaces(BufferedImage bi,
            ColorSpace from, ColorSpace to) {
        RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING,
                RenderingHints.VALUE_RENDER_QUALITY);
        hints.put(RenderingHints.KEY_COLOR_RENDERING,
                RenderingHints.VALUE_COLOR_RENDER_QUALITY);
        hints.put(RenderingHints.KEY_DITHERING,
                RenderingHints.VALUE_DITHER_ENABLE);

        ColorConvertOp op = new ColorConvertOp(from, to, hints);

        bi = relabelColorSpace(bi, from);
View Full Code Here

        map.put(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);
        map.put(RenderingHints.KEY_TEXT_ANTIALIASING,
                RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

        renderingHints = new RenderingHints(map);

        float ninth = 1.0f / 9.0f;
        float[] blurKernel = {ninth, ninth, ninth, ninth, ninth, ninth, ninth,
            ninth, ninth};
        convolutionKernel = new Kernel(3, 3, blurKernel);
View Full Code Here

        // Extract the affine transform.
        AffineTransform usr2dev = renderContext.getTransform();

        // Extract the hints.
  RenderingHints hints = renderContext.getRenderingHints();

  // Extract the AOI
        Shape aoi = renderContext.getAreaOfInterest();

        // Write serialized form to the stream.
View Full Code Here

 
  SerializableState aoi = (SerializableState)in.readObject();
  Shape shape = (Shape)aoi.getObject();

  SerializableState rhs = (SerializableState)in.readObject();
        RenderingHints hints = (RenderingHints)rhs.getObject();

        // Restore the transient RenderContext.
  renderContext = new RenderContext(usr2dev, shape, hints);
        theObject = renderContext;
    }
View Full Code Here

    private static Map configHelper(Map configuration) {

  Map config;

  if (configuration == null) {
      config = new RenderingHints(JAI.KEY_REPLACE_INDEX_COLOR_MODEL,
          Boolean.TRUE);
  } else {
     
      config = configuration;

      // If the user specified a value for this hint, we don't
      // want to change that
      if (!config.containsKey(JAI.KEY_REPLACE_INDEX_COLOR_MODEL)) {
    RenderingHints hints = new RenderingHints(null);
    // This is effectively a clone of configuration
    hints.putAll(configuration);
    config = hints;
    config.put(JAI.KEY_REPLACE_INDEX_COLOR_MODEL, Boolean.TRUE);
      }
  }
View Full Code Here

TOP

Related Classes of java.awt.RenderingHints

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.