#[repr(i32)]pub enum TranscoderBlockFormat {
Show 30 variants
ETC1,
ETC2_RGBA,
BC1,
BC3,
BC4,
BC5,
PVRTC1_4_RGB,
PVRTC1_4_RGBA,
BC7,
BC7_M5_COLOR,
BC7_M5_ALPHA,
ETC2_EAC_A8,
ASTC_4x4,
ATC_RGB,
ATC_RGBA_INTERPOLATED_ALPHA,
FXT1_RGB,
PVRTC2_4_RGB,
PVRTC2_4_RGBA,
ETC2_EAC_R11,
ETC2_EAC_RG11,
Indices,
RGB32,
RGBA32,
A32,
RGB565,
BGR565,
RGBA4444_COLOR,
RGBA4444_ALPHA,
RGBA4444_COLOR_OPAQUE,
RGBA4444,
}Expand description
The block format to transcode universal texture data into
Variants§
ETC1
ETC1S RGB
ETC2_RGBA
full ETC2 EAC RGBA8 block
BC1
DXT1 RGB
BC3
BC4 block followed by a four color BC1 block
BC4
DXT5A (alpha block only)
BC5
two BC4 blocks
PVRTC1_4_RGB
opaque-only PVRTC1 4bpp
PVRTC1_4_RGBA
PVRTC1 4bpp RGBA
BC7
Full BC7 block, any mode
BC7_M5_COLOR
RGB BC7 mode 5 color (writes an opaque mode 5 block)
BC7_M5_ALPHA
alpha portion of BC7 mode 5 (cBC7_M5_COLOR output data must have been written to the output buffer first to set the mode/rot fields etc.)
ETC2_EAC_A8
alpha block of ETC2 EAC (first 8 bytes of the 16-bit ETC2 EAC RGBA format)
ASTC_4x4
ASTC 4x4 (either color-only or color+alpha). Note that the transcoder always currently assumes sRGB is not enabled when outputting ASTC data. If you use a sRGB ASTC format you’ll get ~1 LSB of additional error, because of the different way ASTC decoders scale 8-bit endpoints to 16-bits during unpacking.
ATC_RGB
ATC_RGBA_INTERPOLATED_ALPHA
FXT1_RGB
Opaque-only, has oddball 8x4 pixel block size
PVRTC2_4_RGB
PVRTC2_4_RGBA
ETC2_EAC_R11
ETC2_EAC_RG11
Indices
Used internally: Write 16-bit endpoint and selector indices directly to output (output block must be at least 32-bits)
RGB32
Writes RGB components to 32bpp output pixels
RGBA32
Writes RGB255 components to 32bpp output pixels
A32
Writes alpha component to 32bpp output pixels
RGB565
BGR565
RGBA4444_COLOR
RGBA4444_ALPHA
RGBA4444_COLOR_OPAQUE
RGBA4444
Implementations§
source§impl TranscoderBlockFormat
impl TranscoderBlockFormat
sourcepub fn bytes_per_block_or_pixel(self) -> u32
pub fn bytes_per_block_or_pixel(self) -> u32
For compressed texture formats, this returns the # of bytes per block. For uncompressed, it returns the # of bytes per pixel.
sourcepub fn format_name(self) -> &'static str
pub fn format_name(self) -> &'static str
Returns format’s name in ASCII
sourcepub fn is_compressed(self) -> bool
pub fn is_compressed(self) -> bool
Returns true if the block format is a compressed format.
sourcepub fn block_width(self) -> u32
pub fn block_width(self) -> u32
Returns the block width for the specified texture format, which is currently either 4 or 8 for FXT1.
sourcepub fn block_height(self) -> u32
pub fn block_height(self) -> u32
Returns the block height for the specified texture format, which is currently always 4.
sourcepub fn calculate_minimum_output_buffer_blocks_or_pixels(
self,
original_width: u32,
original_height: u32,
total_slice_blocks: u32,
output_row_pitch_in_blocks_or_pixels: Option<u32>,
output_rows_in_pixels: Option<u32>
) -> u32
pub fn calculate_minimum_output_buffer_blocks_or_pixels( self, original_width: u32, original_height: u32, total_slice_blocks: u32, output_row_pitch_in_blocks_or_pixels: Option<u32>, output_rows_in_pixels: Option<u32> ) -> u32
Calculate the minimum output buffer required to store transcoded data in blocks for compressed formats and pixels for uncompressed formats
Trait Implementations§
source§impl Clone for TranscoderBlockFormat
impl Clone for TranscoderBlockFormat
source§fn clone(&self) -> TranscoderBlockFormat
fn clone(&self) -> TranscoderBlockFormat
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for TranscoderBlockFormat
impl Debug for TranscoderBlockFormat
source§impl From<i32> for TranscoderBlockFormat
impl From<i32> for TranscoderBlockFormat
source§fn from(value: basist_block_format) -> Self
fn from(value: basist_block_format) -> Self
source§impl Into<i32> for TranscoderBlockFormat
impl Into<i32> for TranscoderBlockFormat
source§fn into(self) -> basist_block_format
fn into(self) -> basist_block_format
source§impl PartialEq<TranscoderBlockFormat> for TranscoderBlockFormat
impl PartialEq<TranscoderBlockFormat> for TranscoderBlockFormat
source§fn eq(&self, other: &TranscoderBlockFormat) -> bool
fn eq(&self, other: &TranscoderBlockFormat) -> bool
self and other values to be equal, and is used
by ==.