[−][src]Struct nvtt_rs::OutputOptions
Object which stores the output options for the texture.
Methods
impl OutputOptions
[src]
pub fn new() -> Result<Self, Error>
[src]
Create a new OutputOptions
.
pub fn into_raw(self) -> *mut NvttOutputOptions
[src]
Returns the underlying NvttOutputOptions
pointer type. It is your responsibility
to call nvttDestroyOutputOptions
on this value to clean up the NvttOutputOptions
resources.
pub fn set_output_location<'a, T: 'a + ?Sized + Into<OutputLocation<'a>>>(
&mut self,
out_location: T
) -> Result<&mut Self, PathConvertError>
[src]
&mut self,
out_location: T
) -> Result<&mut Self, PathConvertError>
Set the output location. This can be either a path or an in-memory
buffer. For more information, see the OutputLocation
type.
Notes
nvtt
only supports ASCII filenames on Windows. If you need to support
non-ASCII filenames, you will need to pass OutputLocation::Buffer
,
and then write the data into the file using another method. An example of
to do this is shown below.
Example
use nvtt_rs::{ CompressionOptions, CompressionOutput, Compressor, InputOptions, OutputLocation, OutputOptions, }; let compressor = Compressor::new()?; let input_opts = InputOptions::new()?; let compression_opts = CompressionOptions::new()?; let mut output_opts = OutputOptions::new()?; output_opts.set_output_location(OutputLocation::Buffer); // Set other texture options here... match compressor.compress(&compression_opts, &input_opts, &output_opts)? { CompressionOutput::Data(d) => { std::fs::write("OutFile.dds", &d[..])?; } _ => {} };
pub fn set_write_header<B: Into<NvttBoolean>>(
&mut self,
write_header: B
) -> &mut Self
[src]
&mut self,
write_header: B
) -> &mut Self
pub fn set_srgb_flag<B: Into<NvttBoolean>>(
&mut self,
write_srgb: B
) -> &mut Self
[src]
&mut self,
write_srgb: B
) -> &mut Self
pub fn set_container(&mut self, container: Container) -> &mut Self
[src]
Trait Implementations
impl Drop for OutputOptions
[src]
impl Debug for OutputOptions
[src]
Auto Trait Implementations
impl !Send for OutputOptions
impl !Sync for OutputOptions
impl Unpin for OutputOptions
impl UnwindSafe for OutputOptions
impl RefUnwindSafe for OutputOptions
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,