Package arc.graphics
Class PixmapIO.PngWriter
java.lang.Object
arc.graphics.PixmapIO.PngWriter
- All Implemented Interfaces:
Disposable
- Enclosing class:
- PixmapIO
PNG encoder with compression. An instance can be reused to encode multiple PNGs with minimal allocation.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Releases all resources of this object.void
setCompression
(int level) Sets the deflate compression level.void
setFlipY
(boolean flipY) If true, the resulting PNG is flipped vertically.void
void
write
(OutputStream output, Pixmap pixmap) Writes the pixmap to the stream without closing the stream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface arc.util.Disposable
isDisposed
-
Constructor Details
-
PngWriter
public PngWriter() -
PngWriter
public PngWriter(int initialBufferSize)
-
-
Method Details
-
setFlipY
public void setFlipY(boolean flipY) If true, the resulting PNG is flipped vertically. Default is true. -
setCompression
public void setCompression(int level) Sets the deflate compression level. Default isDeflater.DEFAULT_COMPRESSION
. -
write
- Throws:
IOException
-
write
Writes the pixmap to the stream without closing the stream.- Throws:
IOException
-
dispose
public void dispose()Description copied from interface:Disposable
Releases all resources of this object.- Specified by:
dispose
in interfaceDisposable
-