ExPng.Chunks.ImageData (ExPng v1.0.0)
Stores the raw data of an IDAT image data chunk from a PNG image.
Since PNG images can be encoded with the image data split between multiple
IDAT chunks to allow generating an image in a streaming manner, merge/1
provides support for merging multiple chunks into one before being fully
decoded by ExPng
.
Link to this section Summary
Functions
Takes an image, a header, and optionally, a filter type and palette,
and returns an ImageData
struct containing the image data translated into
a bytestring.
Merges a list of ImageData chunks into one
Returns a new ImageData
struct with the provided data.
Link to this section Types
Specs
t() :: %ExPng.Chunks.ImageData{data: binary(), type: :IDAT}
Link to this section Functions
from_pixels(image, header, filter_type \\ 0, palette \\ nil)
Specs
from_pixels( ExPng.maybe(ExPng.Image.t()), ExPng.Chunks.Header.t(), ExPng.maybe(ExPng.filter()), ExPng.maybe(ExPng.Image.row()) ) :: t()
Takes an image, a header, and optionally, a filter type and palette,
and returns an ImageData
struct containing the image data translated into
a bytestring.
merge(data_chunks)
Specs
Merges a list of ImageData chunks into one
new(atom, data)
Specs
Returns a new ImageData
struct with the provided data.