[][src]Struct termwiz::surface::change::Image

pub struct Image {
    pub width: usize,
    pub height: usize,
    pub top_left: TextureCoordinate,
    pub bottom_right: TextureCoordinate,
    pub image: Arc<ImageData>,
}

The Image Change needs to support adding an image that spans multiple rows and columns, as well as model the content for just one of those cells. For instance, if some of the cells inside an image are replaced by textual content, and the screen is scrolled, computing the diff change stream needs to be able to express that a single cell holds a slice from a larger image. The Image struct expresses its dimensions in cells and references a region in the shared source image data using texture coordinates. A 4x3 cell image would set width=3, height=3, top_left=(0,0), bottom_right=(1,1). The top left cell from that image, if it were to be included in a diff, would be recorded as width=1, height=1, top_left=(0,0), bottom_right=(1/4,1/3).

Fields

width: usize

measured in cells

height: usize

measure in cells

top_left: TextureCoordinate

Texture coordinate for the top left of this image block. (0,0) is the top left of the ImageData. (1, 1) is the bottom right.

bottom_right: TextureCoordinate

Texture coordinates for the bottom right of this image block.

image: Arc<ImageData>

the image data

Trait Implementations

impl Clone for Image[src]

impl Debug for Image[src]

impl<'de> Deserialize<'de> for Image[src]

impl Eq for Image[src]

impl PartialEq<Image> for Image[src]

impl Serialize for Image[src]

impl StructuralEq for Image[src]

impl StructuralPartialEq for Image[src]

Auto Trait Implementations

impl RefUnwindSafe for Image

impl Send for Image

impl Sync for Image

impl Unpin for Image

impl UnwindSafe for Image

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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.