[−][src]Struct nvtt_rs::OutputOptions
Object which stores the output options for the texture. This provides a
safer interface for the NvttOutputOptions
type.
Implementations
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.
The OutputOptions
will write to a buffer unless specified otherwise.
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::Memory { data, .. } => { std::fs::write("OutFile.dds", &data[..])?; } _ => {} };
pub fn set_write_header<B: Into<NvttBoolean>>(
&mut self,
write_header: B
) -> &mut Self
[src]
&mut self,
write_header: B
) -> &mut Self
If set to true
, then the OutputOptions
will write texture metadata into a
header section of the file.
pub fn set_srgb_flag<B: Into<NvttBoolean>>(
&mut self,
write_srgb: B
) -> &mut Self
[src]
&mut self,
write_srgb: B
) -> &mut Self
If write_srgb
is set to true, then the output image will be in the sRGB colorspace.
pub fn set_container(&mut self, container: Container) -> &mut Self
[src]
Set the Container
type of the output image.
Trait Implementations
impl Debug for OutputOptions
[src]
impl Drop for OutputOptions
[src]
impl Send for OutputOptions
[src]
impl Sync for OutputOptions
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,