pub struct CompressorParams(pub *mut CompressorParams);
Expand description
Parameters that are used to configure a Compressor
Tuple Fields§
§0: *mut CompressorParams
Implementations§
Source§impl CompressorParams
impl CompressorParams
Sourcepub fn source_image_mut(&mut self, image_index: u32) -> CompressorImageRef
pub fn source_image_mut(&mut self, image_index: u32) -> CompressorImageRef
Get a reference to the source index. The internal list of source images is resized as needed such that the image will exist
Sourcepub fn resize_source_image_list(&mut self, size: u32)
pub fn resize_source_image_list(&mut self, size: u32)
Resizes the source image list. If the provided length is shorter than the list, the data beyond the provided length is truncated.
Sourcepub fn clear_source_image_list(&mut self)
pub fn clear_source_image_list(&mut self)
Resets the image list to be zero-length
Sourcepub fn source_mipmap_image_mut(
&mut self,
image_index: u32,
level: u32,
) -> CompressorImageRef
pub fn source_mipmap_image_mut( &mut self, image_index: u32, level: u32, ) -> CompressorImageRef
Get a reference to the source index. The internal list of source images is resized as needed such that the image will exist
Sourcepub fn resize_source_mipmap_image_list(&mut self, size: u32)
pub fn resize_source_mipmap_image_list(&mut self, size: u32)
Resizes the source image list. If the provided length is shorter than the list, the data beyond the provided length is truncated.
Sourcepub fn resize_source_mipmap_level_image_list(&mut self, level: u32, size: u32)
pub fn resize_source_mipmap_level_image_list(&mut self, level: u32, size: u32)
Resizes the source image list. If the provided length is shorter than the list, the data beyond the provided length is truncated.
Sourcepub fn clear_source_mipmap_image_list(&mut self)
pub fn clear_source_mipmap_image_list(&mut self)
Resets the image list to be zero-length
Sourcepub fn set_print_status_to_stdout(&mut self, print_status_to_stdout: bool)
pub fn set_print_status_to_stdout(&mut self, print_status_to_stdout: bool)
Enable stdout logging
Sourcepub fn set_etc1s_quality_level(&mut self, quality_level: u32)
pub fn set_etc1s_quality_level(&mut self, quality_level: u32)
Set ETC1S quality level. The value MUST be >= ETC1S_QUALITY_MIN and <= ETC1S_QUALITY_MAX.
Sourcepub fn set_uastc_quality_level(&mut self, quality_level: u32)
pub fn set_uastc_quality_level(&mut self, quality_level: u32)
Sets UASTC quality level. The value MUST be >= UASTC_QUALITY_MIN and <= UASTC_QUALITY_MAX.
Sourcepub fn set_basis_format(&mut self, basis_format: BasisTextureFormat)
pub fn set_basis_format(&mut self, basis_format: BasisTextureFormat)
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.
Sourcepub fn set_color_space(&mut self, color_space: ColorSpace)
pub fn set_color_space(&mut self, color_space: ColorSpace)
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
Sourcepub fn set_mip_color_space(&mut self, color_space: ColorSpace)
pub fn set_mip_color_space(&mut self, color_space: ColorSpace)
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)
Sourcepub fn set_no_selector_rdo(&mut self, no_selector_rdo: bool)
pub fn set_no_selector_rdo(&mut self, no_selector_rdo: bool)
Disable backend’s selector rate distortion optimizations (slightly faster, less noisy output, but lower quality per output bit)
Sourcepub fn set_no_endpoint_rdo(&mut self, no_endpoint_rdo: bool)
pub fn set_no_endpoint_rdo(&mut self, no_endpoint_rdo: bool)
Disable backend’s endpoint rate distortion optimizations (slightly faster, less noisy output, but lower quality per output bit)
Sourcepub fn set_rdo_uastc(&mut self, rdo_uastc_quality_scalar: Option<f32>)
pub fn set_rdo_uastc(&mut self, rdo_uastc_quality_scalar: Option<f32>)
Enable/disable UASTC RDO post-processing and set UASTC RDO quality scalar to X. Lower values=higher quality/larger LZ compressed files, higher values=lower quality/smaller LZ compressed files. Good range to try is [.2-4]
Sourcepub fn set_generate_mipmaps(&mut self, generate_mipmaps: bool)
pub fn set_generate_mipmaps(&mut self, generate_mipmaps: bool)
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]
Sourcepub fn set_mipmap_smallest_dimension(&mut self, smallest_dimension: u32)
pub fn set_mipmap_smallest_dimension(&mut self, smallest_dimension: u32)
Sets the smallest dimension mipmap that will be generated
Sourcepub fn set_userdata(&mut self, userdata: UserData)
pub fn set_userdata(&mut self, userdata: UserData)
Set arbitrary userdata to be included with the basis-universal binary data
Sourcepub fn tune_for_normal_maps(&mut self)
pub fn tune_for_normal_maps(&mut self)
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