New SPI info.

This commit is contained in:
Harald Kuhr
2015-03-20 15:35:26 +01:00
parent 26475eb004
commit b40d4dad17
36 changed files with 702 additions and 417 deletions

View File

@@ -28,48 +28,20 @@
package com.twelvemonkeys.imageio.plugins.sgi;
import com.twelvemonkeys.imageio.spi.ProviderInfo;
import com.twelvemonkeys.imageio.util.IIOUtil;
import com.twelvemonkeys.imageio.spi.ImageReaderSpiBase;
import javax.imageio.ImageReader;
import javax.imageio.spi.ImageReaderSpi;
import javax.imageio.stream.ImageInputStream;
import java.io.IOException;
import java.util.Locale;
public final class SGIImageReaderSpi extends ImageReaderSpi {
public final class SGIImageReaderSpi extends ImageReaderSpiBase {
/**
* Creates a {@code SGIImageReaderSpi}.
*/
public SGIImageReaderSpi() {
this(IIOUtil.getProviderInfo(SGIImageReaderSpi.class));
}
private SGIImageReaderSpi(final ProviderInfo providerInfo) {
super(
providerInfo.getVendorName(),
providerInfo.getVersion(),
new String[]{
"sgi",
"SGI"
},
new String[]{"sgi"},
new String[]{
// No official IANA record exists
"image/sgi",
"image/x-sgi",
},
"com.twelvemkonkeys.imageio.plugins.sgi.SGIImageReader",
new Class[] {ImageInputStream.class},
null,
true, // supports standard stream metadata
null, null, // native stream format name and class
null, null, // extra stream formats
true, // supports standard image metadata
null, null,
null, null // extra image metadata formats
);
super(new SGIProviderInfo());
}
@Override public boolean canDecodeInput(final Object source) throws IOException {

View File

@@ -0,0 +1,34 @@
package com.twelvemonkeys.imageio.plugins.sgi;
import com.twelvemonkeys.imageio.spi.ReaderWriterProviderInfo;
/**
* SGIProviderInfo.
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: harald.kuhr$
* @version $Id: SGIProviderInfo.java,v 1.0 20/03/15 harald.kuhr Exp$
*/
final class SGIProviderInfo extends ReaderWriterProviderInfo {
protected SGIProviderInfo() {
super(
SGIProviderInfo.class,
new String[] {
"sgi",
"SGI"
},
new String[] {"sgi"},
new String[] {
// No official IANA record exists
"image/sgi",
"image/x-sgi",
},
"com.twelvemkonkeys.imageio.plugins.sgi.SGIImageReader",
new String[] {"com.twelvemonkeys.imageio.plugins.sgi.SGIImageReaderSpi"},
null,
null,
false, null, null, null, null,
true, null, null, null, null
);
}
}