Struct basis_universal::encoding::CompressorParams[][src]

pub struct CompressorParams(pub *mut CompressorParams);

Parameters that are used to configure a Compressor

Implementations

impl CompressorParams[src]

pub fn new() -> Self[src]

Create a compressor with default options

pub fn reset(&mut self)[src]

Resets the compressor params to default state

pub fn source_image_mut(&mut self, image_index: u32) -> CompressorImageRef[src]

Get a reference to the source index. The internal list of source images is resized as needed such that the image will exist

pub fn resize_source_image_list(&mut self, size: u32)[src]

Resizes the source image list. If the provided length is shorter than the list, the data beyond the provided length is truncated.

pub fn clear_source_image_list(&mut self)[src]

Resets the image list to be zero-length

pub fn set_print_status_to_stdout(&mut self, print_status_to_stdout: bool)[src]

Enable stdout logging

pub fn set_etc1s_quality_level(&mut self, quality_level: u32)[src]

Set ETC1S quality level. The value MUST be >= ETC1S_QUALITY_MIN and <= ETC1S_QUALITY_MAX.

pub fn set_uastc_quality_level(&mut self, quality_level: u32)[src]

Sets UASTC quality level. The value MUST be >= UASTC_QUALITY_MIN and <= UASTC_QUALITY_MAX.

pub fn set_use_global_codebook(&mut self, use_global_codebook: bool)[src]

Use the global codebook to compress the image. slightly smaller files, but lower quality, slower encoding

pub fn set_auto_use_global_codebook(&mut self, auto_use_global_codebook: bool)[src]

Automatically use virtual selector palettes on small images for slightly smaller files (defaults to off for faster encoding time)

pub fn set_basis_format(&mut self, basis_format: BasisTextureFormat)[src]

Set the basis format we will compress to. See basis documentation for details. This corresponds to the -uastc flag in the basisu command line tool and the m_uastc boolean param on basis_compressor_params in the original library

UASTC encoding result in significantly higher texture quality, but larger files.

pub fn set_color_space(&mut self, color_space: ColorSpace)[src]

Sets the color space the images to be compressed is encoded in

Setting a linear color space will:

  • Use linear colorspace metrics (instead of the default sRGB)
  • By default use linear (not sRGB) mipmap filtering

pub fn set_mip_color_space(&mut self, color_space: ColorSpace)[src]

Override the mipmap generation color space behavior. This function is not necessary to call if you call [set_color_space] with the correct value.

  • If the color space is sRGB, convert image to linear before filtering, then back to sRGB
  • If the color space is linear, we keep the image in linear during mipmap filtering (i.e. do not convert to/from sRGB for filtering purposes)

pub fn set_no_selector_rdo(&mut self, no_selector_rdo: bool)[src]

Disable backend's selector rate distortion optimizations (slightly faster, less noisy output, but lower quality per output bit)

pub fn set_no_endpoint_rdo(&mut self, no_endpoint_rdo: bool)[src]

Disable backend's endpoint rate distortion optimizations (slightly faster, less noisy output, but lower quality per output bit)

pub fn set_generate_mipmaps(&mut self, generate_mipmaps: bool)[src]

Generate mipmaps for each source image

By default, sRGB textures will be converted from sRGB to linear before mipmap filtering. This can be changed by calling [set_color_space] or [set_mip_color_space]

pub fn set_mipmap_smallest_dimension(&mut self, smallest_dimension: u32)[src]

Sets the smallest dimension mipmap that will be generated

pub fn set_userdata(&mut self, userdata: UserData)[src]

Set arbitrary userdata to be included with the basis-universal binary data

pub fn tune_for_normal_maps(&mut self)[src]

The basisu command line compressor offers a -normal_map parameter that sets several values automatically. This convenience function mimics that parameter.

  • linear colorspace metrics
  • linear mipmap filtering
  • no selector RDO
  • no sRGB

Trait Implementations

impl Drop for CompressorParams[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.