Methods Summary |
---|
public static javax.imageio.stream.ImageInputStream | createImageInputStream(java.lang.Object input)Creates an ImageInputStream from the specified Object. The specified
Object should obtain the input source such as File, or InputStream.
if (input == null) {
throw new IllegalArgumentException("input source cannot be NULL");
}
Iterator<ImageInputStreamSpi> it = registry.getServiceProviders(ImageInputStreamSpi.class,
true);
while (it.hasNext()) {
ImageInputStreamSpi spi = it.next();
if (spi.getInputClass().isInstance(input)) {
return spi.createInputStreamInstance(input);
}
}
return null;
|
public static javax.imageio.stream.ImageOutputStream | createImageOutputStream(java.lang.Object output)Creates an ImageOutputStream using the specified Object. The specified
Object should obtain the output source such as File, or OutputStream.
if (output == null) {
throw new IllegalArgumentException("output destination cannot be NULL");
}
Iterator<ImageOutputStreamSpi> it = registry.getServiceProviders(
ImageOutputStreamSpi.class, true);
while (it.hasNext()) {
ImageOutputStreamSpi spi = it.next();
if (spi.getOutputClass().isInstance(output)) {
// todo - use getUseCache and getCacheDir here
return spi.createOutputStreamInstance(output);
}
}
return null;
|
public static java.io.File | getCacheDirectory()Gets the directory where cache files are created, returned the file which
is set by setCacheDirectory method, or null.
// TODO implement
// -- null indicates system-dep default temporary directory
return null;
|
public static javax.imageio.ImageReader | getImageReader(javax.imageio.ImageWriter writer)Gets an ImageReader object which corresponds to the specified
ImageWriter, or returns null if the specified ImageWriter is not
registered.
throw new UnsupportedOperationException("Not supported yet");
|
public static java.util.Iterator | getImageReaders(java.lang.Object input)Gets the Iterator of registered ImageReader which are able to decode an
input data specified by input Object.
if (input == null) {
throw new NullPointerException("input cannot be NULL");
}
Iterator<ImageReaderSpi> it = registry.getServiceProviders(ImageReaderSpi.class,
new CanReadFilter(input), true);
return new SpiIteratorToReadersIteratorWrapper(it);
|
public static java.util.Iterator | getImageReadersByFormatName(java.lang.String formatName)Gets the Iterator of registered ImageReader which are able to decode the
specified format.
if (formatName == null) {
throw new NullPointerException("format name cannot be NULL");
}
Iterator<ImageReaderSpi> it = registry.getServiceProviders(ImageReaderSpi.class,
new FormatFilter(formatName), true);
return new SpiIteratorToReadersIteratorWrapper(it);
|
public static java.util.Iterator | getImageReadersByMIMEType(java.lang.String MIMEType)Gets the Iterator of registered ImageReader objects that are able to
decode files with the specified MIME type.
throw new UnsupportedOperationException("Not supported yet");
|
public static java.util.Iterator | getImageReadersBySuffix(java.lang.String fileSuffix)Gets the Iterator which lists the registered ImageReader objects that are
able to decode files with the specified suffix.
if (fileSuffix == null) {
throw new NullPointerException("suffix cannot be NULL");
}
Iterator<ImageReaderSpi> it = registry.getServiceProviders(ImageReaderSpi.class,
new SuffixFilter(fileSuffix), true);
return new SpiIteratorToReadersIteratorWrapper(it);
|
public static java.util.Iterator | getImageTranscoders(javax.imageio.ImageReader reader, javax.imageio.ImageWriter writer)Gets the Iterator of registered ImageTranscoders which are able to
transcode the metadata of the specified ImageReader object to a suitable
object for encoding by the specified ImageWriter.
throw new UnsupportedOperationException("Not supported yet");
|
public static javax.imageio.ImageWriter | getImageWriter(javax.imageio.ImageReader reader)Gets an ImageWriter object which corresponds to the specified
ImageReader, or returns null if the specified ImageReader is not
registered.
throw new UnsupportedOperationException("Not supported yet");
|
public static java.util.Iterator | getImageWriters(javax.imageio.ImageTypeSpecifier type, java.lang.String formatName)Gets the Iterator of ImageWriter objects which are able to encode images
with the specified ImageTypeSpecifier and format.
if (type == null) {
throw new NullPointerException("type cannot be NULL");
}
if (formatName == null) {
throw new NullPointerException("format name cannot be NULL");
}
Iterator<ImageWriterSpi> it = registry.getServiceProviders(ImageWriterSpi.class,
new FormatAndEncodeFilter(type, formatName), true);
return new SpiIteratorToWritersIteratorWrapper(it);
|
public static java.util.Iterator | getImageWritersByFormatName(java.lang.String formatName)Gets the Iterator which lists the registered ImageReader objects that are
able to encode the specified image format.
if (formatName == null) {
throw new NullPointerException("format name cannot be NULL");
}
Iterator<ImageWriterSpi> it = registry.getServiceProviders(ImageWriterSpi.class,
new FormatFilter(formatName), true);
return new SpiIteratorToWritersIteratorWrapper(it);
|
public static java.util.Iterator | getImageWritersByMIMEType(java.lang.String MIMEType)Gets the Iterator which lists the registered ImageReader objects that are
able to encode the specified MIME type.
throw new UnsupportedOperationException("Not supported yet");
|
public static java.util.Iterator | getImageWritersBySuffix(java.lang.String fileSuffix)Gets the Iterator which lists the registered ImageReader objects that are
able to encode the specified suffix.
if (fileSuffix == null) {
throw new NullPointerException("suffix cannot be NULL");
}
Iterator<ImageWriterSpi> it = registry.getServiceProviders(ImageWriterSpi.class,
new SuffixFilter(fileSuffix), true);
return new SpiIteratorToWritersIteratorWrapper(it);
|
public static java.lang.String[] | getReaderFormatNames()Gets the array of format names as String which can be decoded by
registered ImageReader objects.
throw new UnsupportedOperationException("Not supported yet");
|
public static java.lang.String[] | getReaderMIMETypes()Gets the array of MIME types as String which can be decoded by registered
ImageReader objects.
throw new UnsupportedOperationException("Not supported yet");
|
public static boolean | getUseCache()Gets the flag which indicates whether a cache file is used when creating
ImageInputStreams and ImageOutputStreams or not. This method returns the
current value which is set by setUseCache method.
// TODO implement
return false;
|
public static java.lang.String[] | getWriterFormatNames()Gets an array of Strings giving the names of the formats supported by
registered ImageWriter objects.
throw new UnsupportedOperationException("Not supported yet");
|
public static java.lang.String[] | getWriterMIMETypes()Gets an array of Strings giving the MIME types of the formats supported
by registered ImageWriter objects.
throw new UnsupportedOperationException("Not supported yet");
|
public static java.awt.image.BufferedImage | read(java.io.File input)Reads image data from the specified File and decodes it using the
appropriate registered ImageReader object. The File is wrapped in an
ImageInputStream.
if (input == null) {
throw new IllegalArgumentException("input == null!");
}
ImageInputStream stream = createImageInputStream(input);
return read(stream);
|
public static java.awt.image.BufferedImage | read(java.io.InputStream input)Reads image data from the specified InputStream and decodes it using an
appropriate registered an ImageReader object.
if (input == null) {
throw new IllegalArgumentException("input == null!");
}
ImageInputStream stream = createImageInputStream(input);
return read(stream);
|
public static java.awt.image.BufferedImage | read(java.net.URL input)Reads image data from the specified URL and decodes it using the
appropriate registered ImageReader object.
if (input == null) {
throw new IllegalArgumentException("input == null!");
}
InputStream stream = input.openStream();
BufferedImage res = read(stream);
stream.close();
return res;
|
public static java.awt.image.BufferedImage | read(javax.imageio.stream.ImageInputStream stream)Reads image data from the specified ImageInputStream and decodes it using
appropriate registered an ImageReader object.
if (stream == null) {
throw new IllegalArgumentException("stream == null!");
}
Iterator<ImageReader> imageReaders = getImageReaders(stream);
if (!imageReaders.hasNext()) {
return null;
}
ImageReader reader = imageReaders.next();
reader.setInput(stream, false, true);
BufferedImage res = reader.read(0);
reader.dispose();
try {
stream.close();
} catch (IOException e) {
// Stream could be already closed, proceed silently in this case
}
return res;
|
public static void | scanForPlugins()Scans for plug-ins in the class path, loads spi classes, and registers
them with the IIORegistry.
throw new UnsupportedOperationException("Not supported yet");
|
public static void | setCacheDirectory(java.io.File cacheDirectory)Sets the cache directory.
throw new UnsupportedOperationException("Not supported yet");
|
public static void | setUseCache(boolean useCache)Sets flag which indicates whether a cache file is used when creating
ImageInputStreams and ImageOutputStreams or not.
throw new UnsupportedOperationException("Not supported yet");
|
public static boolean | write(java.awt.image.RenderedImage im, java.lang.String formatName, javax.imageio.stream.ImageOutputStream output)Writes the specified image in the specified format (using an appropriate
ImageWriter) to the specified ImageOutputStream.
if (im == null) {
throw new IllegalArgumentException("image cannot be NULL");
}
if (formatName == null) {
throw new IllegalArgumentException("format name cannot be NULL");
}
if (output == null) {
throw new IllegalArgumentException("output cannot be NULL");
}
Iterator<ImageWriter> it = getImageWriters(ImageTypeSpecifier.createFromRenderedImage(im),
formatName);
if (it.hasNext()) {
ImageWriter writer = it.next();
writer.setOutput(output);
writer.write(im);
output.flush();
writer.dispose();
return true;
}
return false;
|
public static boolean | write(java.awt.image.RenderedImage im, java.lang.String formatName, java.io.File output)Writes the specified image in the specified format (using an appropriate
ImageWriter) to the specified File.
if (output == null) {
throw new IllegalArgumentException("output cannot be NULL");
}
if (output.exists()) {
output.delete();
}
ImageOutputStream ios = createImageOutputStream(output);
boolean rt = write(im, formatName, ios);
ios.close();
return rt;
|
public static boolean | write(java.awt.image.RenderedImage im, java.lang.String formatName, java.io.OutputStream output)Writes the specified image in the specified format (using an appropriate
ImageWriter) to the specified OutputStream.
if (output == null) {
throw new IllegalArgumentException("output cannot be NULL");
}
ImageOutputStream ios = createImageOutputStream(output);
boolean rt = write(im, formatName, ios);
ios.close();
return rt;
|