                d -= 2 * dx;
            }

            d += 2 * dy;
        }
    }

    /// Get a pixel given its x,y position.
    ///
    /// `S`: pixel stride (`4` -> 4 bytes per pixel)
    fn get_pixel<const S: usize>(&self, x: i16, y: i16) -> [u8; S] {
        let idx = ((x + y * WIDTH as i16) as usize) * S;
        let mut pixel = [0u8; S];

        pixel.copy_from_slice(&self.buffer[idx..idx + S]);