Skip to main content

Texture2D

Struct Texture2D 

Source
pub struct Texture2D { /* private fields */ }

Implementations§

Source§

impl Texture2D

Source

pub fn new(context: Rc<Context>) -> Self

Source

pub fn set_usage(&mut self, usage_flags: TextureUsages)

Source

pub fn get_native_format(&self) -> Option<TextureFormat>

Source

pub fn get_texture(&self) -> Option<&Texture>

Source

pub fn get_texture_view(&self) -> Option<&TextureView>

Source

pub fn get_sampler(&self) -> Option<&Sampler>

Source

pub fn get_sampler_state(&self) -> &SamplerState

Trait Implementations§

Source§

impl Drop for Texture2D

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Texture2D for Texture2D

Source§

fn set_sampler_configuration(&mut self, sampler_state: SamplerState)

Source§

fn set_format( &mut self, pixel_format: TexturePixelType, channel_type: TextureChannelDataType, )

Source§

fn set_size(&mut self, size: Size)

Source§

fn set_image(&mut self, image: Option<Rc<PremultipliedImage>>)

Source§

fn get_format(&self) -> TexturePixelType

Source§

fn get_size(&self) -> Size

Source§

fn get_data_size(&self) -> usize

Source§

fn get_pixel_stride(&self) -> usize

Source§

fn num_channels(&self) -> usize

Source§

fn create(&mut self)

Source§

fn upload_data(&mut self, pixel_data: Option<&[u8]>, size: Size)

Source§

fn upload_sub_region( &mut self, pixel_data: Option<&[u8]>, region_size: Size, x_offset: u16, y_offset: u16, )

Source§

fn upload(&mut self)

upload(): upload the image set with set_image.
Source§

fn needs_upload(&self) -> bool

Source§

fn as_any(&self) -> &dyn Any

Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.