|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectImageWriter
SpatialImageWriter
public abstract class SpatialImageWriter
Base class for writers of spatial (usually geographic) data. This base class provides the following restrictions or conveniences:
SpatialMetadata and its format to
stream metadata and
image metadata.getSampleModel, createRectIter
and computeSize static methods as helpers for the
write(...) implementations.
SpatialImageReader
| coverage/geotk-coverageio (download) | View source code for this class |
| Nested Class Summary | |
|---|---|
protected static class |
SpatialImageWriter.Spi
Service provider interfaces (SPI) for SpatialImageWriters. |
| Field Summary |
|---|
| Fields inherited from class ImageWriter |
|---|
availableLocales, locale, originatingProvider, output, progressListeners, warningListeners, warningLocales |
| Fields inherited from interface WarningProducer |
|---|
LOGGER |
| Constructor Summary | |
|---|---|
protected |
SpatialImageWriter(SpatialImageWriter.Spi provider)
Constructs a SpatialImageWriter. |
| Method Summary | |
|---|---|
boolean |
canWriteRasters()
Returns true if the methods that take an IIOImage parameter are capable of dealing
with a Raster. |
protected static ImageDimension |
computeSize(IIOImage image,
ImageWriteParam parameters)
Computes the size of the region to be written, taking subsampling in account. |
SpatialMetadata |
convertImageMetadata(IIOMetadata inData,
ImageTypeSpecifier imageType,
ImageWriteParam param)
Returns a metadata object initialized to the specified data for encoding an image of the given type. |
SpatialMetadata |
convertStreamMetadata(IIOMetadata inData,
ImageWriteParam param)
Returns a metadata object initialized to the specified data for encoding a stream of images. |
protected static RectIter |
createRectIter(IIOImage image,
ImageWriteParam parameters)
Returns an iterator over the pixels of the specified image, taking subsampling in account. |
void |
dispose()
Allows any resources held by this writer to be released. |
SpatialMetadata |
getDefaultImageMetadata(ImageTypeSpecifier imageType,
ImageWriteParam param)
Returns a metadata object containing default values for encoding an image of the given type. |
SpatialMetadata |
getDefaultStreamMetadata(ImageWriteParam param)
Returns a metadata object containing default values for encoding a stream of images. |
SpatialImageWriteParam |
getDefaultWriteParam()
Returns a default parameter object appropriate for this format. |
protected static SampleModel |
getSampleModel(IIOImage image,
ImageWriteParam parameters)
Returns the sample model to use for the destination image to be written. |
protected void |
processImageComplete()
Broadcasts the completion of an image write to all registered listeners. |
protected void |
processImageStarted()
Broadcasts the start of an image write to all registered listeners. |
protected void |
processThumbnailComplete()
Broadcasts the completion of a thumbnail write to all registered listeners. |
protected void |
processThumbnailStarted()
Broadcasts the start of a thumbnail write to all registered listeners. |
protected void |
processWarningOccurred(String warning)
Broadcasts a warning message to all registered listeners. |
protected void |
processWarningOccurred(String baseName,
String keyword)
Broadcasts a warning message to all registered listeners. |
void |
setOutput(Object output)
Sets the destination to the given ImageOutputStream
or other Object. |
boolean |
warningOccurred(LogRecord record)
Invoked when a warning occurred. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface Localized |
|---|
getLocale |
| Constructor Detail |
|---|
protected SpatialImageWriter(SpatialImageWriter.Spi provider)
SpatialImageWriter.
provider - The ImageWriterSpi that is constructing this object, or null.| Method Detail |
|---|
public void setOutput(Object output)
ImageOutputStream
or other Object.
setOutput in class ImageWriterpublic SpatialImageWriteParam getDefaultWriteParam()
SpatialImageWriteParam.
getDefaultWriteParam in class ImageWriterImageWriteParam object which may be used.public SpatialMetadata getDefaultStreamMetadata(ImageWriteParam param)
SpatialMetadata using
the stream format.
getDefaultStreamMetadata in class ImageWriterparam - Parameters that will be used to encode the image (in cases where
it may affect the structure of the metadata), or null.
null.
public SpatialMetadata getDefaultImageMetadata(ImageTypeSpecifier imageType,
ImageWriteParam param)
SpatialMetadata using
the image format.
getDefaultImageMetadata in class ImageWriterimageType - The format of the image to be written later.param - Parameters that will be used to encode the image (in cases where
it may affect the structure of the metadata), or null.
null.
public SpatialMetadata convertStreamMetadata(IIOMetadata inData,
ImageWriteParam param)
SpatialMetadata using the
stream format, or wraps it otherwise.
convertStreamMetadata in interface ImageTranscoderconvertStreamMetadata in class ImageWriterinData - Stream metadata used to initialize the state of the returned object.param - Parameters that will be used to encode the image (in cases where
it may affect the structure of the metadata), or null.
null.
public SpatialMetadata convertImageMetadata(IIOMetadata inData,
ImageTypeSpecifier imageType,
ImageWriteParam param)
SpatialMetadata using the
image format, or wraps it otherwise.
convertImageMetadata in interface ImageTranscoderconvertImageMetadata in class ImageWriterinData - Image metadata used to initialize the state of the returned object.imageType - The format of the image to be written later.param - Parameters that will be used to encode the image (in cases where
it may affect the structure of the metadata), or null.
null.public boolean canWriteRasters()
IIOImage parameter are capable of dealing
with a Raster. The default implementation returns true since it is assumed
that subclasses will fetch pixels using the iterator returned by createRectIter.
canWriteRasters in class ImageWriter
protected static SampleModel getSampleModel(IIOImage image,
ImageWriteParam parameters)
image - The image or raster to be written.parameters - The write parameters, or null if the whole image will be written.
protected static RectIter createRectIter(IIOImage image,
ImageWriteParam parameters)
image - The image or raster to be written.parameters - The write parameters, or null if the whole image will be written.
protected static ImageDimension computeSize(IIOImage image,
ImageWriteParam parameters)
image - The image or raster to be written.parameters - The write parameters, or null if the whole image will be written.
protected void processImageStarted()
protected void processImageComplete()
processImageComplete in class ImageWriterprotected void processThumbnailStarted()
protected void processThumbnailComplete()
processThumbnailComplete in class ImageWriterprotected void processWarningOccurred(String warning)
warning - The warning message to broadcasts.
protected void processWarningOccurred(String baseName,
String keyword)
baseName - The base name of a set of ResourceBundles
containing localized warning messages.keyword - The keyword used to index the warning message within the set of
ResourceBundles.public boolean warningOccurred(LogRecord record)
warningOccurred method is
invoked for each of them and the log record is not logged."org.geotoolkit.image.io" logger.Subclasses may override this method if more processing is wanted, or for throwing exception if some warnings should be considered as fatal errors.
warningOccurred in interface WarningProducerrecord - The warning record to log.
true if the message has been sent to at least one warning listener,
or false if it has been sent to the logging system as a fallback.MetadataAccessor.warningOccurred(LogRecord)public void dispose()
StreamImageWriter or ImageWriterAdapter, it will be
closed before to dispose this reader.
dispose in interface Disposabledispose in class ImageWriter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||