APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.imageio.plugins.wbmp

public Class WBMPImageWriter

extends ImageWriter
Class Inheritance
Imports
java.awt.Point, .Rectangle, java.awt.image.DataBuffer, .DataBufferByte, .IndexColorModel, .MultiPixelPackedSampleModel, .Raster, .RenderedImage, .SampleModel, .WritableRaster, java.io.IOException, javax.imageio.IIOImage, .ImageTypeSpecifier, .ImageWriteParam, .ImageWriter, javax.imageio.metadata.IIOMetadata, javax.imageio.spi.ImageWriterSpi, javax.imageio.stream.ImageOutputStream, com.sun.imageio.plugins.common.I18N

The Java Image IO plugin writer for encoding a binary RenderedImage into a WBMP format. The encoding process may clip, subsample using the parameters specified in the ImageWriteParam.

Field Summary

Modifier and TypeField and Description
private ImageOutputStream
stream

The output stream to write into

Inherited from javax.imageio.ImageWriter:
availableLocaleslocaleoriginatingProvideroutputprogressListenerswarningListenerswarningLocales

Constructor Summary

AccessConstructor and Description
public
WBMPImageWriter(ImageWriterSpi originator)

Constructs WBMPImageWriter based on the provided ImageWriterSpi.

Method Summary

Modifier and TypeMethod and Description
public boolean
canWriteRasters()

Overrides javax.imageio.ImageWriter.canWriteRasters.

Returns true if the methods that take an IIOImage parameter are capable of dealing with a Raster (as opposed to RenderedImage) source image.

private void
public IIOMetadata
convertImageMetadata(IIOMetadata metadata, ImageTypeSpecifier type, ImageWriteParam param)

Implements abstract javax.imageio.ImageWriter.convertImageMetadata.

Implements javax.imageio.ImageTranscoder.convertImageMetadata.

Returns an IIOMetadata object that may be used for encoding and optionally modified using its document interfaces or other interfaces specific to the writer plug-in that will be used for encoding.

public IIOMetadata
convertStreamMetadata(IIOMetadata inData, ImageWriteParam param)

Implements abstract javax.imageio.ImageWriter.convertStreamMetadata.

Implements javax.imageio.ImageTranscoder.convertStreamMetadata.

Returns an IIOMetadata object that may be used for encoding and optionally modified using its document interfaces or other interfaces specific to the writer plug-in that will be used for encoding.

public IIOMetadata
getDefaultImageMetadata(ImageTypeSpecifier imageType, ImageWriteParam param)

Implements abstract javax.imageio.ImageWriter.getDefaultImageMetadata.

Returns an IIOMetadata object containing default values for encoding an image of the given type.

public IIOMetadata
getDefaultStreamMetadata(ImageWriteParam param)

Implements abstract javax.imageio.ImageWriter.getDefaultStreamMetadata.

Returns an IIOMetadata object containing default values for encoding a stream of images.

private static int
getNumBits(int intValue)

private static byte[]
intToMultiByte(int intValue)

public void
reset()

Overrides javax.imageio.ImageWriter.reset.

Restores the ImageWriter to its initial state.

public void
setOutput(Object output)

Overrides javax.imageio.ImageWriter.setOutput.

Sets the destination to the given ImageOutputStream or other Object.

public void
write(IIOMetadata streamMetadata, IIOImage image, ImageWriteParam param)

Implements abstract javax.imageio.ImageWriter.write.

Appends a complete image stream containing a single image and associated stream and image metadata and thumbnails to the output.

Inherited from javax.imageio.ImageWriter:
abortabortRequestedaddIIOWriteProgressListeneraddIIOWriteWarningListenercanInsertEmptycanInsertImagecanRemoveImagecanReplaceImageMetadatacanReplacePixelscanReplaceStreamMetadatacanWriteEmptycanWriteSequenceclearAbortRequestdisposeendInsertEmptyendReplacePixelsendWriteEmptyendWriteSequencegetAvailableLocalesgetDefaultWriteParamgetLocalegetNumThumbnailsSupportedgetOriginatingProvidergetOutputgetPreferredThumbnailSizesprepareInsertEmptyprepareReplacePixelsprepareWriteEmptyprepareWriteSequenceprocessImageCompleteprocessImageProgressprocessImageStartedprocessThumbnailCompleteprocessThumbnailProgressprocessThumbnailStartedprocessWarningOccurredprocessWarningOccurredprocessWriteAbortedremoveAllIIOWriteProgressListenersremoveAllIIOWriteWarningListenersremoveIIOWriteProgressListenerremoveIIOWriteWarningListenerremoveImagereplaceImageMetadatareplacePixelsreplacePixelsreplaceStreamMetadatasetLocalewritewritewriteInsertwriteToSequence

Field Detail

streamback to summary
private ImageOutputStream stream

The output stream to write into

Constructor Detail

WBMPImageWriterback to summary
public WBMPImageWriter(ImageWriterSpi originator)

Constructs WBMPImageWriter based on the provided ImageWriterSpi.

Method Detail

canWriteRastersback to summary
public boolean canWriteRasters()

Overrides javax.imageio.ImageWriter.canWriteRasters.

Doc from javax.imageio.ImageWriter.canWriteRasters.

Returns true if the methods that take an IIOImage parameter are capable of dealing with a Raster (as opposed to RenderedImage) source image. If this method returns false, then those methods will throw an UnsupportedOperationException if supplied with an IIOImage containing a Raster.

The default implementation returns false.

Annotations
@Override
checkSampleModelback to summary
private void checkSampleModel(SampleModel sm)
convertImageMetadataback to summary
public IIOMetadata convertImageMetadata(IIOMetadata metadata, ImageTypeSpecifier type, ImageWriteParam param)

Implements abstract javax.imageio.ImageWriter.convertImageMetadata.

Implements javax.imageio.ImageTranscoder.convertImageMetadata.

Doc from javax.imageio.ImageTranscoder.convertImageMetadata.

Returns an IIOMetadata object that may be used for encoding and optionally modified using its document interfaces or other interfaces specific to the writer plug-in that will be used for encoding.

An optional ImageWriteParam may be supplied for cases where it may affect the structure of the image metadata.

If the supplied ImageWriteParam contains optional setting values not understood by this writer or transcoder, they will be ignored.

Annotations
@Override
convertStreamMetadataback to summary
public IIOMetadata convertStreamMetadata(IIOMetadata inData, ImageWriteParam param)

Implements abstract javax.imageio.ImageWriter.convertStreamMetadata.

Implements javax.imageio.ImageTranscoder.convertStreamMetadata.

Doc from javax.imageio.ImageTranscoder.convertStreamMetadata.

Returns an IIOMetadata object that may be used for encoding and optionally modified using its document interfaces or other interfaces specific to the writer plug-in that will be used for encoding.

An optional ImageWriteParam may be supplied for cases where it may affect the structure of the stream metadata.

If the supplied ImageWriteParam contains optional setting values not understood by this writer or transcoder, they will be ignored.

Annotations
@Override
getDefaultImageMetadataback to summary
public IIOMetadata getDefaultImageMetadata(ImageTypeSpecifier imageType, ImageWriteParam param)

Implements abstract javax.imageio.ImageWriter.getDefaultImageMetadata.

Doc from javax.imageio.ImageWriter.getDefaultImageMetadata.

Returns an IIOMetadata object containing default values for encoding an image of the given type. The contents of the object may be manipulated using either the XML tree structure returned by the IIOMetadata.getAsTree method, an IIOMetadataController object, or via plug-in specific interfaces, and the resulting data supplied to one of the write methods that take a stream metadata parameter.

An optional ImageWriteParam may be supplied for cases where it may affect the structure of the image metadata.

If the supplied ImageWriteParam contains optional setting values not supported by this writer (e.g. progressive encoding or any format-specific settings), they will be ignored.

Annotations
@Override
getDefaultStreamMetadataback to summary
public IIOMetadata getDefaultStreamMetadata(ImageWriteParam param)

Implements abstract javax.imageio.ImageWriter.getDefaultStreamMetadata.

Doc from javax.imageio.ImageWriter.getDefaultStreamMetadata.

Returns an IIOMetadata object containing default values for encoding a stream of images. The contents of the object may be manipulated using either the XML tree structure returned by the IIOMetadata.getAsTree method, an IIOMetadataController object, or via plug-in specific interfaces, and the resulting data supplied to one of the write methods that take a stream metadata parameter.

An optional ImageWriteParam may be supplied for cases where it may affect the structure of the stream metadata.

If the supplied ImageWriteParam contains optional setting values not supported by this writer (e.g. progressive encoding or any format-specific settings), they will be ignored.

Writers that do not make use of stream metadata (e.g., writers for single-image formats) should return null.

Annotations
@Override
getNumBitsback to summary
private static int getNumBits(int intValue)
intToMultiByteback to summary
private static byte[] intToMultiByte(int intValue)
resetback to summary
public void reset()

Overrides javax.imageio.ImageWriter.reset.

Doc from javax.imageio.ImageWriter.reset.

Restores the ImageWriter to its initial state.

The default implementation calls setOutput(null), setLocale(null), removeAllIIOWriteWarningListeners(), removeAllIIOWriteProgressListeners(), and clearAbortRequest.

Annotations
@Override
setOutputback to summary
public void setOutput(Object output)

Overrides javax.imageio.ImageWriter.setOutput.

Doc from javax.imageio.ImageWriter.setOutput.

Sets the destination to the given ImageOutputStream or other Object. The destination is assumed to be ready to accept data, and will not be closed at the end of each write. This allows distributed imaging applications to transmit a series of images over a single network connection. If output is null, any currently set output will be removed.

If output is an ImageOutputStream, calls to the write, writeToSequence, and prepareWriteEmpty/endWriteEmpty methods will preserve the existing contents of the stream. Other write methods, such as writeInsert, replaceStreamMetadata, replaceImageMetadata, replacePixels, prepareInsertEmpty/endInsertEmpty, and endWriteSequence, require the full contents of the stream to be readable and writable, and may alter any portion of the stream.

Use of a general Object other than an ImageOutputStream is intended for writers that interact directly with an output device or imaging protocol. The set of legal classes is advertised by the writer's service provider's getOutputTypes method; most writers will return a single-element array containing only ImageOutputStream.class to indicate that they accept only an ImageOutputStream.

The default implementation sets the output instance variable to the value of output after checking output against the set of classes advertised by the originating provider, if there is one.

Annotations
@Override
writeback to summary
public void write(IIOMetadata streamMetadata, IIOImage image, ImageWriteParam param) throws IOException

Implements abstract javax.imageio.ImageWriter.write.

Doc from javax.imageio.ImageWriter.write.

Appends a complete image stream containing a single image and associated stream and image metadata and thumbnails to the output. Any necessary header information is included. If the output is an ImageOutputStream, its existing contents prior to the current seek position are not affected, and need not be readable or writable.

The output must have been set beforehand using the setOutput method.

Stream metadata may optionally be supplied; if it is null, default stream metadata will be used.

If canWriteRasters returns true, the IIOImage may contain a Raster source. Otherwise, it must contain a RenderedImage source.

The supplied thumbnails will be resized if needed, and any thumbnails in excess of the supported number will be ignored. If the format requires additional thumbnails that are not provided, the writer should generate them internally.

An ImageWriteParam may optionally be supplied to control the writing process. If param is null, a default write param will be used.

If the supplied ImageWriteParam contains optional setting values not supported by this writer (e.g. progressive encoding or any format-specific settings), they will be ignored.

Annotations
@Override
Exceptions
IOException:
if an error occurs during writing.