ExPng.Chunks.Header (ExPng v1.0.0)

Stores the data collected from a PNG's header data chunk. This chunk enodes information about

  • the image's width and height
  • the bit_depth of encoded pixel data
  • the color mode the image pixel data is stored in
  • whether the image data has been interlaced using the Adam7 interlacing algorithm
  • the filter method applied to the image. This is different than the filter type used by each line of the image (see ExPng.Image.Line), and the only current valid value for this field is 0
  • the compression method applied to the image data. Like the filter method, 0 is the only allowed value for this field. PNG uses the DEFLATE compression algorithm, and ExPng uses Erlang's implementation of zlib.

The data contained in this struct is read from a PNG when decoding, and generated automatically for an image when encoding, so ExPng users should never have to manipulate this data manually.

Link to this section Summary

Link to this section Types

Specs

t() :: %ExPng.Chunks.Header{
  bit_depth: ExPng.bit_depth(),
  color_mode: ExPng.color_mode(),
  compression: 0,
  filter: 0,
  height: pos_integer(),
  interlace: 0 | 1,
  type: :IHDR,
  width: pos_integer()
}

Link to this section Functions

Link to this function

new(atom, data)

Specs

new(:IHDR, <<_::104>>) :: {:ok, t()} | {:error, binary(), binary()}