Package javax.media.jai

Examples of javax.media.jai.PlanarImage


           p[0] = p[1] = p[2] = (i << (netbiasshift + 8)) / maxColorNum;
           freq[i] = intbias / maxColorNum; /* 1/maxColorNum */
           bias[i] = 0;
        }

        PlanarImage source = getSourceImage(0);
        Rectangle rect = source.getBounds();

        if (roi != null)
            rect = roi.getBounds();

        RandomIter iterator = RandomIterFactory.create(source, rect);
View Full Code Here


    protected void accumulateStatistics(String name,
                                        Raster source,
                                        Object stats) {
        // Get image and band count.
        PlanarImage sourceImage = getSourceImage(0);
        int numBands = sourceImage.getSampleModel().getNumBands();

        // Determine the format tag and create an accessor.
        int formatTag = MediaLibAccessor.findCompatibleTag(null, source);
        MediaLibAccessor srcAccessor = new MediaLibAccessor(source,
                                                            source.getBounds(),
View Full Code Here

                                 int computeType) {
        super(source, layout, configuration, computeType);
    }

    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);
                }
                disposeMethod.invoke(trueSrc, null);
            } catch(Exception e) {
                // Ignore it.
            }
        } else {
            // Invoke dispose() directly.
            src.dispose();
        }
    }
View Full Code Here

    public synchronized void setRenderedSource(Long id,
                 RenderedImage source,
                 int index)
  throws RemoteException {

  PlanarImage pi = PlanarImage.wrapRenderedImage(source);

  Object obj = nodes.get(id);

  if (obj instanceof RenderedOp) {
      RenderedOp op = (RenderedOp)obj;
View Full Code Here

     */
    public synchronized Long getRendering(Long id, SerializableState rcs)
  throws RemoteException {

  RenderableOp op = (RenderableOp)nodes.get(id);
  PlanarImage pi = PlanarImage.wrapRenderedImage(op.createRendering(
               (RenderContext)rcs.getObject()));

  Long renderingID = getRemoteID();
  nodes.put(renderingID, pi);

View Full Code Here

    public synchronized void setRenderableSource(Long id,
             RenderedImage source,
             int index)
  throws RemoteException {

  PlanarImage pi = PlanarImage.wrapRenderedImage(source);
  RenderableOp op = (RenderableOp)nodes.get(id);
  op.setSource(pi, index);
    }
View Full Code Here

    public synchronized Long handleEvent(Long renderedOpID, String propName,
           Object oldValue, Object newValue)
  throws RemoteException {

  RenderedOp op = (RenderedOp)nodes.get(renderedOpID);
  PlanarImage rendering = op.getRendering();

  // Get a new unique ID
  Long id = getRemoteID();
  // Cache the old rendering against the new id
  nodes.put(id, rendering);
View Full Code Here

           SerializableState srcInvalidRegion,
           Object oldRendering)
  throws RemoteException {

  RenderedOp op = (RenderedOp)nodes.get(renderedOpID);
  PlanarImage rendering = op.getRendering();

  // Get a new unique ID
  Long id = getRemoteID();
  // Cache the old rendering against the new id
  nodes.put(id, rendering);

  // Put the op's negotiated result values for its rendering too.
  setServerNegotiatedValues(id, (NegotiableCapabilitySet)
          negotiated.get(renderedOpID));

  PlanarImage oldSrcRendering = null, newSrcRendering = null;
  String serverNodeDesc = null;
  Object src = null;

  if (oldRendering instanceof String) {
View Full Code Here

            /**
             * 利用JAI读取源图片
             */
            ParameterBlock pb = new ParameterBlock();
            pb.add(wrap);
            PlanarImage src = JAI.create("Stream", pb);
            img = new ImageWrapper(src, DEFAULT_HIGHT_QUALITY);
            img.setImageFormat(format);

            return img;
        } catch (Exception e) {
View Full Code Here

            imgWrapper = ImageReadHelper.read(inStream);

            if (tosRGBColorSpace) {
                for (int i = 0; i < imgWrapper.getNumOfImages(); i++) {
                    PlanarImage img = ImageColorConvertHelper.convert2sRGB(imgWrapper
                            .getAsPlanarImage(i));
                    imgWrapper.setImage(i, img);
                }
            }
View Full Code Here

TOP

Related Classes of javax.media.jai.PlanarImage

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.