Package arc.graphics

Class PixmapIO.PngWriter

java.lang.Object
arc.graphics.PixmapIO.PngWriter
All Implemented Interfaces:
Disposable
Enclosing class:
PixmapIO

public static class PixmapIO.PngWriter extends Object implements Disposable
PNG encoder with compression. An instance can be reused to encode multiple PNGs with minimal allocation.
  • 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 is Deflater.DEFAULT_COMPRESSION.
    • write

      public void write(Fi file, Pixmap pixmap) throws IOException
      Throws:
      IOException
    • write

      public void write(OutputStream output, Pixmap pixmap) throws IOException
      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 interface Disposable