[][src]Struct nvtt_rs::Compressor

pub struct Compressor(_);

The Compressor is used to perform the texture compression.

Methods

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]

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]

Perform the compression.

pub fn estimate_size(
    &self,
    input_options: &InputOptions,
    compression_options: &CompressionOptions
) -> usize
[src]

Estimate the final compressed size of the output texture.

Trait Implementations

impl Drop for Compressor[src]

impl Debug for Compressor[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]