[−][src]Struct nvtt_rs::Compressor
The Compressor
is used to perform the texture compression. This provides a
safer interface for the NvttCompressor
type.
Implementations
impl Compressor
[src]
pub fn new() -> Result<Self, Error>
[src]
Create a new Compressor
. If the Compressor
cannot be created, returns
Error::Unknown
.
pub fn into_raw(self) -> *mut NvttCompressor
[src]
Returns the underlying NvttCompressor
pointer type. It is your responsibility
to call nvttDestroyCompressor
on this value to clean up the NvttCompressor
resources.
pub fn enable_cuda_acceleration<B: Into<NvttBoolean>>(
&mut self,
enable: B
) -> &mut Self
[src]
&mut self,
enable: B
) -> &mut Self
If the platform supports the cuda
api, this method can be used to enable
gpu compression. This may give different results to a pure cpu implementation,
so this is set to false
by default.
On platforms without cuda
, this function is a no-op.
pub fn is_cuda_acceleration_enabled(&self) -> bool
[src]
Returns true
if cuda acceleration has been enabled. Otherwise, returns
false.
pub fn compress(
&self,
compress_options: &CompressionOptions,
input_options: &InputOptions,
output_options: &OutputOptions
) -> Result<CompressionOutput, Error>
[src]
&self,
compress_options: &CompressionOptions,
input_options: &InputOptions,
output_options: &OutputOptions
) -> Result<CompressionOutput, Error>
Perform the compression.
pub fn estimate_size(
&self,
input_options: &InputOptions,
compression_options: &CompressionOptions
) -> usize
[src]
&self,
input_options: &InputOptions,
compression_options: &CompressionOptions
) -> usize
Estimate the final compressed size of the output texture.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Compressor
impl !Sync for Compressor
impl Unpin for Compressor
impl UnwindSafe for Compressor
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,
pub 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.
pub 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>,