com.twelvemonkeys.imageio.util
Class IIOUtil

java.lang.Object
  extended by com.twelvemonkeys.imageio.util.IIOUtil

public final class IIOUtil
extends Object

IIOUtil

Version:
$Id: IIOUtil.java,v 1.0 May 8, 2008 3:04:54 PM haraldk Exp$
Author:
Harald Kuhr, last modified by $Author: haraldk$

Method Summary
static InputStream createStreamAdapter(ImageInputStream pStream)
          Creates an InputStream adapter that reads from an underlying ImageInputStream.
static InputStream createStreamAdapter(ImageInputStream pStream, long pLength)
          Creates an InputStream adapter that reads from an underlying ImageInputStream.
static OutputStream createStreamAdapter(ImageOutputStream pStream)
          Creates an OutputStream adapter that writes to an underlying ImageOutputStream.
static
<T> void
deregisterProvider(ServiceRegistry pRegistry, IIOServiceProvider pProvider, Class<T> pCategory)
          Deprecated.  
static BufferedImage fakeAOI(BufferedImage pImage, Rectangle pSourceRegion)
           
static Image fakeSubsampling(Image pImage, IIOParam pParam)
           
static String[] getNormalizedReaderFormatNames()
          Returns a sorted array of format names, that can be read by ImageIO.
static String[] getNormalizedWriterFormatNames()
          Returns a sorted array of format names, that can be written by ImageIO.
static ProviderInfo getProviderInfo(Class<? extends IIOServiceProvider> pProviderClass)
          Creates a ProviderInfo instance for the given service provider.
static Rectangle getSourceRegion(IIOParam pParam, int pSrcWidth, int pSrcHeight)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createStreamAdapter

public static InputStream createStreamAdapter(ImageInputStream pStream)
Creates an InputStream adapter that reads from an underlying ImageInputStream. The input stream will read until the end of pStream.

Parameters:
pStream - the stream to read from.
Returns:
an InputStream reading from pStream.

createStreamAdapter

public static InputStream createStreamAdapter(ImageInputStream pStream,
                                              long pLength)
Creates an InputStream adapter that reads from an underlying ImageInputStream. The input stream will read until the end of pStream, or at most pLength bytes has been read.

Parameters:
pStream - the stream to read from.
pLength - the maximum number of bytes that can be read from pStream.
Returns:
an InputStream reading from pStream.

createStreamAdapter

public static OutputStream createStreamAdapter(ImageOutputStream pStream)
Creates an OutputStream adapter that writes to an underlying ImageOutputStream.

Note: The adapter is buffered, and MUST be properly flushed/closed after use, otherwise data may be lost.

Parameters:
pStream - the stream to write to.
Returns:
an OutputSteam writing to pStream.

fakeSubsampling

public static Image fakeSubsampling(Image pImage,
                                    IIOParam pParam)

getSourceRegion

public static Rectangle getSourceRegion(IIOParam pParam,
                                        int pSrcWidth,
                                        int pSrcHeight)

fakeAOI

public static BufferedImage fakeAOI(BufferedImage pImage,
                                    Rectangle pSourceRegion)

getProviderInfo

public static ProviderInfo getProviderInfo(Class<? extends IIOServiceProvider> pProviderClass)
Creates a ProviderInfo instance for the given service provider.

Parameters:
pProviderClass - the provider class to get info for.
Returns:
the newly created ProviderInfo.

deregisterProvider

public static <T> void deregisterProvider(ServiceRegistry pRegistry,
                                          IIOServiceProvider pProvider,
                                          Class<T> pCategory)
Deprecated. 

THIS METHOD WILL ME MOVED/RENAMED, DO NOT USE.

Parameters:
pRegistry - the registry to unregister from
pProvider - the provider to unregister
pCategory - the category to unregister from

getNormalizedReaderFormatNames

public static String[] getNormalizedReaderFormatNames()
Returns a sorted array of format names, that can be read by ImageIO. The names are all upper-case, and contains no duplicates.

Returns:
a normalized array of Strings.
See Also:
ImageIO.getReaderFormatNames()

getNormalizedWriterFormatNames

public static String[] getNormalizedWriterFormatNames()
Returns a sorted array of format names, that can be written by ImageIO. The names are all upper-case, and contains no duplicates.

Returns:
a normalized array of Strings.
See Also:
ImageIO.getWriterFormatNames()


Copyright © 2015. All Rights Reserved.