pixie/fileformats/png

  Source   Edit

Types

Png = ref object
  width*, height*, channels*: int
  data*: seq[ColorRGBA]
  Source   Edit

Consts

pngSignature = [137'u, 80'u, 78'u, 71'u, 13'u, 10'u, 26'u, 10'u]
  Source   Edit

Procs

proc convertToImage(png: Png): Image {....raises: [], tags: [].}
Converts a PNG into an Image by moving the data. This is faster but can only be done once.   Source   Edit
proc decodePng(data: pointer; len: int): Png {....raises: [PixieError], tags: [].}
Decodes the PNG data.   Source   Edit
proc decodePng(data: string): Png {.inline, ...raises: [PixieError], tags: [].}
Decodes the PNG data.   Source   Edit
proc decodePngDimensions(data: pointer; len: int): ImageDimensions {.
    ...raises: [PixieError], tags: [].}
Decodes the PNG dimensions.   Source   Edit
proc decodePngDimensions(data: string): ImageDimensions {.inline,
    ...raises: [PixieError], tags: [].}
Decodes the PNG dimensions.   Source   Edit
proc encodePng(image: Image): string {....raises: [PixieError], tags: [].}
Encodes the image data into the PNG file format.   Source   Edit
proc encodePng(png: Png): string {....raises: [PixieError], tags: [].}
  Source   Edit
proc encodePng(width, height, channels: int; data: pointer; len: int): string {.
    ...raises: [PixieError], tags: [].}
Encodes the image data into the PNG file format. If data points to RGBA data, it is assumed to be straight alpha.   Source   Edit
proc newImage(png: Png): Image {....raises: [PixieError], tags: [].}
Creates a new Image from the PNG.   Source   Edit