struct

PNG::Scanline

Inherits Struct / Value / Object

A row of pixels including their filtering method

Constructors

new(header : PNG::Header, filter : PNG::FilterMethod, data : Slice(UInt8))
Source

Instance methods

[](*args, **options)
Source
[](*args, **options, &)
Source
[]?(*args, **options)
Source
[]?(*args, **options, &)
Source
average(other : Scanline, &block : UInt8 -> Nil)

Filt(x) = Orig(x) - floor((Orig(a) + Orig(b)) / 2)

Source
average(other : Nil, &block : UInt8 -> Nil)

Filt(x) = Orig(x) - floor((Orig(a) + Orig(b)) / 2)

Source
average(other : Scanline | Nil, io : IO)

Filt(x) = Orig(x) - floor((Orig(a) + Orig(b)) / 2)

Source
bit_depth(*args, **options)
Source
bit_depth(*args, **options, &)
Source
bits_per_pixel(*args, **options)
Source
bits_per_pixel(*args, **options, &)
Source
bytes_per_pixel(*args, **options)
Source
bytes_per_pixel(*args, **options, &)
Source
channels(*args, **options)
Source
channels(*args, **options, &)
Source
data
Source
data=(data : Bytes)
Source
filter
Source
filter(previous : Scanline | Nil, &block : UInt8 -> Nil)

Apply a filter

Source
filter=(filter : FilterMethod)
Source
header
Source
header=(header : Header)
Source
none
Source
paeth(other : Scanline, &block : UInt8 -> Nil)

Filt(x) = Orig(x) - PaethPredictor(Orig(a), Orig(b), Orig(c))

Source
paeth(other : Nil, &block : UInt8 -> Nil)

Filt(x) = Orig(x) - PaethPredictor(Orig(a), Orig(b), Orig(c))

Source
paeth(other : Scanline | Nil, io : IO)

Filt(x) = Orig(x) - PaethPredictor(Orig(a), Orig(b), Orig(c))

Source
paeth_predict(a, b, c)

https://www.w3.org/TR/png-3/#bib-paeth

Source
pixel(x : Int) : Indexable(UInt8)

Return the bytes that represent a pixel at x in this scanline

Source
set_pixel(x : Int, values : Indexable(UInt8)) : Nil

Sets a pixel in this scanline based on the header

Source
sub

Filt(x) = Orig(x) - Orig(a) Run the sub filter strategy yielding each modified byte to the block

Source
sub(io : IO)

Filt(x) = Orig(x) - Orig(a) Run the sub filter strategy yielding each modified byte to the block

Source
unaverage(other : Scanline)

Removes the type 3 Average filter via: Recon(x) = Filt(x) + floor((Recon(a) + Recon(b)) / 2)

Source
unaverage(other : Nil)

Removes the type 3 Average filter via: Recon(x) = Filt(x) + floor((Recon(a) + Recon(b)) / 2)

Source
unfilter(previous : Scanline | Nil)

Remove any filtering in this scanline @see https://www.w3.org/TR/png-3/#9Filters

Source
unpaeth(other : Scanline)

Remove the Paeth filter type Recon(x) = Filt(x) + PaethPredictor(Recon(a), Recon(b), Recon(c))

Source
unpaeth(other : Nil)

Remove the Paeth filter type Recon(x) = Filt(x) + PaethPredictor(Recon(a), Recon(b), Recon(c))

Source
unsub

Remove the sub filter Recon(x) = Filt(x) + Recon(a)

Source
unup(other : Scanline | Nil)

Remove the up filter

Source
up(other : Scanline, &block : UInt8 -> Nil)

Filt(x) = Orig(x) - Orig(b)

Source
up(other : Nil, &block : UInt8 -> Nil)

Filt(x) = Orig(x) - Orig(b)

Source
up(other : Scanline | Nil, io : IO)

Filt(x) = Orig(x) - Orig(b)

Source