Class PNGEncoder
java.lang.Object
is.galia.codec.AbstractImageIOEncoder
is.galia.codec.png.PNGEncoder
- All Implemented Interfaces:
Encoder
,AutoCloseable
Implementation wrapping the default JDK Image I/O PNG
ImageWriter
.- See Also:
-
Field Summary
Fields inherited from class is.galia.codec.AbstractImageIOEncoder
arena, encode, iioWriter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addMetadata
(IIOMetadataNode baseTree) Embeds metadata fromAbstractImageIOEncoder.encode
into the given tree.void
encode
(RenderedImage image, OutputStream outputStream) Writes the given image to the given output stream.protected org.slf4j.Logger
protected String[]
N.B.: This method returns a list of strings rather thanclasses
because some readers reside under the com.sun package, which is encapsulated in Java 9.Methods inherited from class is.galia.codec.AbstractImageIOEncoder
close, getMetadata, setArena, setEncode
-
Constructor Details
-
PNGEncoder
public PNGEncoder()
-
-
Method Details
-
addMetadata
Description copied from class:AbstractImageIOEncoder
Embeds metadata from
AbstractImageIOEncoder.encode
into the given tree.Writers for formats that don't support metadata may simply do nothing.
- Specified by:
addMetadata
in classAbstractImageIOEncoder
- Parameters:
baseTree
- Tree to embed the metadata into.
-
getLogger
protected org.slf4j.Logger getLogger()- Specified by:
getLogger
in classAbstractImageIOEncoder
-
getPreferredIIOImplementations
Description copied from class:AbstractImageIOEncoder
N.B.: This method returns a list of strings rather thanclasses
because some readers reside under the com.sun package, which is encapsulated in Java 9.- Specified by:
getPreferredIIOImplementations
in classAbstractImageIOEncoder
- Returns:
- Plugins preferred by the application, in order of most to least preferred, or an empty array if there is no preference.
-
getSupportedFormats
- Specified by:
getSupportedFormats
in interfaceEncoder
- Returns:
- All formats supported by the instance. Note that the
implementation must create the instances from scratch and
not obtain them from the
format registry
, which may be empty at the time this method is invoked.
-
encode
Writes the given image to the given output stream.- Specified by:
encode
in interfaceEncoder
- Parameters:
image
- Image to write.outputStream
- Stream to write the image to.- Throws:
IOException
-