[][src]Struct minilibx::MlxImage

pub struct MlxImage {
    pub width: i32,
    pub height: i32,
    pub bits_per_pixel: i32,
    pub size_line: i32,
    pub endian: Endian,
    // some fields omitted
}

Image data placeholder. Can be used to draw image onto the screen.

Fields

width: i32

width of the image

height: i32

height of the image

bits_per_pixel: i32

number of bits needed to represent a pixel color (depth of the image)

size_line: i32

number of bytes used to store one line of the image in memory.

needed to move from one line to another in the image.

endian: Endian

the endianness of the image

Methods

impl MlxImage[src]

pub fn write_to(&self, offset: i32, value: u8)[src]

Writes to the image from offset of the beginning of the area where the image is stored.

The first bits_per_pixel bits represent the color of the first pixel in the first line of the image.

The second bits_per_pixel bits represent the second pixel of the first line, and so on.

This function could cause a segmentation fault if your offset is wrong, be careful !

Trait Implementations

impl Clone for MlxImage[src]

impl Copy for MlxImage[src]

Auto Trait Implementations

impl RefUnwindSafe for MlxImage

impl !Send for MlxImage

impl !Sync for MlxImage

impl Unpin for MlxImage

impl UnwindSafe for MlxImage

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.