Struct basis_universal::encoding::Compressor [−][src]
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]
pub fn bits_per_texel(&self) -> f64[src]
pub fn any_source_image_has_alpha(&self) -> bool[src]
Trait Implementations
impl Default for Compressor[src]
impl Drop for Compressor[src]
Auto Trait Implementations
impl RefUnwindSafe for Compressor[src]
impl !Send for Compressor[src]
impl !Sync for Compressor[src]
impl Unpin for Compressor[src]
impl UnwindSafe for Compressor[src]
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>,