Package com.lightcrafts.media.jai.codec

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


        if(paramBlock.getNumParameters() > 2) {
            param = (ImageEncodeParam)paramBlock.getObjectParameter(2);
        }

        // Create an ImageEncoder.
        ImageEncoder encoder =
            ImageCodec.createImageEncoder(format, stream, param);

        // Check the ImageEncoder.
        if(encoder == null) {
            throw new RuntimeException(JaiI18N.getString("EncodeRIF0"));
        }

        // Store the data.
        RenderedImage im = (RenderedImage)paramBlock.getSource(0);
        try {
            encoder.encode(im);
            stream.flush();
      // Fix 4665208: EncodeRIF closed the stream after flush
      // User may put more into the stream
            //stream.close();
        } catch (IOException e) {
View Full Code Here

TOP

Related Classes of com.lightcrafts.media.jai.codec.ImageEncoder

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.