struct PNG::Scanline

Overview

A row of pixels including their filtering method

Defined in:

png/scanline.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(header : PNG::Header, filter : PNG::FilterMethod, data : Slice(UInt8)) #

[View source]

Instance Method Detail

def [](*args, **options) #

[View source]
def [](*args, **options, &) #

[View source]
def []?(*args, **options) #

[View source]
def []?(*args, **options, &) #

[View source]
def average(other : Scanline, &block : UInt8 -> Nil) #

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


[View source]
def average(other : Nil, &block : UInt8 -> Nil) #

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


[View source]
def average(other : Scanline | Nil, io : IO) #

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


[View source]
def bit_depth(*args, **options) #

[View source]
def bit_depth(*args, **options, &) #

[View source]
def bits_per_pixel(*args, **options) #

[View source]
def bits_per_pixel(*args, **options, &) #

[View source]
def bytes_per_pixel(*args, **options) #

[View source]
def bytes_per_pixel(*args, **options, &) #

[View source]
def channels(*args, **options) #

[View source]
def channels(*args, **options, &) #

[View source]
def data : Bytes #

[View source]
def data=(data : Bytes) #

[View source]
def filter : FilterMethod #

[View source]
def filter(previous : Scanline | Nil, &block : UInt8 -> Nil) #

Apply a filter


[View source]
def filter=(filter : FilterMethod) #

[View source]
def header : Header #

[View source]
def header=(header : Header) #

[View source]
def none(&) #

[View source]
def paeth(other : Scanline, &block : UInt8 -> Nil) #

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


[View source]
def paeth(other : Nil, &block : UInt8 -> Nil) #

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


[View source]
def paeth(other : Scanline | Nil, io : IO) #

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


[View source]
def paeth_predict(a, b, c) #

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


[View source]
def pixel(x : Int) : Indexable(UInt8) #

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


[View source]
def set_pixel(x : Int, values : Indexable(UInt8)) : Nil #

Sets a pixel in this scanline based on the header


[View source]
def sub(&block : UInt8 -> Nil) #

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


[View source]
def sub(io : IO) #

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


[View source]
def unaverage(other : Scanline) #

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


[View source]
def unaverage(other : Nil) #

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


[View source]
def unfilter(previous : Scanline | Nil) #

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


[View source]
def unpaeth(other : Scanline) #

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


[View source]
def unpaeth(other : Nil) #

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


[View source]
def unsub #

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


[View source]
def unup(other : Scanline | Nil) #

Remove the up filter


[View source]
def up(other : Scanline, &block : UInt8 -> Nil) #

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


[View source]
def up(other : Nil, &block : UInt8 -> Nil) #

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


[View source]
def up(other : Scanline | Nil, io : IO) #

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


[View source]