[−][src]Struct livesplit_core::Image
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]
P: AsRef<Path>,
B: AsMut<Vec<u8>>,
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(&self) -> 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]
fn eq(&self, other: &Image) -> bool
[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
Blanket Implementations
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
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>,
T: Parameter<Self>,
Sets value
as a parameter of self
.