public interface MapImageEncoder
Modifier and Type | Field and Description |
---|---|
static 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.
|
static 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.
|
static 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.
|
static int |
TYPE_BYTE_BINARY
Represents an opaque byte-packed 1, 2, or 4 bit image.
|
static int |
TYPE_BYTE_GRAY
Represents a unsigned byte grayscale image, non-indexed.
|
static int |
TYPE_BYTE_INDEXED
Represents an indexed byte image.
|
static int |
TYPE_INT_ARGB
Represents an image with 8-bit RGBA color components packed into
integer pixels.
|
static int |
TYPE_INT_ARGB_PRE
Represents an image with 8-bit RGBA color components packed into
integer pixels.
|
static 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.
|
static int |
TYPE_INT_RGB
Represents an image with 8-bit RGB color components packed into
integer pixels.
|
static 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.
|
static 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.
|
static int |
TYPE_USHORT_GRAY
Represents an unsigned short grayscale image, non-indexed).
|
Modifier and Type | Method and Description |
---|---|
void |
encode(java.awt.image.BufferedImage im,
java.io.OutputStream os,
java.lang.String format,
java.lang.String params)
Encodes a BufferedImage to an OutputStream using the specified image format and parameters.
|
int |
getColorType(java.lang.String format,
java.lang.String params)
Returns the color type to use for the specified image format and parameters.
|
java.lang.String[] |
getSupportedFormat()
Returns an array of String that contains all supported image formats that are supported
by this MapImageEncoder.
|
static final int TYPE_INT_RGB
DirectColorModel
without
alpha.static final int TYPE_INT_ARGB
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.static final int TYPE_INT_ARGB_PRE
DirectColorModel
with alpha. The color data in this image is considered to be
premultiplied with alpha.static final int TYPE_INT_BGR
ComponentColorModel
.static final int TYPE_3BYTE_BGR
ComponentColorModel
.static final int TYPE_4BYTE_ABGR
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.static final int TYPE_4BYTE_ABGR_PRE
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.static final int TYPE_USHORT_565_RGB
DirectColorModel
.static final int TYPE_USHORT_555_RGB
DirectColorModel
.static final int TYPE_BYTE_GRAY
ComponentColorModel
with a CS_GRAY
ColorSpace
.static final int TYPE_USHORT_GRAY
ComponentColorModel
with a CS_GRAY
ColorSpace
.static final int TYPE_BYTE_BINARY
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
.
static final int TYPE_BYTE_INDEXED
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.void encode(java.awt.image.BufferedImage im, java.io.OutputStream os, java.lang.String format, java.lang.String params) throws java.lang.Exception
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.java.lang.Exception
- if an exception occurs.int getColorType(java.lang.String format, java.lang.String params)
format
- an image format. (ex. "jpeg", "gif", etc.)params
- image format parameters.java.lang.String[] getSupportedFormat()