FileDocCategorySizeDatePackage
BMPImageWriterSpi.javaAPI DocJava SE 5 API2668Fri Aug 26 14:54:42 BST 2005com.sun.imageio.plugins.bmp

BMPImageWriterSpi

public class BMPImageWriterSpi extends ImageWriterSpi

Fields Summary
private static String[]
readerSpiNames
private static String[]
formatNames
private static String[]
entensions
private static String[]
mimeType
private boolean
registered
Constructors Summary
public BMPImageWriterSpi()


      
        super("Sun Microsystems, Inc.",
              "1.0",
              formatNames,
              entensions,
              mimeType,
              "com.sun.imageio.plugins.bmp.BMPImageWriter",
              STANDARD_OUTPUT_TYPE,
              readerSpiNames,
              false,
              null, null, null, null,
              true,
              BMPMetadata.nativeMetadataFormatName,
              "com.sun.imageio.plugins.bmp.BMPMetadataFormat",
              null, null);
    
Methods Summary
public booleancanEncodeImage(javax.imageio.ImageTypeSpecifier type)

        int dataType= type.getSampleModel().getDataType();
        if (dataType < DataBuffer.TYPE_BYTE || dataType > DataBuffer.TYPE_INT)
            return false;
       
        SampleModel sm = type.getSampleModel();
        int numBands = sm.getNumBands();
        if (!(numBands == 1 || numBands == 3))
            return false;
        
        if (numBands == 1 && dataType != DataBuffer.TYPE_BYTE)
            return false;
        
        if (dataType > DataBuffer.TYPE_BYTE && 
              !(sm instanceof SinglePixelPackedSampleModel))
            return false;
        
        return true;
    
public javax.imageio.ImageWritercreateWriterInstance(java.lang.Object extension)

        return new BMPImageWriter(this);
    
public java.lang.StringgetDescription(java.util.Locale locale)

        return "Standard BMP Image Writer";
    
public voidonRegistration(javax.imageio.spi.ServiceRegistry registry, java.lang.Class category)

        if (registered) {
            return;
        }

        registered = true;