[][src]Struct livesplit_core::Image

pub struct Image { /* fields omitted */ }

Images can be used to store segment and game icons. Each image object comes with an ID that changes whenever the image is modified. IDs are unique across different images. You can query the image's data as a Data URL. There's no specific image format you need to use for the images.

Methods

impl Image[src]

pub fn new(data: &[u8]) -> Self[src]

Creates a new image with a unique ID with the image data provided.

pub fn from_file<P, B>(path: P, buf: B) -> Result<Image> where
    P: AsRef<Path>,
    B: AsMut<Vec<u8>>, 
[src]

Loads an image from the file system. You need to provide a buffer used for temporarily storing the image's data.

pub fn id(&self) -> usize[src]

Accesses the unique ID for this image.

pub fn url(&self) -> &str[src]

Accesses the Data URL storing the image's data. If the image's data is empty, this returns an empty string instead of a URL.

pub fn modify(&mut self, data: &[u8])[src]

Modifies an image by replacing its image data with the new image data provided. The image's ID changes to a new unique ID.

pub fn is_empty(&self) -> bool[src]

Checks if the image data is empty.

Trait Implementations

impl Default for Image[src]

impl Clone for Image[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<D: AsRef<[u8]>> From<D> for Image[src]

impl PartialEq<Image> for Image[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Debug for Image[src]

Auto Trait Implementations

impl Send for Image

impl Sync for Image

Blanket Implementations

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.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

fn adapt_into(self) -> D[src]

Convert the source color to the destination color using the bradford method by default Read more

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.