Struct basis_universal::encoding::Compressor [−][src]
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
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>,