Interface MapImageEncoder

All Known Implementing Classes:
AbstractMapImageEncoder, GifMapImageEncoder, JAIMapImageEncoder, PngMapImageEncoder

public interface MapImageEncoder
The MapImageEncoder interface is used by the JMSImageProducer to encode images to differents image formats.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Represents an image with 8-bit RGB color components, corresponding to a Windows-style BGR color model) with the colors Blue, Green, and Red stored in 3 bytes.
    static final int
    Represents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha.
    static final int
    Represents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha.
    static final int
    Represents an opaque byte-packed 1, 2, or 4 bit image.
    static final int
    Represents a unsigned byte grayscale image, non-indexed.
    static final int
    Represents an indexed byte image.
    static final int
    Represents an image with 8-bit RGBA color components packed into integer pixels.
    static final int
    Represents an image with 8-bit RGBA color components packed into integer pixels.
    static final int
    Represents an image with 8-bit RGB color components, corresponding to a Windows- or Solaris- style BGR color model, with the colors Blue, Green, and Red packed into integer pixels.
    static final int
    Represents an image with 8-bit RGB color components packed into integer pixels.
    static final int
    Represents an image with 5-5-5 RGB color components (5-bits red, 5-bits green, 5-bits blue) with no alpha.
    static final int
    Represents an image with 5-6-5 RGB color components (5-bits red, 6-bits green, 5-bits blue) with no alpha.
    static final int
    Represents an unsigned short grayscale image, non-indexed).
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    encode(BufferedImage im, OutputStream os, String format, String params)
    Encodes a BufferedImage to an OutputStream using the specified image format and parameters.
    int
    getColorType(String format, String params)
    Returns the color type to use for the specified image format and parameters.
    Returns an array of String that contains all supported image formats that are supported by this MapImageEncoder.
  • Field Details

    • TYPE_INT_RGB

      static final int TYPE_INT_RGB
      Represents an image with 8-bit RGB color components packed into integer pixels. The image has a DirectColorModel without alpha.
      See Also:
    • TYPE_INT_ARGB

      static final int TYPE_INT_ARGB
      Represents an image with 8-bit RGBA color components packed into integer pixels. The image has a DirectColorModel with alpha. The color data in this image is considered not to be premultiplied with alpha. When this type is used as the imageType argument to a BufferedImage constructor, the created image is consistent with images created in the JDK1.1 and earlier releases.
      See Also:
    • TYPE_INT_ARGB_PRE

      static final int TYPE_INT_ARGB_PRE
      Represents an image with 8-bit RGBA color components packed into integer pixels. The image has a DirectColorModel with alpha. The color data in this image is considered to be premultiplied with alpha.
      See Also:
    • TYPE_INT_BGR

      static final int TYPE_INT_BGR
      Represents an image with 8-bit RGB color components, corresponding to a Windows- or Solaris- style BGR color model, with the colors Blue, Green, and Red packed into integer pixels. There is no alpha. The image has a ComponentColorModel.
      See Also:
    • TYPE_3BYTE_BGR

      static final int TYPE_3BYTE_BGR
      Represents an image with 8-bit RGB color components, corresponding to a Windows-style BGR color model) with the colors Blue, Green, and Red stored in 3 bytes. There is no alpha. The image has a ComponentColorModel.
      See Also:
    • TYPE_4BYTE_ABGR

      static final int TYPE_4BYTE_ABGR
      Represents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha. The image has a ComponentColorModel with alpha. The color data in this image is considered not to be premultiplied with alpha. The byte data is interleaved in a single byte array in the order A, B, G, R from lower to higher byte addresses within each pixel.
      See Also:
    • TYPE_4BYTE_ABGR_PRE

      static final int TYPE_4BYTE_ABGR_PRE
      Represents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha. The image has a ComponentColorModel with alpha. The color data in this image is considered to be premultiplied with alpha. The byte data is interleaved in a single byte array in the order A, B, G, R from lower to higher byte addresses within each pixel.
      See Also:
    • TYPE_USHORT_565_RGB

      static final int TYPE_USHORT_565_RGB
      Represents an image with 5-6-5 RGB color components (5-bits red, 6-bits green, 5-bits blue) with no alpha. This image has a DirectColorModel.
      See Also:
    • TYPE_USHORT_555_RGB

      static final int TYPE_USHORT_555_RGB
      Represents an image with 5-5-5 RGB color components (5-bits red, 5-bits green, 5-bits blue) with no alpha. This image has a DirectColorModel.
      See Also:
    • TYPE_BYTE_GRAY

      static final int TYPE_BYTE_GRAY
      Represents a unsigned byte grayscale image, non-indexed. This image has a ComponentColorModel with a CS_GRAY ColorSpace.
      See Also:
    • TYPE_USHORT_GRAY

      static final int TYPE_USHORT_GRAY
      Represents an unsigned short grayscale image, non-indexed). This image has a ComponentColorModel with a CS_GRAY ColorSpace.
      See Also:
    • TYPE_BYTE_BINARY

      static final int TYPE_BYTE_BINARY
      Represents an opaque byte-packed 1, 2, or 4 bit image. The image has an IndexColorModel without alpha. When this type is used as the imageType argument to the BufferedImage constructor that takes an imageType argument but no ColorModel argument, a 1-bit image is created with an IndexColorModel with two colors in the default sRGB ColorSpace: {0, 0, 0} and {255, 255, 255}.

      Images with 2 or 4 bits per pixel may be constructed via the BufferedImage constructor that takes a ColorModel argument by supplying a ColorModel with an appropriate map size.

      Images with 8 bits per pixel should use the image types TYPE_BYTE_INDEXED or TYPE_BYTE_GRAY depending on their ColorModel.

      See Also:
    • TYPE_BYTE_INDEXED

      static final int TYPE_BYTE_INDEXED
      Represents an indexed byte image. When this type is used as the imageType argument to the BufferedImage constructor that takes an imageType argument but no ColorModel argument, an IndexColorModel is created with a 256-color 6/6/6 color cube palette with the rest of the colors from 216-255 populated by grayscale values in the default sRGB ColorSpace.
      See Also:
  • Method Details

    • encode

      void encode(BufferedImage im, OutputStream os, String format, String params) throws Exception
      Encodes a BufferedImage to an OutputStream using the specified image format and parameters.
      Parameters:
      im - the BufferedImage to encode.
      os - the OutputStream to encode to.
      format - the image format to encode with.
      params - the parameter to use when encoding.
      Throws:
      Exception - if an exception occurs.
    • getColorType

      int getColorType(String format, String params)
      Returns the color type to use for the specified image format and parameters.
      Parameters:
      format - an image format. (ex. "jpeg", "gif", etc.)
      params - image format parameters.
      Returns:
      the color type to use for the specified image format and parameters.
    • getSupportedFormat

      String[] getSupportedFormat()
      Returns an array of String that contains all supported image formats that are supported by this MapImageEncoder.
      Returns:
      an array of String that contains all supported image formats that are supported by this MapImageEncoder.