Package java.awt.image

Examples of java.awt.image.RenderedImage


    private void readObject(ObjectInputStream in)
        throws IOException, ClassNotFoundException {
        in.defaultReadObject();
        if ((boolean)in.readBoolean()) {
            SerializableState ss = (SerializableState)in.readObject();
            RenderedImage ri =(RenderedImage)(ss.getObject());
            theImage = PlanarImage.wrapRenderedImage(ri);
        } else {
            theImage = null;
        }
        iter = null;
View Full Code Here


        // Check source band count: must be even for a complex source.
        EnumeratedParameter dataNature =
            (EnumeratedParameter)args.getObjectParameter(1);

        if (!dataNature.equals(IDFTDescriptor.REAL_TO_COMPLEX)) {
            RenderedImage src = args.getRenderedSource(0);

            if (src.getSampleModel().getNumBands() % 2 != 0) {
                msg.append(getName() + " " +
                           JaiI18N.getString("IDFTDescriptor5"));
                return false;
            }
        }
View Full Code Here

        // If the source is a local RenderedOp, then the only way
        // to access it from a remote machine is to render it and
        // create a SerializableRenderedImage wrapping the
        // rendering, which is set as the source of the remote op.
        RenderedImage ri = ((RenderedOp)source).getRendering();
        try {
      SerializableRenderedImage sri =
          new SerializableRenderedImage(ri);
      remoteImage.setRenderedSource(opID, sri, i);
      newPB.setSource(sri, i);
        } catch (RemoteException e) {
                        String message = JaiI18N.getString("RMIServerProxy6");
                        listener.errorOccurred(message,
                                               new RemoteImagingException(message, e),
                                               this, false);
//      throw new RemoteImagingException(ImageUtil.getStackTraceString(e));
        }

    } else if (source instanceof RenderedImage) {

        // If the source is a local RenderedImage, then the only
        // way to access it from a remote machine is by wrapping
        // it in SerializableRenderedImage and then setting the
        // SRI as the source.
        RenderedImage ri = (RenderedImage)source;
        try {
      SerializableRenderedImage sri =
          new SerializableRenderedImage(ri);
      remoteImage.setRenderedSource(opID, sri, i);
      newPB.setSource(sri, i);
View Full Code Here

  if (!modeName.equalsIgnoreCase("rendered"))
      return true;

  // Get the source and the breakpoint array.
        RenderedImage src = args.getRenderedSource(0);

        float[][][] breakPoints =
            (float[][][])args.getObjectParameter(0);

        // Ensure that the number of breakpoint bands is either 1 or
        // the number of bands in the source image, the second
        // breakpoint array dimension is 2, the third dimension is
        // the same for abscissas and ordinates, and that the absicssas
        // are monotonically increasing.
        if (breakPoints.length != 1 &&
            breakPoints.length != src.getSampleModel().getNumBands()) {
            // Number of breakpoints not 1 nor numBands.
            msg.append(getName() + " " +
                       JaiI18N.getString("PiecewiseDescriptor1"));
            return false;
        } else {
View Full Code Here

        }

  if (!modeName.equalsIgnoreCase("rendered"))
      return true;

  RenderedImage src = args.getRenderedSource(0);

        double[][] matrix = (double[][])args.getObjectParameter(0);
        SampleModel sm = src.getSampleModel();
        int rowLength = sm.getNumBands() + 1;

        if (matrix.length < 1) {
            message.append(getName() + ": " +
                           JaiI18N.getString("BandCombineDescriptor2"));
View Full Code Here

        if (!MediaLibAccessor.isMediaLibCompatible(new ParameterBlock())) {
            return null;
        }

        RenderedImage source = args.getRenderedSource(0);
        EnumeratedParameter scalingType =
            (EnumeratedParameter)args.getObjectParameter(0);
        EnumeratedParameter dataNature =
            (EnumeratedParameter)args.getObjectParameter(1);

        boolean isComplexSource =
            !dataNature.equals(DFTDescriptor.REAL_TO_COMPLEX);
        int numSourceBands = source.getSampleModel().getNumBands();

        // Use the two-dimensional mediaLib DFT if possible: it supports
        // only data which have a single component (real or complex)
        // per pixel and which have dimensions which are equal to a positive
        // power of 2.
        if(((isComplexSource && numSourceBands == 2) ||
            (!isComplexSource && numSourceBands == 1)) &&
           MlibDFTOpImage.isAcceptableSampleModel(source.getSampleModel())) {
            // If necessary, pad the source to ensure that
            // both dimensions are positive powers of 2.
            int sourceWidth = source.getWidth();
            int sourceHeight = source.getHeight();
            if(!MathJAI.isPositivePowerOf2(sourceWidth) ||
               !MathJAI.isPositivePowerOf2(sourceHeight)) {
                ParameterBlock pb = new ParameterBlock();
                pb.addSource(source);
                pb.add(0);
View Full Code Here

        return key.longValue() >>> 32;
    }
*/
    /** Returns a string representation of the class object. */
    public String toString() {
        RenderedImage o = (RenderedImage) getOwner();
        String ostring = o == null ? "null" : o.toString();

        Raster t = getTile();
        String tstring = t == null ? "null" : t.toString();

        return getClass().getName() + "@" + Integer.toHexString(hashCode()) +
View Full Code Here

    public synchronized void dispose() {
        PlanarImage src = getSource(0);
        if(src instanceof RenderedImageAdapter) {
            // Use relection to invoke dispose();
            RenderedImage trueSrc =
                ((RenderedImageAdapter)src).getWrappedImage();
            Method disposeMethod = null;
            try {
                Class cls = trueSrc.getClass();
                disposeMethod = cls.getMethod("dispose", null);
                if(!disposeMethod.isAccessible()) {
                    AccessibleObject.setAccessible(new AccessibleObject[] {
                        disposeMethod
                    }, true);
View Full Code Here

                 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

     */
    public RenderedImage createDefaultRendering(Long id)
  throws RemoteException {

  RenderableImage ri = (RenderableImage)nodes.get(id);
  RenderedImage rendering = ri.createDefaultRendering();
  if (rendering instanceof Serializable) {
      return rendering;
  } else {
      return new SerializableRenderedImage(rendering);
  }
View Full Code Here

TOP

Related Classes of java.awt.image.RenderedImage

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.