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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Releases all resources of this object.voidsetCompression(int level) Sets the deflate compression level.voidsetFlipY(boolean flipY) If true, the resulting PNG is flipped vertically.voidvoidwrite(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, waitMethods 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:DisposableReleases all resources of this object.- Specified by:
disposein interfaceDisposable
-