Struct mterm::PresentInput[][src]

pub struct PresentInput<'a> {
    pub width: usize,
    pub height: usize,
    pub fore_image: &'a mut Vec<u32>,
    pub back_image: &'a mut Vec<u32>,
    pub text_image: &'a mut Vec<u32>,
}
Expand description

Provides presentation information and contains the arrays that can be mutated to update the window’s contents.

The window’s contents is split into 3 arrays: fore_image, back_image and text_image. The fore_image is an array of u32s containing the colour codes for the foreground colour (or ink colour) of each character on the window. Each u32 represents a single character. Similarly, the back_image contains an array of u32s representing all the background colours (or paper colour) for each character on the window. Finally, text_image contains all the ASCII character codes for each character on the window. This also contains u32s but currently, only the lower 8 bits is considered for rendering. In a future version, higher bits might be used for other effects (such as bold, underline etc).

Fields

width: usize

The current width, in chars, of the application window.

height: usize

The current height, in chars, of the application window.

fore_image: &'a mut Vec<u32>

The array (of size width*height) of u32 values representing the ink colours (or foreground colours) of each character on the window.

back_image: &'a mut Vec<u32>

The array (of size width*height) of u32 values representing the paper colours (or background colours) of each character on the window.

text_image: &'a mut Vec<u32>

The array (of size width*height) of u32 values representing the ASCII character codes of each character on the window. Only the lower 8-bits are currently used.

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.