Package com.kheops.util.encoders
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
FieldsModifier and TypeFieldDescriptionstatic final intRepresents 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 intRepresents 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 intRepresents 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 intRepresents an opaque byte-packed 1, 2, or 4 bit image.static final intRepresents a unsigned byte grayscale image, non-indexed.static final intRepresents an indexed byte image.static final intRepresents an image with 8-bit RGBA color components packed into integer pixels.static final intRepresents an image with 8-bit RGBA color components packed into integer pixels.static final intRepresents 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 intRepresents an image with 8-bit RGB color components packed into integer pixels.static final intRepresents an image with 5-5-5 RGB color components (5-bits red, 5-bits green, 5-bits blue) with no alpha.static final intRepresents an image with 5-6-5 RGB color components (5-bits red, 6-bits green, 5-bits blue) with no alpha.static final intRepresents an unsigned short grayscale image, non-indexed). -
Method Summary
Modifier and TypeMethodDescriptionvoidencode(BufferedImage im, OutputStream os, String format, String params) Encodes a BufferedImage to an OutputStream using the specified image format and parameters.intgetColorType(String format, String params) Returns the color type to use for the specified image format and parameters.String[]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_RGBRepresents an image with 8-bit RGB color components packed into integer pixels. The image has aDirectColorModelwithout alpha.- See Also:
-
TYPE_INT_ARGB
static final int TYPE_INT_ARGBRepresents an image with 8-bit RGBA color components packed into integer pixels. The image has aDirectColorModelwith alpha. The color data in this image is considered not to be premultiplied with alpha. When this type is used as theimageTypeargument to aBufferedImageconstructor, 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_PRERepresents an image with 8-bit RGBA color components packed into integer pixels. The image has aDirectColorModelwith alpha. The color data in this image is considered to be premultiplied with alpha.- See Also:
-
TYPE_INT_BGR
static final int TYPE_INT_BGRRepresents 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 aComponentColorModel.- See Also:
-
TYPE_3BYTE_BGR
static final int TYPE_3BYTE_BGRRepresents 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 aComponentColorModel.- See Also:
-
TYPE_4BYTE_ABGR
static final int TYPE_4BYTE_ABGRRepresents 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 aComponentColorModelwith 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_PRERepresents 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 aComponentColorModelwith 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_RGBRepresents an image with 5-6-5 RGB color components (5-bits red, 6-bits green, 5-bits blue) with no alpha. This image has aDirectColorModel.- See Also:
-
TYPE_USHORT_555_RGB
static final int TYPE_USHORT_555_RGBRepresents an image with 5-5-5 RGB color components (5-bits red, 5-bits green, 5-bits blue) with no alpha. This image has aDirectColorModel.- See Also:
-
TYPE_BYTE_GRAY
static final int TYPE_BYTE_GRAYRepresents a unsigned byte grayscale image, non-indexed. This image has aComponentColorModelwith a CS_GRAYColorSpace.- See Also:
-
TYPE_USHORT_GRAY
static final int TYPE_USHORT_GRAYRepresents an unsigned short grayscale image, non-indexed). This image has aComponentColorModelwith a CS_GRAYColorSpace.- See Also:
-
TYPE_BYTE_BINARY
static final int TYPE_BYTE_BINARYRepresents an opaque byte-packed 1, 2, or 4 bit image. The image has anIndexColorModelwithout alpha. When this type is used as theimageTypeargument to theBufferedImageconstructor that takes animageTypeargument but noColorModelargument, a 1-bit image is created with anIndexColorModelwith two colors in the default sRGBColorSpace: {0, 0, 0} and {255, 255, 255}.Images with 2 or 4 bits per pixel may be constructed via the
BufferedImageconstructor that takes aColorModelargument by supplying aColorModelwith an appropriate map size.Images with 8 bits per pixel should use the image types
TYPE_BYTE_INDEXEDorTYPE_BYTE_GRAYdepending on theirColorModel.- See Also:
-
TYPE_BYTE_INDEXED
static final int TYPE_BYTE_INDEXEDRepresents an indexed byte image. When this type is used as theimageTypeargument to theBufferedImageconstructor that takes animageTypeargument but noColorModelargument, anIndexColorModelis 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
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
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.
-