Skip to main content

dither_row

Function dither_row 

Source
pub fn dither_row(light: [u8; 8], y: i32) -> u8
Expand description

The eight pixels of a frame byte on screen row y (a byte’s first pixel is always at a multiple of 8 across) whose brightnesses are light (0 black to 255 white, the first the leftmost), dithered as ADR-0078 says: pixel i is white where 4 × BAYER[y % 8][i] + 2 ≥ 255 − light[i] (shuyi_assets::onebit::BAYER), the Bayer dither of shuyi bake at the screen’s pixels. Its highest bit is the leftmost pixel, a set bit white. Integers only: the same on every platform.