[−][src]Struct breadx::image::Image
An image. This acts as a wrapper around data that represents an image.
Fields
width: usizeThe width of this image.
height: usizeThe height of this image.
x_offset: usizeNumber of pixels offset in the X direction.
format: ImageFormatFormat for this image.
depth: u8The depth of this image.
bit_order: ImageOrderBit order of this image.
byte_order: ImageOrderByte order of this image.
bitmap_unit: u8The quantity of the scanline (usually 8, 16, or 32)
bitmap_pad: u32bytes_per_line: usizebits_per_pixel: u8red_mask: u32Red mask.
green_mask: u32Green mask.
blue_mask: u32Blue mask.
data: DataThe data contained within this image.
Implementations
impl<Data> Image<Data> where
Data: Deref<Target = [u8]>, [src]
Data: Deref<Target = [u8]>,
pub fn pixel(&self, x: usize, y: usize) -> u32[src]
Get the pixel at the specified index.
pub fn new<Conn>(
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]
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>
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]ⓘ[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]
Data: Deref<Target = [u8]> + DerefMut,
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
Auto Trait Implementations
impl<Data> RefUnwindSafe for Image<Data> where
Data: RefUnwindSafe, [src]
Data: RefUnwindSafe,
impl<Data> Send for Image<Data> where
Data: Send, [src]
Data: Send,
impl<Data> Sync for Image<Data> where
Data: Sync, [src]
Data: Sync,
impl<Data> Unpin for Image<Data> where
Data: Unpin, [src]
Data: Unpin,
impl<Data> UnwindSafe for Image<Data> where
Data: UnwindSafe, [src]
Data: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,