Struct three_d::io::Loaded [−][src]
pub struct Loaded { /* fields omitted */ }
Expand description
Contains the resources loaded using the Loader and/or manually inserted using the insert_bytes method. Use the remove_bytes or get_bytes function to extract the raw byte array for the loaded resource or one of the other methods to both extract and deserialize a loaded resource.
Implementations
Constructs a new empty set of loaded files. Use this together with insert_bytes to load resources from an unsuported source and then parse them as usual using the functionality on Loaded.
Remove and returns the loaded byte array for the resource at the given path. The byte array then has to be deserialized to whatever type this resource is (image, 3D model etc.).
Returns a reference to the loaded byte array for the resource at the given path. The byte array then has to be deserialized to whatever type this resource is (image, 3D model etc.).
Deserialize a loaded .obj file resource and .mtl material file resource (if present) into a list of meshes and materials. It uses the wavefront-obj crate.
Deserialize the loaded image resource at the given path into a CPUTexture using the image crate. The CPUTexture can then be used to create a Texture2D. Supported formats: PNG, JPEG, GIF, WebP, pnm (pbm, pgm, ppm and pam), TIFF, DDS, BMP, ICO, HDR, farbfeld. Note: If the image contains high dynamic range (hdr) information, use hdr_image instead.
Deserialize the loaded image resource with hdr information at the given path into a CPUTexture using
the image crate.
The CPUTexture can then be used to create a Texture2D or a TextureCubeMap using the new_from_equirectangular
method.
Supported formats: HDR.
pub fn cube_image<P: AsRef<Path>>(
&mut self,
right_path: P,
left_path: P,
top_path: P,
bottom_path: P,
front_path: P,
back_path: P
) -> ThreeDResult<CPUTextureCube<u8>>
pub fn cube_image<P: AsRef<Path>>(
&mut self,
right_path: P,
left_path: P,
top_path: P,
bottom_path: P,
front_path: P,
back_path: P
) -> ThreeDResult<CPUTextureCube<u8>>
Deserialize the 6 loaded image resources at the given paths into a CPUTextureCube using the image crate. The CPUTextureCube can then be used to create a TextureCubeMap.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Loaded
impl !UnwindSafe for Loaded
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more