當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageReaderSpi.getNativeImageMetadataFormatName方法代碼示例

本文整理匯總了Java中javax.imageio.spi.ImageReaderSpi.getNativeImageMetadataFormatName方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageReaderSpi.getNativeImageMetadataFormatName方法的具體用法?Java ImageReaderSpi.getNativeImageMetadataFormatName怎麽用?Java ImageReaderSpi.getNativeImageMetadataFormatName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.imageio.spi.ImageReaderSpi的用法示例。


在下文中一共展示了ImageReaderSpi.getNativeImageMetadataFormatName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import javax.imageio.spi.ImageReaderSpi; //導入方法依賴的package包/類
public static void main(String[] args) {
    fmts = new Hashtable();

    fmts.put("javax_imageio_jpeg_stream_1.0", Boolean.FALSE);
    fmts.put("javax_imageio_jpeg_image_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_png_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_bmp_1.0",         Boolean.FALSE);
    fmts.put("javax_imageio_wbmp_1.0",        Boolean.FALSE);
    fmts.put("javax_imageio_gif_stream_1.0",  Boolean.FALSE);
    fmts.put("javax_imageio_gif_image_1.0",   Boolean.FALSE);

    IIORegistry registry = IIORegistry.getDefaultInstance();
    Iterator iter = registry.getServiceProviders(ImageReaderSpi.class,
                                                 false);
    while(iter.hasNext()) {
        ImageReaderSpi spi = (ImageReaderSpi)iter.next();
        String fmt_name;
        fmt_name = spi.getNativeStreamMetadataFormatName();
        testStreamMetadataFormat(spi, fmt_name);

        fmt_name = spi.getNativeImageMetadataFormatName();
        testImageMetadataFormat(spi, fmt_name);

        String[] fmt_names;
        fmt_names = spi.getExtraStreamMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testStreamMetadataFormat(spi, fmt_names[i]);
        }

        fmt_names = spi.getExtraImageMetadataFormatNames();
        for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
            testImageMetadataFormat(spi, fmt_names[i]);
        }
    }
    Enumeration keys = fmts.keys();
    while (keys.hasMoreElements()) {
        String key = (String)keys.nextElement();
        boolean val = ((Boolean)fmts.get(key)).booleanValue();
        if (!val) {
            throw new RuntimeException("Test failed: format " +
                                       key + "is not registered.");
        }
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:45,代碼來源:RegisteredFormatsTest.java


注:本文中的javax.imageio.spi.ImageReaderSpi.getNativeImageMetadataFormatName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。