| java.lang.Object | |
| ↳ | com.sun.imageio.plugins.common.ImageUtil |
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Checks that the provided
ImageWriter can encode
the provided ColorModel and SampleModel. | |||||||||||
Checks that the provided
ImageWriter can encode
the provided ImageTypeSpecifier or not. | |||||||||||
Converts the provided object to
String | |||||||||||
Creates a
ColorModel that may be used with the
specified SampleModel. | |||||||||||
For the case of binary data (
isBinary() returns
true), return the binary data as a packed byte array. | |||||||||||
Returns the binary data unpacked into an array of bytes.
| |||||||||||
Returns whether the image has contiguous data across rows.
| |||||||||||
Tests whether the color indices represent a gray-scale image.
| |||||||||||
Sets the supplied
Raster's data from an array
of packed binary data of the form returned by
getPackedBinaryData(). | |||||||||||
Copies data into the packed array of the
Raster
from an array of unpacked data of the form returned by
getUnpackedBinaryData(). | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Checks that the provided ImageWriter can encode
the provided ColorModel and SampleModel.
If not, an IIOException will be thrown.
| writer | The provided ImageWriter. |
|---|---|
| colorModel | The provided ColorModel. |
| sampleModel | The provided SampleModel. |
| IIOException | If the writer cannot encoded the provided image. |
|---|
Checks that the provided ImageWriter can encode
the provided ImageTypeSpecifier or not. If not, an
IIOException will be thrown.
| writer | The provided ImageWriter. |
|---|---|
| type | The image to be tested. |
| IIOException | If the writer cannot encoded the provided image. |
|---|
Creates a ColorModel that may be used with the
specified SampleModel. If a suitable
ColorModel cannot be found, this method returns
null.
Suitable ColorModels are guaranteed to exist
for all instances of ComponentSampleModel.
For 1- and 3- banded SampleModels, the returned
ColorModel will be opaque. For 2- and 4-banded
SampleModels, the output will use alpha transparency
which is not premultiplied. 1- and 2-banded data will use a
grayscale ColorSpace, and 3- and 4-banded data a sRGB
ColorSpace. Data with 5 or more bands will have a
BogusColorSpace.
An instance of DirectColorModel will be created for
instances of SinglePixelPackedSampleModel with no more
than 4 bands.
An instance of IndexColorModel will be created for
instances of MultiPixelPackedSampleModel. The colormap
will be a grayscale ramp with 1 << numberOfBits
entries ranging from zero to at most 255.
ColorModel that is suitable for
the supplied SampleModel, or null.| IllegalArgumentException | If sampleModel is
null.
|
|---|
For the case of binary data (isBinary() returns
true), return the binary data as a packed byte array.
The data will be packed as eight bits per byte with no bit offset,
i.e., the first bit in each image line will be the left-most of the
first byte of the line. The line stride in bytes will be
(int)((getWidth()+7)/8). The length of the returned
array will be the line stride multiplied by getHeight()
null if the data are not binary.| IllegalArgumentException | if isBinary() returns
false with the SampleModel of the
supplied Raster as argument.
|
|---|
Returns the binary data unpacked into an array of bytes.
The line stride will be the width of the Raster.
| IllegalArgumentException | if isBinary() returns
false with the SampleModel of the
supplied Raster as argument.
|
|---|
Returns whether the image has contiguous data across rows.
Tests whether the color indices represent a gray-scale image.
| r | The red channel color indices. |
|---|---|
| g | The green channel color indices. |
| b | The blue channel color indices. |
true; otherwise, return false.
Sets the supplied Raster's data from an array
of packed binary data of the form returned by
getPackedBinaryData().
| IllegalArgumentException | if isBinary() returns
false with the SampleModel of the
supplied Raster as argument.
|
|---|
Copies data into the packed array of the Raster
from an array of unpacked data of the form returned by
getUnpackedBinaryData().
If the data are binary, then the target bit will be set if and only if the corresponding byte is non-zero.
| IllegalArgumentException | if isBinary() returns
false with the SampleModel of the
supplied Raster as argument.
|
|---|