Struct ImageBuilder

Source
pub struct ImageBuilder<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> ImageBuilder<'a>

Source

pub fn context(&self) -> &'a Context

Get the underlying context this ImageBuilder was created on.

Source

pub fn mipmaps(self) -> Self

Create mipmaps during the creation of the image.

Source

pub fn repeat_x(self) -> Self

Repeat the image on the X axis.

Source

pub fn repeat_y(self) -> Self

Repeat the image on the Y axis.

Source

pub fn flipy(self) -> Self

Flip (invert) the image in the Y direction during rendering.

Source

pub fn premultiplied(self) -> Self

The image data contains premultiplied alpha.

Source

pub fn nearest(self) -> Self

Use nearest interpolation instead of linear.

Source

pub fn build_from_file<P: AsRef<IoPath>>( self, file: P, ) -> ImageBuilderResult<'a>

Construct the image by loading it from an image file on the file system.

Source

pub fn build_from_memory(self, data: &[u8]) -> ImageBuilderResult<'a>

Construct the image by loading it from an image file in memory.

Source

pub fn build_from_rgba( self, width: usize, height: usize, data: &[u32], ) -> ImageBuilderResult<'a>

Construct the image by filling it with pixel data from memory (always 32bit RGBA).

Trait Implementations§

Source§

impl<'a> Debug for ImageBuilder<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ImageBuilder<'a>

§

impl<'a> RefUnwindSafe for ImageBuilder<'a>

§

impl<'a> !Send for ImageBuilder<'a>

§

impl<'a> !Sync for ImageBuilder<'a>

§

impl<'a> Unpin for ImageBuilder<'a>

§

impl<'a> UnwindSafe for ImageBuilder<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.