pub struct Texture2DConverter { /* private fields */ }Expand description
Main texture converter
This struct handles the conversion of Unity objects to Texture2D structures and provides methods for processing texture data.
Implementations§
Source§impl Texture2DConverter
impl Texture2DConverter
Sourcepub fn new(version: UnityVersion) -> Self
pub fn new(version: UnityVersion) -> Self
Create a new Texture2D converter
Sourcepub fn from_unity_object(&self, obj: &UnityObject) -> Result<Texture2D>
pub fn from_unity_object(&self, obj: &UnityObject) -> Result<Texture2D>
Convert Unity object to Texture2D
This method extracts texture data from a Unity object and creates a Texture2D structure with all necessary metadata.
Sourcepub fn decode_to_image(&self, texture: &Texture2D) -> Result<RgbaImage>
pub fn decode_to_image(&self, texture: &Texture2D) -> Result<RgbaImage>
Decode texture to RGBA image
This method uses the texture decoder to convert texture data to RGBA format
Auto Trait Implementations§
impl Freeze for Texture2DConverter
impl RefUnwindSafe for Texture2DConverter
impl Send for Texture2DConverter
impl Sync for Texture2DConverter
impl Unpin for Texture2DConverter
impl UnwindSafe for Texture2DConverter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more