Class IIOUtil
java.lang.Object
com.twelvemonkeys.imageio.util.IIOUtil
IIOUtil
- Version:
- $Id: IIOUtil.java,v 1.0 May 8, 2008 3:04:54 PM haraldk Exp$
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InputStreamcreateStreamAdapter(ImageInputStream pStream) Creates anInputStreamadapter that reads from an underlyingImageInputStream.static InputStreamcreateStreamAdapter(ImageInputStream pStream, long pLength) Creates anInputStreamadapter that reads from an underlyingImageInputStream.static OutputStreamcreateStreamAdapter(ImageOutputStream pStream) Creates anOutputStreamadapter that writes to an underlyingImageOutputStream.static <T> voidderegisterProvider(ServiceRegistry registry, IIOServiceProvider provider, Class<T> category) THIS METHOD WILL BE MOVED/RENAMED, DO NOT USE.static BufferedImagefakeAOI(BufferedImage pImage, Rectangle pSourceRegion) static ImagefakeSubsampling(Image pImage, IIOParam pParam) static String[]Returns a sorted array of format names, that can be read by ImageIO.static String[]Returns a sorted array of format names, that can be written by ImageIO.static RectanglegetSourceRegion(IIOParam pParam, int pSrcWidth, int pSrcHeight) static <T> TlookupProviderByName(ServiceRegistry registry, String providerClassName, Class<T> category) THIS METHOD WILL BE MOVED/RENAMED, DO NOT USE.private static String[]normalizeNames(String[] names) static voidsubsampleRow(byte[] srcRow, int srcPos, int srcWidth, byte[] destRow, int destPos, int samplesPerPixel, int bitsPerSample, int samplePeriod) static voidsubsampleRow(double[] srcRow, int srcPos, int srcWidth, double[] destRow, int destPos, int samplesPerPixel, int bitsPerSample, int samplePeriod) static voidsubsampleRow(float[] srcRow, int srcPos, int srcWidth, float[] destRow, int destPos, int samplesPerPixel, int bitsPerSample, int samplePeriod) static voidsubsampleRow(int[] srcRow, int srcPos, int srcWidth, int[] destRow, int destPos, int samplesPerPixel, int bitsPerSample, int samplePeriod) static voidsubsampleRow(short[] srcRow, int srcPos, int srcWidth, short[] destRow, int destPos, int samplesPerPixel, int bitsPerSample, int samplePeriod)
-
Constructor Details
-
IIOUtil
private IIOUtil()
-
-
Method Details
-
createStreamAdapter
Creates anInputStreamadapter that reads from an underlyingImageInputStream. The input stream will read until the end ofpStream.- Parameters:
pStream- the stream to read from.- Returns:
- an
InputStreamreading frompStream.
-
createStreamAdapter
Creates anInputStreamadapter that reads from an underlyingImageInputStream. The input stream will read until the end ofpStream, or at mostpLengthbytes has been read.- Parameters:
pStream- the stream to read from.pLength- the maximum number of bytes that can be read frompStream.- Returns:
- an
InputStreamreading frompStream.
-
createStreamAdapter
Creates anOutputStreamadapter that writes to an underlyingImageOutputStream.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
OutputSteamwriting topStream.
-
fakeSubsampling
-
getSourceRegion
-
fakeAOI
-
deregisterProvider
public static <T> void deregisterProvider(ServiceRegistry registry, IIOServiceProvider provider, Class<T> category) THIS METHOD WILL BE MOVED/RENAMED, DO NOT USE.- Parameters:
registry- the registry to unregister from.provider- the provider to unregister.category- the category to unregister from.
-
lookupProviderByName
public static <T> T lookupProviderByName(ServiceRegistry registry, String providerClassName, Class<T> category) THIS METHOD WILL BE MOVED/RENAMED, DO NOT USE.- Parameters:
registry- the registry to lookup from.providerClassName- name of the provider class.category- provider category- Returns:
- the provider instance, or
nullif not found
-
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:
-
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:
-
normalizeNames
-
subsampleRow
public static void subsampleRow(byte[] srcRow, int srcPos, int srcWidth, byte[] destRow, int destPos, int samplesPerPixel, int bitsPerSample, int samplePeriod) -
subsampleRow
public static void subsampleRow(short[] srcRow, int srcPos, int srcWidth, short[] destRow, int destPos, int samplesPerPixel, int bitsPerSample, int samplePeriod) -
subsampleRow
public static void subsampleRow(int[] srcRow, int srcPos, int srcWidth, int[] destRow, int destPos, int samplesPerPixel, int bitsPerSample, int samplePeriod) -
subsampleRow
public static void subsampleRow(float[] srcRow, int srcPos, int srcWidth, float[] destRow, int destPos, int samplesPerPixel, int bitsPerSample, int samplePeriod) -
subsampleRow
public static void subsampleRow(double[] srcRow, int srcPos, int srcWidth, double[] destRow, int destPos, int samplesPerPixel, int bitsPerSample, int samplePeriod)
-