Examples of TIFFEncodeParam


Examples of com.lightcrafts.media.jai.codec.TIFFEncodeParam

    }

    public TIFFImageEncoder(OutputStream output, ImageEncodeParam param) {
  super(output, param);
  if (this.param == null) {
      this.param = new TIFFEncodeParam();
  }
    }
View Full Code Here

Examples of com.lightcrafts.media.jai.codec.TIFFEncodeParam

     * Encodes a RenderedImage and writes the output to the
     * OutputStream associated with this ImageEncoder.
     */
    public void encode(RenderedImage im) throws IOException {
        // Get the encoding parameters.
        TIFFEncodeParam encodeParam = (TIFFEncodeParam)param;

        // Set the byte order flag before any data are written.
        isLittleEndian = encodeParam.getLittleEndian();

        // Write the file header (8 bytes).
        writeFileHeader();

  Iterator iter = encodeParam.getExtraImages();
  if(iter != null) {
            int ifdOffset = 8;
      RenderedImage nextImage = im;
            TIFFEncodeParam nextParam = encodeParam;
            boolean hasNext;
            do {
                hasNext = iter.hasNext();
                ifdOffset = encode(nextImage, nextParam, ifdOffset, !hasNext);
          if(hasNext) {
View Full Code Here

Examples of com.sun.media.jai.codec.TIFFEncodeParam

    /*
     * -------------------------------- alle Bilder als Multipage erzeugen --------------------------------
     */
    OutputStream out = new FileOutputStream(this.help.getGoobiDataDirectory() + inProzess.getId().intValue() + File.separator + "multipage.tiff");
    TIFFEncodeParam param = new TIFFEncodeParam();
    param.setCompression(4);
    ImageEncoder encoder = ImageCodec.createImageEncoder("TIFF", out, param);
    Vector<RenderedImage> vector = new Vector<RenderedImage>();
    for (int i = 1; i < image.length; i++) {
      vector.add(image[i]);
    }
    param.setExtraImages(vector.iterator());
    encoder.encode(image[0]);
    out.close();
    myLogger.debug("fertig");
  }
View Full Code Here

Examples of com.sun.media.jai.codec.TIFFEncodeParam

     *  of if the image in unable to be encoded.
     */
    public boolean postfire() throws IllegalActionException {
        _imageEncoderName = "TIFF";

        TIFFEncodeParam tiffEncodeParam = new TIFFEncodeParam();
        tiffEncodeParam.setWriteTiled(((BooleanToken) writeTiled.getToken())
                .booleanValue());

        _imageEncodeParam = tiffEncodeParam;
        return super.postfire();
    }
View Full Code Here

Examples of com.sun.media.jai.codec.TIFFEncodeParam

        } else if (s.endsWith(".png")) {
            JAI.create("filestore", getImage(), tmpFile, "PNG", new PNGEncodeParam.Gray());
        } else if (s.endsWith(".pnm")) {
            JAI.create("filestore", getImage(), tmpFile, "PNM", new PNMEncodeParam());
        } else if (s.endsWith(".tiff") || s.endsWith(".tif")) {
            JAI.create("filestore", getImage(), tmpFile, "TIFF", new TIFFEncodeParam());
        } else if (s.endsWith(".bmp")) {
            JAI.create("filestore", getDisplayImage(), tmpFile, "BMP", new BMPEncodeParam());
        } else {
            // assume FITS format
            FITSImage fitsImage = getFitsImage();
View Full Code Here

Examples of com.sun.media.jai.codec.TIFFEncodeParam

    }

    public TIFFImageEncoder(OutputStream output, ImageEncodeParam param) {
  super(output, param);
  if (this.param == null) {
      this.param = new TIFFEncodeParam();
  }
    }
View Full Code Here

Examples of com.sun.media.jai.codec.TIFFEncodeParam

     * Encodes a RenderedImage and writes the output to the
     * OutputStream associated with this ImageEncoder.
     */
    public void encode(RenderedImage im) throws IOException {
        // Get the encoding parameters.
        TIFFEncodeParam encodeParam = (TIFFEncodeParam)param;

        // Set the byte order flag before any data are written.
        isLittleEndian = encodeParam.getLittleEndian();

        // Write the file header (8 bytes).
        writeFileHeader();

  Iterator iter = encodeParam.getExtraImages();
  if(iter != null) {
            int ifdOffset = 8;
      RenderedImage nextImage = im;
            TIFFEncodeParam nextParam = encodeParam;
            boolean hasNext;
            do {
                hasNext = iter.hasNext();
                ifdOffset = encode(nextImage, nextParam, ifdOffset, !hasNext);
          if(hasNext) {
View Full Code Here

Examples of com.sun.media.jai.codec.TIFFEncodeParam

/*      */   }
/*      */
/*      */   public TIFFImageEncoder(OutputStream output, ImageEncodeParam param) {
/*  119 */     super(output, param);
/*  120 */     if (this.param == null)
/*  121 */       this.param = new TIFFEncodeParam();
/*      */   }
View Full Code Here

Examples of com.sun.media.jai.codec.TIFFEncodeParam

/*      */   }
/*      */
/*      */   public void encode(RenderedImage im)
/*      */     throws IOException
/*      */   {
/*  131 */     TIFFEncodeParam encodeParam = (TIFFEncodeParam)this.param;
/*      */
/*  134 */     this.isLittleEndian = encodeParam.getLittleEndian();
/*      */
/*  137 */     writeFileHeader();
/*      */
/*  139 */     Iterator iter = encodeParam.getExtraImages();
/*  140 */     if (iter != null) { int ifdOffset = 8;
/*  142 */       RenderedImage nextImage = im;
/*  143 */       TIFFEncodeParam nextParam = encodeParam;
/*      */       boolean hasNext;
/*      */       do { hasNext = iter.hasNext();
/*  147 */         ifdOffset = encode(nextImage, nextParam, ifdOffset, !hasNext);
/*  148 */         if (hasNext) {
/*  149 */           Object obj = iter.next();
View Full Code Here

Examples of com.sun.media.jai.codec.TIFFEncodeParam

  private void writeUsingJAI(BufferedImage bi, OutputStream os) throws FormatIOException {
    if (bi != null) {
      BufferedOutputStream bos = null;
      try {
        bos = new BufferedOutputStream(os);
        TIFFEncodeParam param = new TIFFEncodeParam();
        ImageEncoder enc = ImageCodec.createImageEncoder("TIFF", bos, param);
        enc.encode(bi);
      } catch (IOException e) {
        logger.error(e,e);
      } finally {
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.