Package java.awt

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))) {
    config.put(JAI.KEY_REPLACE_INDEX_COLOR_MODEL, Boolean.FALSE);
    RenderingHints hints = (RenderingHints)configuration;
    config = (RenderingHints)hints.clone();
      }
  }

  return config;
    }
View Full Code Here


        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

       interp instanceof InterpolationNearest ||
       interp instanceof InterpolationBilinear)) {
    
      // Set to false     
      if (configuration == null) {
    config = new RenderingHints(JAI.KEY_REPLACE_INDEX_COLOR_MODEL,
              Boolean.FALSE);
      } else {
   
    // 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

        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

            throw new IllegalArgumentException(JaiI18N.getString("Generic0"));
        }

        // Get a clone of the context's transform
        AffineTransform usr2dev = renderContext.getTransform();
        RenderingHints hints = renderContext.getRenderingHints();

        int type = usr2dev.getType();
        if (type == AffineTransform.TYPE_UNIFORM_SCALE ||
            type == AffineTransform.TYPE_GENERAL_SCALE) {
            int width = (int)Math.ceil(usr2dev.getScaleX()*getWidth());
            int height = (int)Math.ceil(usr2dev.getScaleY()*getHeight());

            return createScaledRendering(width, height, hints);
        }

        // Use the square root of the determinant as an estimate of
        // the single-axis scale factor.
        int height =
            (int)Math.ceil(Math.sqrt(usr2dev.getDeterminant())*getHeight());
        int res = numSources - 1;
        while (res > 0) {
            int imh = renderedSource[res].getHeight();
            if (imh >= height) {
                break;
            }
            res--;
        }

        RenderedImage source = renderedSource[res];
        double sx = (double)getWidth()/source.getWidth();
        double sy = (double)getHeight()/source.getHeight();

        AffineTransform transform = new AffineTransform();
        transform.translate(-source.getMinX(), -source.getMinY());
        transform.scale(sx, sy);
        transform.translate(getMinX(), getMinY());
        transform.preConcatenate(usr2dev);

        Interpolation interp =
            Interpolation.getInstance(Interpolation.INTERP_NEAREST);
        if (hints != null) {
            Object obj = hints.get(JAI.KEY_INTERPOLATION);
            if (obj != null) {
                interp = (Interpolation)obj;
            }
        }

View Full Code Here

            newParamBlock.add(param);

            RenderingHints.Key key = JAI.KEY_OPERATION_BOUND;
            int bound = OpImage.OP_NETWORK_BOUND;
            if (renderHints == null) {
                renderHints = new RenderingHints(key, new Integer(bound));
            } else if (!renderHints.containsKey(key)) {
                renderHints.put(key, new Integer(bound));
            }

            // Get the registry from the hints, if any.
View Full Code Here

    /**
     * Returns a clone of the <code>RenderingHints</code> of this node or
     * <code>null</code>.
     */
    public RenderingHints getRenderingHints() {
        RenderingHints hints = nodeSupport.getRenderingHints();
        return hints == null ? null : (RenderingHints)hints.clone();
    }
View Full Code Here

        if(!isRenderable) {
            return this;
        }

        // Merge argument hints with node hints.
        RenderingHints mergedHints =
            JAI.mergeRenderingHints(nodeSupport.getRenderingHints(),
                                    renderContext.getRenderingHints());
        if(mergedHints != renderContext.getRenderingHints()) {
            renderContext = (RenderContext)renderContext.clone();
            renderContext.setRenderingHints(mergedHints);
View Full Code Here

                        // Evaluate any DeferredData parameters.
                        oldPB = ImageUtil.evaluateParameters(oldPB);
                        newPB = ImageUtil.evaluateParameters(newPB);

                        // Update the collection.
                        RenderingHints newHints =
                            nodeSupport.getRenderingHints();
                        if((imageCollection =
                            oldCIF.update(oldPB, oldHints,
                                          newPB, newHints,
                                          (CollectionImage)theOldCollection,
View Full Code Here

    throw new IllegalArgumentException(opName + ": " +
               JaiI18N.getString("JAI5"));
        }

        // Merge rendering hints.  Hints passed in take precedence.
        RenderingHints mergedHints = mergeRenderingHints(renderingHints, hints);

         // Validate input arguments. The ParameterBlock is cloned here
         // because OperationDescriptor.validateArguments() may change
         // its content.
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.