Package java.awt

Examples of java.awt.RenderingHints


    oldValue = oldParameters;
    newValue = newParameters;

      } else if (propName.equals("renderinghints")) {

    RenderingHints oldRH = (RenderingHints)event.getOldValue();
    RenderingHints newRH = (RenderingHints)event.getNewValue();

    oldValue = SerializerFactory.getState(oldRH, null);
    newValue = SerializerFactory.getState(newRH, null);
      } else {
    throw new RemoteImagingException(
View Full Code Here


          } catch (Exception e) {
        throw new RuntimeException(e.getMessage());
          }
         
          SerializableState ss = (SerializableState)obj;
          RenderingHints rh = (RenderingHints)ss.getObject();
         
          ri = source.createScaledRendering(w, h, rh);
      }

      if (useTileCodec) {
View Full Code Here

      */
    private void writeObject(ObjectOutputStream out) throws IOException {
        out.defaultWriteObject();
        if (theImage != null) {
            out.writeBoolean(true);
            RenderingHints hints = new RenderingHints(null);
            hints.put(JAI.KEY_SERIALIZE_DEEP_COPY, new Boolean(true));
            out.writeObject(SerializerFactory.getState(theImage, hints));
        } else {
            out.writeBoolean(false);
        }
    }
View Full Code Here

    public void createRenderedOp(Long id, String opName,
         ParameterBlock pb,
         SerializableState hints)
  throws RemoteException {

  RenderingHints rh = (RenderingHints)hints.getObject();

  // Check whether any of the parameters are Strings which represent
  // images either on this server or another server.
  JAIRMIUtil.checkServerParameters(pb, nodes);
View Full Code Here

                 int h,
                 SerializableState hintsState)
  throws RemoteException {

  RenderableImage ri = (RenderableImage)nodes.get(id);
  RenderingHints hints = (RenderingHints)hintsState.getObject();
  RenderedImage rendering = ri.createScaledRendering(w, h, hints);
  if (rendering instanceof Serializable) {
      return rendering;
  } else {
      return new SerializableRenderedImage(rendering);
View Full Code Here

             SerializableState oldRHints,
             ParameterBlock newParamBlock,
             SerializableState newRHints)
  throws RemoteException {

  RenderingHints oldHints = (RenderingHints)oldRHints.getObject();
  RenderingHints newHints = (RenderingHints)newRHints.getObject();

  RenderedOp op = (RenderedOp)nodes.get(id);

  OperationDescriptor od = (OperationDescriptor)
      JAI.getDefaultInstance().getOperationRegistry().
View Full Code Here

                                             DEFAULT_KERNEL_1D,
                                             DEFAULT_KERNEL_1D);
            pb.add(kernel);
            BorderExtender extender =
                BorderExtender.createInstance(BorderExtender.BORDER_COPY);
            RenderingHints hints =
                JAI.getDefaultInstance().getRenderingHints();
            if(hints == null) {
                hints = new RenderingHints(JAI.KEY_BORDER_EXTENDER, extender);
            } else {
                hints.put(JAI.KEY_BORDER_EXTENDER, extender);
            }
                                  
            RenderedOp filter = new RenderedOp("convolve", pb, hints);

            // Add the subsampling operation.
View Full Code Here

                       TileCache cache,
                       int computeType,
                       ImageLayout layout) {
        this(source, layout,
             cache != null ?
             new RenderingHints(JAI.KEY_TILE_CACHE, cache) : null,
             computeType);
    }
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

        // Retrieve layout information from the hints. The tile size hints
        // are ignored if a SampleModel hint is supplied. Set the hints
        // observed if any hints are used.
        SampleModel sm = null;
        ColorModel cm = null;
        RenderingHints hintsObserved = null;
        if(hints != null) {
            // Get the ImageLayout.
            ImageLayout layout = (ImageLayout)hints.get(JAI.KEY_IMAGE_LAYOUT);

            if(layout != null) {
                // Initialize the observed hint variables.
                hintsObserved = new RenderingHints(null);
                ImageLayout layoutObserved = new ImageLayout();

                // Get the SampleModel.
                if(layout.isValid(ImageLayout.SAMPLE_MODEL_MASK)) {
                    sm = layout.getSampleModel(null);
                    if(sm.getWidth() != tileWidth ||
                       sm.getHeight() != tileHeight) {
                        sm = sm.createCompatibleSampleModel(tileWidth,
                                                            tileHeight);
                    }
                    if(layoutObserved != null) {
                        layoutObserved.setSampleModel(sm);
                    }
                }

                // Get the ColorModel.
                if(layout.isValid(ImageLayout.COLOR_MODEL_MASK)) {
                    cm = layout.getColorModel(null);
                    if(layoutObserved != null) {
                        layoutObserved.setColorModel(cm);
                    }
                }

                // Get the tile dimensions.
                if(layout.isValid(ImageLayout.TILE_WIDTH_MASK)) {
                    tileWidth = layout.getTileWidth(null);
                    if(layoutObserved != null) {
                        layoutObserved.setTileWidth(tileWidth);
                    }
                } else if(sm != null) {
                    tileWidth = sm.getWidth();
                }
                if(layout.isValid(ImageLayout.TILE_HEIGHT_MASK)) {
                    tileHeight = layout.getTileHeight(null);
                    if(layoutObserved != null) {
                        layoutObserved.setTileHeight(tileHeight);
                    }
                } else if(sm != null) {
                    tileHeight = sm.getHeight();
                }

                // Set the observed hints layout.
                hintsObserved.put(JAI.KEY_IMAGE_LAYOUT, layoutObserved);
            } // layout != null
        } // hints != null

        // Ensure that the SampleModel is compatible with the tile size.
        if(sm != null &&
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.