Package com.sun.media.jai.codec

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


            _alreadyReadImageToken = true;
            _image = _jaiImageToken.getValue();

            _imageEncoderName = "PNG";

            PNGEncodeParam parameters = PNGEncodeParam
                    .getDefaultEncodeParam(_image);

            if (parameters instanceof PNGEncodeParam.Gray) {
                PNGEncodeParam.Gray parametersGray = new PNGEncodeParam.Gray();
                parametersGray.setBitDepth(_bitDepth);
View Full Code Here


      BufferedImage image = this.render(fixedRenderParam);

      // Output as byte[]
      outputStream = new ByteArrayOutputStream();
      if (lowFormat.startsWith("png")) {
        PNGEncodeParam pngParam = PNGEncodeParam
            .getDefaultEncodeParam(image);
        pngParam.setPhysicalDimension(dpi * 3937, dpi * 3937, 100);
        PNGImageEncoder pngEncoder = new PNGImageEncoder(outputStream,
            pngParam);
        pngEncoder.encode(image);
      } else if ("jpg".equals(lowFormat) || "jpeg".equals(lowFormat)) {
        JPEGEncodeParam jpgParam = JPEGCodec
View Full Code Here

    // Output as byte[]
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    try {
      if ("png".equals(lowFormat)) {
        PNGEncodeParam pngParam = PNGEncodeParam
            .getDefaultEncodeParam(image);
        pngParam.setPhysicalDimension(dpi * 3937, dpi * 3937, 100);
        PNGImageEncoder pngEncoder = new PNGImageEncoder(outputStream,
            pngParam);
        pngEncoder.encode(image);
      } else if ("jpg".equals(lowFormat) || "jpeg".equals(lowFormat)) {
        JPEGEncodeParam jpgParam = JPEGCodec
View Full Code Here

        return true;
    }

    protected ImageEncoder createImageEncoder(OutputStream dst,
                                              ImageEncodeParam param) {
        PNGEncodeParam p = null;
        if (param != null) {
            p = (PNGEncodeParam)param;
        }
        return new PNGImageEncoder(dst, p);
    }
View Full Code Here

/* 121 */     return true;
/*     */   }
/*     */
/*     */   protected ImageEncoder createImageEncoder(OutputStream dst, ImageEncodeParam param)
/*     */   {
/* 126 */     PNGEncodeParam p = null;
/* 127 */     if (param != null) {
/* 128 */       p = (PNGEncodeParam)param;
/*     */     }
/* 130 */     return new PNGImageEncoder(dst, p);
/*     */   }
View Full Code Here

            } catch (IOException fne) {
                throw new IllegalStateException("IOException error:" + fne.getMessage(), fne);
            }
        }
        else { // PNG is the default
            PNGEncodeParam param = PNGEncodeParam.getDefaultEncodeParam( bi );

            ImageEncoder encoder = ImageCodec.createImageEncoder( "PNG", out, param ); //NON-NLS
            try {
                // Writes it to a file as a .png
                encoder.encode( bi );
View Full Code Here

TOP

Related Classes of com.sun.media.jai.codec.PNGEncodeParam

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.