pub struct TextureExporter;Expand description
Texture exporter utility
This struct provides methods for exporting texture data to various image formats.
Implementations§
Source§impl TextureExporter
impl TextureExporter
Sourcepub fn export_png<P: AsRef<Path>>(image: &RgbaImage, path: P) -> Result<()>
pub fn export_png<P: AsRef<Path>>(image: &RgbaImage, path: P) -> Result<()>
Export texture as PNG
This is the most common export format, providing lossless compression with full alpha channel support.
Sourcepub fn export_jpeg<P: AsRef<Path>>(
image: &RgbaImage,
path: P,
quality: u8,
) -> Result<()>
pub fn export_jpeg<P: AsRef<Path>>( image: &RgbaImage, path: P, quality: u8, ) -> Result<()>
Export texture as JPEG
Note: JPEG does not support alpha channel, so alpha will be lost.
Sourcepub fn export_bmp<P: AsRef<Path>>(image: &RgbaImage, path: P) -> Result<()>
pub fn export_bmp<P: AsRef<Path>>(image: &RgbaImage, path: P) -> Result<()>
Export texture as BMP
Sourcepub fn export_tiff<P: AsRef<Path>>(image: &RgbaImage, path: P) -> Result<()>
pub fn export_tiff<P: AsRef<Path>>(image: &RgbaImage, path: P) -> Result<()>
Export texture as TIFF
Sourcepub fn export_auto<P: AsRef<Path>>(image: &RgbaImage, path: P) -> Result<()>
pub fn export_auto<P: AsRef<Path>>(image: &RgbaImage, path: P) -> Result<()>
Export texture with automatic format detection based on file extension
Sourcepub fn export_with_format<P: AsRef<Path>>(
image: &RgbaImage,
path: P,
format: ImageFormat,
) -> Result<()>
pub fn export_with_format<P: AsRef<Path>>( image: &RgbaImage, path: P, format: ImageFormat, ) -> Result<()>
Export texture with custom format and options
Sourcepub fn supported_formats() -> Vec<&'static str>
pub fn supported_formats() -> Vec<&'static str>
Get supported export formats
Sourcepub fn is_format_supported(extension: &str) -> bool
pub fn is_format_supported(extension: &str) -> bool
Check if a format is supported for export
Sourcepub fn create_filename(base_name: &str, format: &str) -> String
pub fn create_filename(base_name: &str, format: &str) -> String
Create a filename with the given base name and format extension
Sourcepub fn validate_for_export(image: &RgbaImage) -> Result<()>
pub fn validate_for_export(image: &RgbaImage) -> Result<()>
Validate that the image has valid dimensions for export
Auto Trait Implementations§
impl Freeze for TextureExporter
impl RefUnwindSafe for TextureExporter
impl Send for TextureExporter
impl Sync for TextureExporter
impl Unpin for TextureExporter
impl UnwindSafe for TextureExporter
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