FileDocCategorySizeDatePackage
GIFImageWriterSpi.javaAPI DocJava SE 6 API2530Tue Jun 10 00:21:52 BST 2008com.sun.imageio.plugins.gif

GIFImageWriterSpi

public class GIFImageWriterSpi extends ImageWriterSpi

Fields Summary
private static final String
vendorName
private static final String
version
private static final String[]
names
private static final String[]
suffixes
private static final String[]
MIMETypes
private static final String
writerClassName
private static final String[]
readerSpiNames
Constructors Summary
public GIFImageWriterSpi()


      
        super(vendorName,
              version,
              names,
              suffixes,
              MIMETypes,
              writerClassName,
              STANDARD_OUTPUT_TYPE,
              readerSpiNames,
              true,
              GIFWritableStreamMetadata.NATIVE_FORMAT_NAME,
              "com.sun.imageio.plugins.gif.GIFStreamMetadataFormat",
              null, null,
              true,
              GIFWritableImageMetadata.NATIVE_FORMAT_NAME,
              "com.sun.imageio.plugins.gif.GIFImageMetadataFormat",
              null, null
              );
    
Methods Summary
public booleancanEncodeImage(javax.imageio.ImageTypeSpecifier type)

        if (type == null) {
            throw new IllegalArgumentException("type == null!");
        }

        SampleModel sm = type.getSampleModel();
        ColorModel cm = type.getColorModel();

        boolean canEncode = sm.getNumBands() == 1 &&
            sm.getSampleSize(0) <= 8 &&
            sm.getWidth() <= 65535 &&
            sm.getHeight() <= 65535 &&
            (cm == null || cm.getComponentSize()[0] <= 8);

        if (canEncode) {
            return true;
        } else {
            return PaletteBuilder.canCreatePalette(type);
        }
    
public javax.imageio.ImageWritercreateWriterInstance(java.lang.Object extension)

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

        return "Standard GIF image writer";