Efficiently decode, validate, and encode image data stored in the PNG format, and convert it to formats useful for common graphics libraries.
func
png_decode
(path:String, recognizing recognized:Set<
PNGChunk
>)
Decompress, decode, and validate the raw pixel contents of a PNG file, without performing deinterlacing or deindexing.
func
png_encode
(path:String, raw_data:[UInt8], properties:
PNGProperties
, chunk_size:Int) throws
Compress, encode, validate, and write the contents of a raw pixel buffer to a PNG file.
func
png_encode
(path:String, raw_data:UnsafeBufferPointer<UInt8>, properties:
PNGProperties
, chunk_size:Int) throws
[Since: 2.0.1] Compress, encode, validate, and write the contents of a raw pixel buffer to a PNG file.
struct
RGBA
A normalized color unit consisting of four color samples.
struct
PNGProperties
The non-pixel image data associated with a PNG file, as specified in the PNG standard.
class
PNGDecoder
A progressive PNG reader object that provides pixel data lazily, scanline by scanline, and closes all file and decompression streams when it goes out of scope.
class
PNGEncoder
A progressive PNG writer object that encodes pixel data lazily, scanline by scanline, and closes all file and compression streams when it goes out of scope.
enum
PNGChunk
Public PNG chunks, as specified in the PNG standard.
The five PNG color formats, as defined in the PNG standard.
enum
PNGReadError
Errors that may occur when reading and decoding a PNG file from disk.
enum
PNGWriteError
Errors that may occur when writing and encoding a PNG file from disk.
Errors that may occur when decompressing a PNG
DEFLATE
stream.
enum
PNGCompressionError
Errors that may occur when compressing a PNG
DEFLATE
stream.