Examples of RenderingHints


Examples of java.awt.RenderingHints

        // -- TiledImageGraphics state --
        // Cache the Hashtable of properties.
        properties = tiledImage.getProperties();

        // Create RenderingHints from the properties.
        renderingHints = new RenderingHints(properties);
    }
View Full Code Here

Examples of java.awt.RenderingHints

     * @param paramBlock The parameters used to create the image.
     * @return A <code>RenderedImage</code>.
     */
    public RenderedImage create(RenderContext renderContext,
                                ParameterBlock paramBlock) {
        RenderingHints renderHints = renderContext.getRenderingHints();
        if (operationName != null) {
            OperationRegistry registry =
                renderHints == null ? null :
                (OperationRegistry)renderHints.get(JAI.KEY_OPERATION_REGISTRY);

            RenderedImage rendering;

            if(registry == null) {
                // Call the JAI.create method to get the best implementation
View Full Code Here

Examples of java.awt.RenderingHints

        Map config;

        if (configuration == null) {

            config = new RenderingHints(JAI.KEY_REPLACE_INDEX_COLOR_MODEL,
                                        Boolean.FALSE);

        } else {

            config = configuration;

      // If the user has specified a hint for this, then we don't
      // want to change it, so change only if this hint is not
      // already specified
            if (!(config.containsKey(JAI.KEY_REPLACE_INDEX_COLOR_MODEL))) {
                RenderingHints hints = (RenderingHints)configuration;
                config = (RenderingHints)hints.clone();
                config.put(JAI.KEY_REPLACE_INDEX_COLOR_MODEL, Boolean.FALSE);
            }
        }

        return config;
View Full Code Here

Examples of java.awt.RenderingHints

  Shape shape = null;
  Object aoi = in.readBoolean() ?
            (Object)in.readObject() : null;
  RenderingHintsProxy rhp = (RenderingHintsProxy)in.readObject();
 
  RenderingHints hints = rhp.getRenderingHints();
 
  // Restore the transient RenderContext.
  if (aoi != null){
      if (aoi instanceof ROIShape){
    shape = ((ROIShape)aoi).getAsShape();
      }else {
    shape = (Shape)aoi;
      }
  }
 
  if(aoi == null && hints.isEmpty()) {
      renderContext = new RenderContext(usr2dev);
  } else if(aoi == null) {
      renderContext = new RenderContext(usr2dev, hints);
  } else if(hints.isEmpty()) {
      renderContext = new RenderContext(usr2dev, shape);
  } else {
      renderContext = new RenderContext(usr2dev, shape, hints);
  }
    }
View Full Code Here

Examples of java.awt.RenderingHints

    private static Map configHelper(Map configuration) {

  Map config;

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

      if (!(config.containsKey(JAI.KEY_REPLACE_INDEX_COLOR_MODEL))) {
    RenderingHints hints = (RenderingHints)configuration;
    config = (RenderingHints)hints.clone();
    config.put(JAI.KEY_REPLACE_INDEX_COLOR_MODEL, Boolean.FALSE);
      }
  }

  return config;
View Full Code Here

Examples of java.awt.RenderingHints

            if(layout.getColorModel(src) == src.getColorModel()) {
                // Nothing changed: return the source directly.
                return src;
            } else {
                // Remove TileCache hint from RenderingHints if present.
                RenderingHints hints = renderHints;
                if(hints != null && hints.containsKey(JAI.KEY_TILE_CACHE)) {
                    hints = new RenderingHints((Map)renderHints);
                    hints.remove(JAI.KEY_TILE_CACHE);
                }

                // Only the ColorModel is changing.
                return new NullOpImage(src, layout, hints,
                                       OpImage.OP_IO_BOUND);
            }
        }

  if (isDataTypeChange == true) {

      // Add JAI.KEY_REPLACE_INDEX_COLOR_MODEL hint to renderHints
      if (renderHints == null) {
    renderHints =
        new RenderingHints(JAI.KEY_REPLACE_INDEX_COLOR_MODEL,
               Boolean.TRUE);
   
      } else if (!renderHints.containsKey(
          JAI.KEY_REPLACE_INDEX_COLOR_MODEL)) {
    // If the user specified a value for this hint, we don't
View Full Code Here

Examples of java.awt.RenderingHints

     */
    public void setRenderingHints(RenderingHints hints) {
        if(equals(this.hints, hints)) {
            return;
        }
        RenderingHints oldHints = this.hints;
        this.hints = hints;
        fireEvent("RenderingHints", oldHints, hints);
        resetPropertyEnvironment(false);
    }
View Full Code Here

Examples of java.awt.RenderingHints

                }
                if (parameter instanceof Raster) {
                    pbClone.set(SerializerFactory.getState(parameter, null), index);
                } else if (parameter instanceof RenderedImage) {
                    RenderedImage ri = (RenderedImage)parameter;
                    RenderingHints hints = new RenderingHints(null);
                    hints.put(JAI.KEY_SERIALIZE_DEEP_COPY, new Boolean(true));
                    pbClone.set(SerializerFactory.getState(ri, hints),
                                index);
                } else {
                    throw new RuntimeException(parameter.getClass().getName() +
                        JaiI18N.getString("OperationNodeSupport1"));
View Full Code Here

Examples of java.awt.RenderingHints

 
  Map config;

  if (configuration == null) {

      config = new RenderingHints(JAI.KEY_REPLACE_INDEX_COLOR_MODEL,
          Boolean.FALSE);

  } else {
     
      config = configuration;

      if (!(config.containsKey(JAI.KEY_REPLACE_INDEX_COLOR_MODEL))) {
    RenderingHints hints = (RenderingHints)configuration;
    config = (RenderingHints)hints.clone();
    config.put(JAI.KEY_REPLACE_INDEX_COLOR_MODEL, Boolean.FALSE);
      }
  }

  return config;
View Full Code Here

Examples of java.awt.RenderingHints

  if (tileCache != null) {
      this.cache = tileCache;
  }

  this.renderingHints = new RenderingHints(null);
        this.renderingHints.put(JAI.KEY_OPERATION_REGISTRY, operationRegistry);
  this.renderingHints.put(JAI.KEY_TILE_CACHE, cache);
  this.renderingHints.put(JAI.KEY_RETRY_INTERVAL,
        new Integer(retryInterval));
        this.renderingHints.put(JAI.KEY_NUM_RETRIES, new Integer(numRetries));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.