com.isomorphic.rpc

## Interface IImageExporter

- All Known Implementing Classes:
    ImageExport

      public interface IImageExporter

  Interface to an SVG rendering service. An `IImageExporter` object has methods for converting SVG source (String) to PNG or JPEG format and either return an `InputStream` to read the image's bytes, or write the image bytes to a given `OutputStream`.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.io.InputStream` | `getJPEG(java.lang.String svgString, java.lang.Float quality)` Parses the given SVG graphic source, paints the parsed SVG graphic into a newly-created `BufferedImage`, and returns an `InputStream` for reading the `BufferedImage` in JPEG format at the given quality level.
    `java.io.InputStream` | `getPNG(java.lang.String svgString)` Parses the given SVG graphic source, paints the parsed SVG graphic into a newly-created `BufferedImage`, and returns an `InputStream` for reading the `BufferedImage` in PNG format.
    `void` | `writeJPEG(java.io.OutputStream os, java.lang.String svgString, java.lang.Float quality)` Parses the given SVG graphic source, paints the parsed SVG graphic into a newly-created `BufferedImage`, and writes the `BufferedImage` as a JPEG to `os` at the given quality level.
    `void` | `writePNG(java.io.OutputStream os, java.lang.String svgString)` Parses the given SVG graphic source, paints the parsed SVG graphic into a newly-created `BufferedImage`, and writes the `BufferedImage` as a PNG to `os`.

- - ### Method Detail

    - #### writePNG

          void writePNG(java.io.OutputStream os,
                        java.lang.String svgString)
                 throws java.io.IOException

      Parses the given SVG graphic source, paints the parsed SVG graphic into a newly-created `BufferedImage`, and writes the `BufferedImage` as a PNG to `os`.
      Parameters:
        `os` - the `OutputStream` where the PNG data is written.
        `svgString` - the SVG graphic source.
      Throws:
        `java.io.IOException`

    - #### writeJPEG

          void writeJPEG(java.io.OutputStream os,
                         java.lang.String svgString,
                         java.lang.Float quality)
                  throws java.io.IOException

      Parses the given SVG graphic source, paints the parsed SVG graphic into a newly-created `BufferedImage`, and writes the `BufferedImage` as a JPEG to `os` at the given quality level.
      Parameters:
        `os` - the `OutputStream` where the JPEG data is written.
        `svgString` - the SVG graphic source.
        `quality` - a number between 0 and 1, with 1 representing the best quality and 0 representing the least quality but smallest file size. Pass `null` to use the default quality.
      Throws:
        `java.io.IOException`

    - #### getPNG

          java.io.InputStream getPNG(java.lang.String svgString)
                              throws java.io.IOException

      Parses the given SVG graphic source, paints the parsed SVG graphic into a newly-created `BufferedImage`, and returns an `InputStream` for reading the `BufferedImage` in PNG format.
      Parameters:
        `svgString` - the SVG graphic source.
      Returns:
        an `InputStream` for reading a rasterization of the SVG graphic in PNG format.
      Throws:
        `java.io.IOException`

    - #### getJPEG

          java.io.InputStream getJPEG(java.lang.String svgString,
                                      java.lang.Float quality)
                               throws java.io.IOException

      Parses the given SVG graphic source, paints the parsed SVG graphic into a newly-created `BufferedImage`, and returns an `InputStream` for reading the `BufferedImage` in JPEG format at the given quality level.
      Parameters:
        `svgString` - the SVG graphic source.
        `quality` - a number between 0 and 1, with 1 representing the best quality and 0 representing the least quality but smallest file size. Pass `null` to use the default quality.
      Returns:
        an `InputStream` for reading a rasterization of the SVG graphic in JPEG format.
      Throws:
        `java.io.IOException`