[−][src]Struct termwiz::surface::change::Image
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Image
[src]
impl PartialEq<Image> for Image
[src]
impl Serialize for Image
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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]
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
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.
fn to_owned(&self) -> T
[src]
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.
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>,