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


Java ImageTranscoderSpi类代码示例

本文整理汇总了Java中javax.imageio.spi.ImageTranscoderSpi的典型用法代码示例。如果您正苦于以下问题:Java ImageTranscoderSpi类的具体用法?Java ImageTranscoderSpi怎么用?Java ImageTranscoderSpi使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getImageTranscoders

import javax.imageio.spi.ImageTranscoderSpi; //导入依赖的package包/类
/**
 * Returns an <code>Iterator</code> containing all currently
 * registered <code>ImageTranscoder</code>s that claim to be
 * able to transcode between the metadata of the given
 * <code>ImageReader</code> and <code>ImageWriter</code>.
 *
 * @param reader an <code>ImageReader</code>.
 * @param writer an <code>ImageWriter</code>.
 *
 * @return an <code>Iterator</code> containing
 * <code>ImageTranscoder</code>s.
 *
 * @exception IllegalArgumentException if <code>reader</code> or
 * <code>writer</code> is <code>null</code>.
 */
public static Iterator<ImageTranscoder>
    getImageTranscoders(ImageReader reader, ImageWriter writer)
{
    if (reader == null) {
        throw new IllegalArgumentException("reader == null!");
    }
    if (writer == null) {
        throw new IllegalArgumentException("writer == null!");
    }
    ImageReaderSpi readerSpi = reader.getOriginatingProvider();
    ImageWriterSpi writerSpi = writer.getOriginatingProvider();
    ServiceRegistry.Filter filter =
        new TranscoderFilter(readerSpi, writerSpi);

    Iterator iter;
    // Ensure category is present
    try {
        iter = theRegistry.getServiceProviders(ImageTranscoderSpi.class,
                                        filter, true);
    } catch (IllegalArgumentException e) {
        return Collections.emptyIterator();
    }
    return new ImageTranscoderIterator(iter);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:40,代码来源:ImageIO.java

示例2: getImageTranscoders

import javax.imageio.spi.ImageTranscoderSpi; //导入依赖的package包/类
/**
 * Returns an {@code Iterator} containing all currently
 * registered {@code ImageTranscoder}s that claim to be
 * able to transcode between the metadata of the given
 * {@code ImageReader} and {@code ImageWriter}.
 *
 * @param reader an {@code ImageReader}.
 * @param writer an {@code ImageWriter}.
 *
 * @return an {@code Iterator} containing
 * {@code ImageTranscoder}s.
 *
 * @exception IllegalArgumentException if {@code reader} or
 * {@code writer} is {@code null}.
 */
public static Iterator<ImageTranscoder>
    getImageTranscoders(ImageReader reader, ImageWriter writer)
{
    if (reader == null) {
        throw new IllegalArgumentException("reader == null!");
    }
    if (writer == null) {
        throw new IllegalArgumentException("writer == null!");
    }
    ImageReaderSpi readerSpi = reader.getOriginatingProvider();
    ImageWriterSpi writerSpi = writer.getOriginatingProvider();
    ServiceRegistry.Filter filter =
        new TranscoderFilter(readerSpi, writerSpi);

    Iterator<ImageTranscoderSpi> iter;
    // Ensure category is present
    try {
        iter = theRegistry.getServiceProviders(ImageTranscoderSpi.class,
                                        filter, true);
    } catch (IllegalArgumentException e) {
        return Collections.emptyIterator();
    }
    return new ImageTranscoderIterator(iter);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:40,代码来源:ImageIO.java

示例3: getImageTranscoders

import javax.imageio.spi.ImageTranscoderSpi; //导入依赖的package包/类
/**
 * Returns an <code>Iterator</code> containing all currently registered <code>ImageTranscoder</code>s that
 * claim to be able to transcode between the metadata of the given <code>ImageReader</code> and
 * <code>ImageWriter</code>.
 * 
 * @param reader
 *            an <code>ImageReader</code>.
 * @param writer
 *            an <code>ImageWriter</code>.
 * 
 * @return an <code>Iterator</code> containing <code>ImageTranscoder</code>s.
 * 
 * @exception IllegalArgumentException
 *                if <code>reader</code> or <code>writer</code> is <code>null</code>.
 */
public static Iterator<ImageTranscoder> getImageTranscoders(ImageReader reader, ImageWriter writer) {
	if (reader == null) {
		throw new IllegalArgumentException("reader == null!");
	}
	if (writer == null) {
		throw new IllegalArgumentException("writer == null!");
	}
	ImageReaderSpi readerSpi = reader.getOriginatingProvider();
	ImageWriterSpi writerSpi = writer.getOriginatingProvider();
	ServiceRegistry.Filter filter = new TranscoderFilter(readerSpi, writerSpi);

	Iterator iter;
	// Ensure category is present
	try {
		iter = theRegistry.getServiceProviders(ImageTranscoderSpi.class, filter, true);
	} catch (IllegalArgumentException e) {
		return new HashSet().iterator();
	}
	return new ImageTranscoderIterator(iter);
}
 
开发者ID:MKLab-ITI,项目名称:multimedia-indexing,代码行数:36,代码来源:ImageIOGreyScale.java

示例4: filter

import javax.imageio.spi.ImageTranscoderSpi; //导入依赖的package包/类
public boolean filter(Object elt) {
    ImageTranscoderSpi spi = (ImageTranscoderSpi)elt;
    String readerName = spi.getReaderServiceProviderName();
    String writerName = spi.getWriterServiceProviderName();
    return (readerName.equals(readerSpiName) &&
            writerName.equals(writerSpiName));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:ImageIO.java

示例5: filter

import javax.imageio.spi.ImageTranscoderSpi; //导入依赖的package包/类
public boolean filter(Object provider)
{
  if (provider instanceof ImageTranscoderSpi)
    {
      ImageTranscoderSpi spi = (ImageTranscoderSpi) provider;

      if (spi.getReaderServiceProviderName().equals
          (reader.getOriginatingProvider().getClass().getName())
          && spi.getWriterServiceProviderName().equals
          (writer.getOriginatingProvider().getClass().getName()))
        return true;
    }

  return false;
}
 
开发者ID:vilie,项目名称:javify,代码行数:16,代码来源:ImageIO.java

示例6: getImageTranscoders

import javax.imageio.spi.ImageTranscoderSpi; //导入依赖的package包/类
/**
 * Retrieve an iterator over a collection of image transcoders that
 * support transcoding from the given image reader's metadata format
 * to the given writer's metadata format.
 *
 * @param reader an image reader
 * @param writer an image writer
 *
 * @return an iterator over a collection of image transcoders
 *
 * @exception IllegalArgumentException if either reader or writer is
 * null
 */
public static Iterator<ImageTranscoder> getImageTranscoders (ImageReader reader,
                                                             ImageWriter writer)
{
  if (reader == null || writer == null)
    throw new IllegalArgumentException ("null argument");

  final Iterator<ImageTranscoderSpi> spiIterator
    = getRegistry().getServiceProviders (ImageTranscoderSpi.class,
                                         new TranscoderFilter (reader,
                                                               writer),
                                         true);
  return new Iterator<ImageTranscoder>()
  {
    public boolean hasNext()
    {
      return spiIterator.hasNext();
    }

    public ImageTranscoder next()
    {
      return spiIterator.next().createTranscoderInstance();
    }

    public void remove()
    {
      throw new UnsupportedOperationException();
    }
  };
}
 
开发者ID:vilie,项目名称:javify,代码行数:43,代码来源:ImageIO.java

示例7: filter

import javax.imageio.spi.ImageTranscoderSpi; //导入依赖的package包/类
public boolean filter(Object provider)
 {
   if (provider instanceof ImageTranscoderSpi)
     {
       ImageTranscoderSpi spi = (ImageTranscoderSpi) provider;

if (spi.getReaderServiceProviderName().equals
    (reader.getOriginatingProvider().getClass().getName())
    && spi.getWriterServiceProviderName().equals
    (writer.getOriginatingProvider().getClass().getName()))
  return true;
     }

   return false;
 }
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:16,代码来源:ImageIO.java

示例8: getImageTranscoders

import javax.imageio.spi.ImageTranscoderSpi; //导入依赖的package包/类
/**
 * Retrieve an iterator over a collection of image transcoders that
 * support transcoding from the given image reader's metadata format
 * to the given writer's metadata format.
 *
 * @param reader an image reader
 * @param writer an image writer
 *
 * @return an iterator over a collection of image transcoders
 *
 * @exception IllegalArgumentException if either reader or writer is
 * null
 */
public static Iterator<ImageTranscoder> getImageTranscoders (ImageReader reader,
                                                             ImageWriter writer)
{
  if (reader == null || writer == null)
    throw new IllegalArgumentException ("null argument");

  final Iterator<ImageTranscoderSpi> spiIterator
    = getRegistry().getServiceProviders (ImageTranscoderSpi.class,
                                         new TranscoderFilter (reader,
                                                               writer),
                                         true);
  return new Iterator<ImageTranscoder>()
  {
    public boolean hasNext()
    {
      return spiIterator.hasNext();
    }
    
    public ImageTranscoder next()
    {
      return spiIterator.next().createTranscoderInstance();
    }
    
    public void remove()
    {
      throw new UnsupportedOperationException();
    }
  };
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:43,代码来源:ImageIO.java

示例9: ImageTranscoderIterator

import javax.imageio.spi.ImageTranscoderSpi; //导入依赖的package包/类
public ImageTranscoderIterator(Iterator<ImageTranscoderSpi> iter) {
    this.iter = iter;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:4,代码来源:ImageIO.java

示例10: next

import javax.imageio.spi.ImageTranscoderSpi; //导入依赖的package包/类
public ImageTranscoder next() {
    ImageTranscoderSpi spi = null;
    spi = iter.next();
    return spi.createTranscoderInstance();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:ImageIO.java


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