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

public Class BMPImageWriterSpi

extends ImageWriterSpi
Class Inheritance
Imports
java.awt.image.DataBuffer, .SampleModel, .SinglePixelPackedSampleModel, javax.imageio.spi.ImageWriterSpi, .ServiceRegistry, .IIORegistry, javax.imageio.stream.ImageOutputStream, javax.imageio.ImageWriter, .ImageTypeSpecifier, .IIOException, java.util.Locale, javax.imageio.plugins.bmp.BMPImageWriteParam

Field Summary

Modifier and TypeField and Description
private static String[]
private static String[]
private static String[]
private static String[]
private boolean
Inherited from javax.imageio.spi.ImageWriterSpi:
outputTypesSTANDARD_OUTPUT_TYPE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canEncodeImage(ImageTypeSpecifier type)

Implements abstract javax.imageio.spi.ImageWriterSpi.canEncodeImage.

Returns true if the ImageWriter implementation associated with this service provider is able to encode an image with the given layout.

public ImageWriter
createWriterInstance(Object extension)

Implements abstract javax.imageio.spi.ImageWriterSpi.createWriterInstance.

Returns an instance of the ImageWriter implementation associated with this service provider.

public String
getDescription(Locale locale)

Implements abstract javax.imageio.spi.IIOServiceProvider.getDescription.

Returns a brief, human-readable description of this service provider and its associated implementation.

public void
onRegistration(ServiceRegistry registry, Class<?> category)

Overrides javax.imageio.spi.IIOServiceProvider.onRegistration.

Implements javax.imageio.spi.RegisterableService.onRegistration.

A callback that will be called exactly once after the Spi class has been instantiated and registered in a ServiceRegistry.

Inherited from javax.imageio.spi.ImageWriterSpi:
canEncodeImagecreateWriterInstancegetImageReaderSpiNamesgetOutputTypesisFormatLosslessisOwnWriter

Field Detail

extensionsback to summary
private static String[] extensions
formatNamesback to summary
private static String[] formatNames
mimeTypeback to summary
private static String[] mimeType
readerSpiNamesback to summary
private static String[] readerSpiNames

Hides javax.imageio.spi.ImageWriterSpi.readerSpiNames.

registeredback to summary
private boolean registered

Constructor Detail

BMPImageWriterSpiback to summary
public BMPImageWriterSpi()

Method Detail

canEncodeImageback to summary
public boolean canEncodeImage(ImageTypeSpecifier type)

Implements abstract javax.imageio.spi.ImageWriterSpi.canEncodeImage.

Doc from javax.imageio.spi.ImageWriterSpi.canEncodeImage.

Returns true if the ImageWriter implementation associated with this service provider is able to encode an image with the given layout. The layout (i.e., the image's SampleModel and ColorModel) is described by an ImageTypeSpecifier object.

A return value of true is not an absolute guarantee of successful encoding; the encoding process may still produce errors due to factors such as I/O errors, inconsistent or malformed data structures, etc. The intent is that a reasonable inspection of the basic structure of the image be performed in order to determine if it is within the scope of the encoding format. For example, a service provider for a format that can only encode greyscale would return false if handed an RGB BufferedImage. Similarly, a service provider for a format that can encode 8-bit RGB imagery might refuse to encode an image with an associated alpha channel.

Different ImageWriters, and thus service providers, may choose to be more or less strict. For example, they might accept an image with premultiplied alpha even though it will have to be divided out of each pixel, at some loss of precision, in order to be stored.

Annotations
@Override
createWriterInstanceback to summary
public ImageWriter createWriterInstance(Object extension) throws IIOException

Implements abstract javax.imageio.spi.ImageWriterSpi.createWriterInstance.

Doc from javax.imageio.spi.ImageWriterSpi.createWriterInstance.

Returns an instance of the ImageWriter implementation associated with this service provider. The returned object will initially be in an initial state as if its reset method had been called.

An Object may be supplied to the plug-in at construction time. The nature of the object is entirely plug-in specific.

Typically, a plug-in will implement this method using code such as return new MyImageWriter(this).

Annotations
@Override
getDescriptionback to summary
public String getDescription(Locale locale)

Implements abstract javax.imageio.spi.IIOServiceProvider.getDescription.

Doc from javax.imageio.spi.IIOServiceProvider.getDescription.

Returns a brief, human-readable description of this service provider and its associated implementation. The resulting string should be localized for the supplied Locale, if possible.

Annotations
@Override
onRegistrationback to summary
public void onRegistration(ServiceRegistry registry, Class<?> category)

Overrides javax.imageio.spi.IIOServiceProvider.onRegistration.

Implements javax.imageio.spi.RegisterableService.onRegistration.

Doc from javax.imageio.spi.IIOServiceProvider.onRegistration.

A callback that will be called exactly once after the Spi class has been instantiated and registered in a ServiceRegistry. This may be used to verify that the environment is suitable for this service, for example that native libraries can be loaded. If the service cannot function in the environment where it finds itself, it should deregister itself from the registry.

Only the registry should call this method.

The default implementation does nothing.

Annotations
@Override