imagineer v0.3.1 Imagineer.Image.PNG.Pixels.NoInterlace

Summary

Functions

Encodes each row of pixels into a scanline. For no interlace, that really just means putting all of the channels for a row into a binary

Extracts the pixels from all of the unfiltered rows. Sets the pixels field on the image and returns it

Functions

encode(image)

Encodes each row of pixels into a scanline. For no interlace, that really just means putting all of the channels for a row into a binary.

encode_pixel(pixel, image)
encode_pixel_rows(pixels, image)
extract(image)

Extracts the pixels from all of the unfiltered rows. Sets the pixels field on the image and returns it.

Example

iex> alias Imagineer.Image.PNG
iex> image = %PNG{
...>  color_format: :rgb,
...>  bit_depth: 8,
...>  interlace_method: 0,
...>  width: 2,
...>  height: 5,
...>  unfiltered_rows: [
...>    <<127, 138, 255, 147, 159, 106>>,
...>    <<233, 1, 77, 78, 191, 144>>,
...>    <<234, 78, 93, 56, 169, 42>>,
...>    <<184, 162, 144, 6, 26, 96>>,
...>    <<32, 206, 231, 39, 117, 76>>
...>  ]
...> }
iex> PNG.Pixels.extract(image).pixels
[
  [ {127, 138, 255}, {147, 159, 106} ],
  [ {233, 1, 77}, {78, 191, 144} ],
  [ {234, 78, 93}, {56, 169, 42} ],
  [ {184, 162, 144}, {6, 26, 96} ],
  [ {32, 206, 231}, {39, 117, 76} ]
]
extract_pixel(pixel_bits, bit_depth, channels_per_pixel)
extract_pixels(rows, png)