Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| xmlgraphics-commons 1.5
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xmlgraphics.image.writer.imageio
Class ImageIOImageWriter

    java.lang.Object
      org.apache.xmlgraphics.image.writer.imageio.ImageIOImageWriter

All Implemented Interfaces:
  EventListener, IIOWriteWarningListener, ImageWriter

Direct Known Subclasses:
  ImageIOJPEGImageWriter, ImageIOPNGImageWriter, ImageIOTIFFImageWriter

    public class ImageIOImageWriter

extends Object
implements ImageWriter, IIOWriteWarningListener

ImageWriter implementation that uses Image I/O to write images.

Version:
  $Id: ImageIOImageWriter.java 750418 2009-03-05 11:03:54Z vhennebert $

Constructor Summary
`ImageIOImageWriter(String mime)` Main constructor.

Method Summary
`MultiImageWriter` | `createMultiImageWriter(OutputStream out)` Creates a MultiImageWriter instance that lets you put multiple pages into a single file if the format supports it.
`protected static IIOMetadataNode` | `getChildNode(Node n, String name)` Returns a specific metadata child node
`protected ImageWriteParam` | `getDefaultWriteParam(ImageWriter iiowriter, RenderedImage image, ImageWriterParams params)` Returns the default write parameters for encoding the image.
`String` | `getMIMEType()`
`boolean` | `isFunctional()`
`boolean` | `supportsMultiImageWriter()`
`protected IIOMetadata` | `updateMetadata(IIOMetadata meta, ImageWriterParams params)` Updates the metadata information based on the parameters to this writer.
`void` | `warningOccurred(ImageWriter source, int imageIndex, String warning)`
`void` | `writeImage(RenderedImage image, OutputStream out)` Encodes an image and writes it to an OutputStream.
`void` | `writeImage(RenderedImage image, OutputStream out, ImageWriterParams params)` Encodes an image and writes it to an OutputStream.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ImageIOImageWriter

    public ImageIOImageWriter(String mime)

  Main constructor.

  Parameters:
    `mime` - the MIME type of the image format

Method Detail

### writeImage

    public void writeImage(RenderedImage image,
                           OutputStream out)
                    throws IOException

  Description copied from interface: `ImageWriter`
  Encodes an image and writes it to an OutputStream.

  Specified by:
    `writeImage` in interface `ImageWriter`
  Parameters:
    `image` - the image to be encoded
    `out` - the OutputStream to write to
  Throws:
    `IOException` - In case of an /IO problem
  See Also:
    `ImageWriter.writeImage(java.awt.image.RenderedImage, java.io.OutputStream)`

### writeImage

    public void writeImage(RenderedImage image,
                           OutputStream out,
                           ImageWriterParams params)
                    throws IOException

  Description copied from interface: `ImageWriter`
  Encodes an image and writes it to an OutputStream.

  Specified by:
    `writeImage` in interface `ImageWriter`
  Parameters:
    `image` - the image to be encoded
    `out` - the OutputStream to write to
    `params` - a parameters object to customize the encoding.
  Throws:
    `IOException` - In case of an /IO problem
  See Also:
    `ImageWriter.writeImage(java.awt.image.RenderedImage, java.io.OutputStream, ImageWriterParams)`

### getDefaultWriteParam

    protected ImageWriteParam getDefaultWriteParam(ImageWriter iiowriter,
                                                   RenderedImage image,
                                                   ImageWriterParams params)

  Returns the default write parameters for encoding the image.

  Parameters:
    `iiowriter` - The IIO ImageWriter that will be used
    `image` - the image to be encoded
    `params` - the parameters for this writer instance
  Returns:
    the IIO ImageWriteParam instance

### updateMetadata

    protected IIOMetadata updateMetadata(IIOMetadata meta,
                                         ImageWriterParams params)

  Updates the metadata information based on the parameters to this writer.

  Parameters:
    `meta` - the metadata
    `params` - the parameters
  Returns:
    the updated metadata

### getChildNode

    protected static IIOMetadataNode getChildNode(Node n,
                                                  String name)

  Returns a specific metadata child node

  Parameters:
    `n` - the base node
    `name` - the name of the child
  Returns:
    the requested child node

### getMIMEType

    public String getMIMEType()

  Specified by:
    `getMIMEType` in interface `ImageWriter`
  Returns:
    the target MIME type supported by this ImageWriter
  See Also:
    `ImageWriter.getMIMEType()`

### isFunctional

    public boolean isFunctional()

  Specified by:
    `isFunctional` in interface `ImageWriter`
  Returns:
    true if the ImageWriter is expected to work properly in the current environment
  See Also:
    `ImageWriter.isFunctional()`

### warningOccurred

    public void warningOccurred(ImageWriter source,
                                int imageIndex,
                                String warning)

  Specified by:
    `warningOccurred` in interface `IIOWriteWarningListener`
  See Also:
    `IIOWriteWarningListener.warningOccurred( javax.imageio.ImageWriter, int, java.lang.String)`

### createMultiImageWriter

    public MultiImageWriter createMultiImageWriter(OutputStream out)
                                            throws IOException

  Description copied from interface: `ImageWriter`
  Creates a MultiImageWriter instance that lets you put multiple pages into a single file if the format supports it.

  Specified by:
    `createMultiImageWriter` in interface `ImageWriter`
  Parameters:
    `out` - the OutputStream to write the image to
  Returns:
    the requested MultiImageWriter instance
  Throws:
    `IOException` - In case of an /IO problem
  See Also:
    `ImageWriter.createMultiImageWriter( java.io.OutputStream)`

### supportsMultiImageWriter

    public boolean supportsMultiImageWriter()

  Specified by:
    `supportsMultiImageWriter` in interface `ImageWriter`
  Returns:
    true if the implemented format supports multiple pages in a single file
  See Also:
    `ImageWriter.supportsMultiImageWriter()`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| xmlgraphics-commons 1.5
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.