pngleam

Types

pub type BinaryRowData =
  List(BitArray)
pub opaque type ColorInfo
pub type ColorType {
  Greyscale
  Color
  Indexed
  GreyscaleWithAlpha
  ColorWithAlpha
}

Constructors

  • Greyscale
  • Color
  • Indexed
  • GreyscaleWithAlpha
  • ColorWithAlpha
pub type ColorValue =
  #(Int, Int, Int)
pub type ColorWithAlphaValue =
  #(Int, Int, Int, Int)
pub type FilterType {
  None
  Sub
  Up
  Average
  Paeth
}

Constructors

  • None
  • Sub
  • Up
  • Average
  • Paeth
pub type GreyscaleValue =
  Int
pub type GreyscaleWithAlphaValue =
  #(Int, Int)
pub type Grid(a) =
  List(List(a))
pub type PaletteColor =
  #(Int, Int, Int)
pub type PaletteColors =
  List(#(Int, Int, Int))
pub type PalleteIndex =
  Int
pub type ParseError {
  InvalidSignature
  InvalidChunkTag
  ChecksumMismatch
  InvalidChunkOrder
  MissingHeaderChunk
  InvalidChunkData
  InvalidColorType
  InvalidBitDepth
  InvalidCompressionType
  InvalidFilterMethod
  InvalidInterlaceMethod
  UnsupportedInterlaceMethod
  InvalidRowFilterType
  InvalidRowData
}

Constructors

  • InvalidSignature
  • InvalidChunkTag
  • ChecksumMismatch
  • InvalidChunkOrder
  • MissingHeaderChunk
  • InvalidChunkData
  • InvalidColorType
  • InvalidBitDepth
  • InvalidCompressionType
  • InvalidFilterMethod
  • InvalidInterlaceMethod
  • UnsupportedInterlaceMethod
  • InvalidRowFilterType
  • InvalidRowData
pub type PixelData {
  GreyscaleData(List(List(Int)))
  ColorData(List(List(#(Int, Int, Int))))
  IndexedData(List(List(Int)))
  GreyscaleWithAlphaData(List(List(#(Int, Int))))
  ColorWithAlphaData(List(List(#(Int, Int, Int, Int))))
}

Constructors

  • GreyscaleData(List(List(Int)))
  • ColorData(List(List(#(Int, Int, Int))))
  • IndexedData(List(List(Int)))
  • GreyscaleWithAlphaData(List(List(#(Int, Int))))
  • ColorWithAlphaData(List(List(#(Int, Int, Int, Int))))
pub type PngBitArrayData =
  PngData(BitArray, List(BitArray))
pub type PngData(p, i) {
  PngData(
    metadata: PngMetadata,
    palette: option.Option(p),
    image_data: i,
  )
}

Constructors

pub type PngMetadata {
  PngMetadata(width: Int, height: Int, color_info: ColorInfo)
}

Constructors

  • PngMetadata(width: Int, height: Int, color_info: ColorInfo)
pub type PngPixelData =
  PngData(List(#(Int, Int, Int)), PixelData)
pub type RawPalette =
  BitArray

Values

pub fn color_info(
  color_type color_type: ColorType,
  bit_depth bit_depth: Int,
) -> Result(ColorInfo, Nil)
pub fn color_info_bits(color_info: ColorInfo) -> Int
pub const compression_level: fn(Int) -> Result(
  gzlib.CompressionLevel,
  Nil,
)
pub fn filter_type_to_int(filter_type: FilterType) -> Int
pub fn from_packed(
  row_data row_data: List(BitArray),
  width width: Int,
  height height: Int,
  color_info color_info: ColorInfo,
  compression_level compression_level: gzlib.CompressionLevel,
) -> BitArray
pub const greyscale_8bit: ColorInfo
pub fn int_to_filter_type(
  filter_type: Int,
) -> Result(FilterType, Nil)
pub fn parse_metadata(
  data: BitArray,
) -> Result(PngMetadata, ParseError)
pub fn parse_to_bit_arrays(
  data: BitArray,
) -> Result(PngData(BitArray, List(BitArray)), ParseError)
pub fn parse_to_pixel_data(
  data: BitArray,
) -> Result(
  PngData(List(#(Int, Int, Int)), PixelData),
  ParseError,
)
pub const rgb_16bit: ColorInfo
pub const rgb_8bit: ColorInfo
pub const rgba_16bit: ColorInfo
pub const rgba_8bit: ColorInfo
Search Document