Struct basis_universal::encoding::Compressor[][src]

pub struct Compressor(pub *mut Compressor);

Used to encode raw image data to basis-universal form

Implementations

impl Compressor[src]

pub fn new(total_thread_count: u32) -> Self[src]

total_thread_count is passed directly to basisu::job_pool total_thread_count is the TOTAL number of job pool threads, including the calling thread! So 2=1 new thread, 3=2 new threads, etc.

Call encoder_init

pub unsafe fn init(&mut self, params: &CompressorParams) -> bool[src]

Configure the compressor to compress images. CompressorParams includes both the image data and parameters that affect compression (such as quality or whether mipmaps should be generated)

Safety

Passing invalid parameters may cause undefined behavior. (The underlying C++ library does not thoroughly validate parameters)

pub unsafe fn process(&mut self) -> Result<(), CompressorErrorCode>[src]

Encodes the images as configured when calling init()

Safety

Compressing with invalid parameters may cause undefined behavior. (The underlying C++ library does not thoroughly validate parameters)

pub fn basis_file(&self) -> &[u8][src]

Access the compressed data. May be empty if process() was not yet called

pub fn basis_file_size(&self) -> u32[src]

Return the size of the encoded basis-universal data

pub fn bits_per_texel(&self) -> f64[src]

Returns the number of bits required per texel

pub fn any_source_image_has_alpha(&self) -> bool[src]

Returns if any source image has alpha

Trait Implementations

impl Default for Compressor[src]

impl Drop for Compressor[src]

impl Send for Compressor[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.