当前位置: 首页>>代码示例>>Java>>正文


Java ImageIO.scanForPlugins方法代码示例

本文整理汇总了Java中javax.imageio.ImageIO.scanForPlugins方法的典型用法代码示例。如果您正苦于以下问题:Java ImageIO.scanForPlugins方法的具体用法?Java ImageIO.scanForPlugins怎么用?Java ImageIO.scanForPlugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.imageio.ImageIO的用法示例。


在下文中一共展示了ImageIO.scanForPlugins方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testCreateOverviewFile

import javax.imageio.ImageIO; //导入方法依赖的package包/类
/**
 * Test method for {@link org.geoimage.viewer.widget.GeoOverviewToolbar#GeoOverviewToolbar()}.
 */
@Test
public void testCreateOverviewFile() {
	try{
		ImageIO.scanForPlugins();
		Object o=ImageIO.getImageReadersByFormatName("tiff");
		List<GeoImageReader> readers= GeoImageReaderFactory.createReaderForName(safe,PlatformConfiguration.getConfigurationInstance().getS1GeolocationAlgorithm());
		Sentinel1SLC slc=(Sentinel1SLC)(readers.get(0));
		
		Overview overview=new Overview(null);
		overview.setGir(slc);
		overview.buildOverview();
		
		assertTrue(true);
	}catch(Exception e){
		e.printStackTrace();
		assertTrue(false);
	}	
	
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:23,代码来源:OverviewTest.java

示例2: write

import javax.imageio.ImageIO; //导入方法依赖的package包/类
public void write (String filename, boolean append) throws IOException {
    try {
        BufferedImage img;
        //Force the gif decoder to get registered
        Object o = com.sun.imageio.plugins.gif.GIFImageReader.class;
        ImageIO.scanForPlugins();
        
        img = ImageIO.read(new File(filename));
            write (img, append, filename);
            
    } catch (Exception ioe) {
        System.err.println("Could not write " + filename + " - " + ioe.getMessage());
        ioe.printStackTrace();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:CacheWriter.java

示例3: initIIOReadFormats

import javax.imageio.ImageIO; //导入方法依赖的package包/类
private static void initIIOReadFormats() {
    List spis = new ArrayList();
    List shortNames = new ArrayList();

    ImageIO.scanForPlugins();
    IIORegistry registry = IIORegistry.getDefaultInstance();
    java.util.Iterator readerspis =
        registry.getServiceProviders(ImageReaderSpi.class, false);
    while (readerspis.hasNext()) {
        // REMIND: there could be more than one non-core plugin for
        // a particular format, as is the case for JPEG2000 in the JAI
        // IIO Tools package, so we should support that somehow
        ImageReaderSpi spi = (ImageReaderSpi)readerspis.next();
        String klass = spi.getClass().getName();
        String format = spi.getFormatNames()[0].toLowerCase();
        String suffix = spi.getFileSuffixes()[0].toLowerCase();
        if (suffix == null || suffix.equals("")) {
            suffix = format;
        }
        String shortName;
        if (klass.startsWith("com.sun.imageio.plugins")) {
            shortName = "core-" + suffix;
        } else {
            shortName = "ext-" + suffix;
        }
        spis.add(spi);
        shortNames.add(shortName);
    }

    imageioReaderSpis = new ImageReaderSpi[spis.size()];
    imageioReaderSpis = (ImageReaderSpi[])spis.toArray(imageioReaderSpis);
    imageioReadFormatShortNames = new String[shortNames.size()];
    imageioReadFormatShortNames =
        (String[])shortNames.toArray(imageioReadFormatShortNames);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:InputImageTests.java

示例4: initIIOWriteFormats

import javax.imageio.ImageIO; //导入方法依赖的package包/类
private static void initIIOWriteFormats() {
    List spis = new ArrayList();
    List shortNames = new ArrayList();

    ImageIO.scanForPlugins();
    IIORegistry registry = IIORegistry.getDefaultInstance();
    java.util.Iterator writerspis =
        registry.getServiceProviders(ImageWriterSpi.class, false);
    while (writerspis.hasNext()) {
        // REMIND: there could be more than one non-core plugin for
        // a particular format, as is the case for JPEG2000 in the JAI
        // IIO Tools package, so we should support that somehow
        ImageWriterSpi spi = (ImageWriterSpi)writerspis.next();
        String klass = spi.getClass().getName();
        String format = spi.getFormatNames()[0].toLowerCase();
        String suffix = spi.getFileSuffixes()[0].toLowerCase();
        if (suffix == null || suffix.equals("")) {
            suffix = format;
        }
        String shortName;
        if (klass.startsWith("com.sun.imageio.plugins")) {
            shortName = "core-" + suffix;
        } else {
            shortName = "ext-" + suffix;
        }
        spis.add(spi);
        shortNames.add(shortName);
    }

    imageioWriterSpis = new ImageWriterSpi[spis.size()];
    imageioWriterSpis = (ImageWriterSpi[])spis.toArray(imageioWriterSpis);
    imageioWriteFormatShortNames = new String[shortNames.size()];
    imageioWriteFormatShortNames =
        (String[])shortNames.toArray(imageioWriteFormatShortNames);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:OutputImageTests.java


注:本文中的javax.imageio.ImageIO.scanForPlugins方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。