[][src]Trait spectrusty_core::video::pixel::PixelBuffer

pub trait PixelBuffer<'a> {
    type Pixel: Copy;
    pub fn from_line(line_buffer: &'a mut [u8]) -> Self;
pub fn put_pixel(&mut self, pixel: Self::Pixel); pub fn put_pixels(&mut self, pixel: Self::Pixel, count: usize) { ... }
pub fn pixel_stride() -> usize { ... } }

A trait for providing a way for placing pixels into byte buffers.

Associated Types

type Pixel: Copy[src]

Specifies the type used for pixels.

Loading content...

Required methods

pub fn from_line(line_buffer: &'a mut [u8]) -> Self[src]

Should return a new instance of PixelBuffer implementation from the mutable slice of bytes representing a single line of pixels of the target buffer.

pub fn put_pixel(&mut self, pixel: Self::Pixel)[src]

Puts the next pixel into the line buffer and increases an internal cursor position by a single pixel.

If the internal buffer boundaries would be overflown, this method must not panic, but instead, it should just return without writing anything to the underlying buffer.

Loading content...

Provided methods

pub fn put_pixels(&mut self, pixel: Self::Pixel, count: usize)[src]

Puts count number of pixel copies into the line buffer and increases an internal cursor position accordingly.

If the internal buffer boundaries would be overflown, this method must not panic, but instead, it should just return without writing anything to the underlying buffer.

pub fn pixel_stride() -> usize[src]

Returns the stride of a single pixel in bytes.

Loading content...

Implementors

impl<'a> PixelBuffer<'a> for PixelBufA24<'a>[src]

type Pixel = [u8; 3]

impl<'a> PixelBuffer<'a> for PixelBufA32<'a>[src]

type Pixel = [u8; 4]

impl<'a> PixelBuffer<'a> for PixelBufP8<'a>[src]

type Pixel = u8

impl<'a> PixelBuffer<'a> for PixelBufP16<'a>[src]

type Pixel = u16

impl<'a> PixelBuffer<'a> for PixelBufP32<'a>[src]

type Pixel = u32

Loading content...