[][src]Struct breadx::image::Image

pub struct Image<Data> {
    pub width: usize,
    pub height: usize,
    pub x_offset: usize,
    pub format: ImageFormat,
    pub depth: u8,
    pub bit_order: ImageOrder,
    pub byte_order: ImageOrder,
    pub bitmap_unit: u8,
    pub bitmap_pad: u32,
    pub bytes_per_line: usize,
    pub bits_per_pixel: u8,
    pub red_mask: u32,
    pub green_mask: u32,
    pub blue_mask: u32,
    pub data: Data,
}

An image. This acts as a wrapper around data that represents an image.

Fields

width: usize

The width of this image.

height: usize

The height of this image.

x_offset: usize

Number of pixels offset in the X direction.

format: ImageFormat

Format for this image.

depth: u8

The depth of this image.

bit_order: ImageOrder

Bit order of this image.

byte_order: ImageOrder

Byte order of this image.

bitmap_unit: u8

The quantity of the scanline (usually 8, 16, or 32)

bitmap_pad: u32bytes_per_line: usizebits_per_pixel: u8red_mask: u32

Red mask.

green_mask: u32

Green mask.

blue_mask: u32

Blue mask.

data: Data

The data contained within this image.

Implementations

impl<Data> Image<Data> where
    Data: Deref<Target = [u8]>, 
[src]

pub fn pixel(&self, x: usize, y: usize) -> u32[src]

Get the pixel at the specified index.

pub fn new<Conn: Connection>(
    dpy: &Display<Conn>,
    visual: Option<&Visualtype>,
    depth: u8,
    format: ImageFormat,
    x_offset: usize,
    data: Data,
    width: usize,
    height: usize,
    quantum: u32,
    bytes_per_line: Option<usize>
) -> Option<Self>
[src]

Create a new image, given its associated connection, visual type, depth, format, offset (should be zero unless the data starts partway into the collection), width, height, scanline quantum (8, 16, or 32) and the number of bytes per line (how many bytes between a pixel on one line and a pixel with the same X position on another line?)

pub fn data(&self) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Get a reference to the interior data.

pub fn clone_to_boxed_slice(&self) -> Image<Box<[u8]>>[src]

Clone this image to an equivalent but with a boxed slice as its data.

impl<Data> Image<Data> where
    Data: Deref<Target = [u8]> + DerefMut
[src]

pub fn set_pixel(&mut self, x: usize, y: usize, pixel: u32)[src]

Set a pixel at the specified coordinates to the specified value.

Trait Implementations

impl<Data: Clone> Clone for Image<Data>[src]

impl<Data: Debug> Debug for Image<Data>[src]

Auto Trait Implementations

impl<Data> RefUnwindSafe for Image<Data> where
    Data: RefUnwindSafe

impl<Data> Send for Image<Data> where
    Data: Send

impl<Data> Sync for Image<Data> where
    Data: Sync

impl<Data> Unpin for Image<Data> where
    Data: Unpin

impl<Data> UnwindSafe for Image<Data> where
    Data: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.