#[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

source

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.

source

pub fn format_name(self) -> &'static str

Returns format’s name in ASCII

source

pub fn is_compressed(self) -> bool

Returns true if the block format is a compressed format.

source

pub fn block_width(self) -> u32

Returns the block width for the specified texture format, which is currently either 4 or 8 for FXT1.

source

pub fn block_height(self) -> u32

Returns the block height for the specified texture format, which is currently always 4.

source

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

source

pub fn calculate_minimum_output_buffer_bytes( 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 bytes

Trait Implementations§

source§

impl Clone for TranscoderBlockFormat

source§

fn clone(&self) -> TranscoderBlockFormat

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TranscoderBlockFormat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<i32> for TranscoderBlockFormat

source§

fn from(value: basist_block_format) -> Self

Converts to this type from the input type.
source§

impl Into<i32> for TranscoderBlockFormat

source§

fn into(self) -> basist_block_format

Converts this type into the (usually inferred) input type.
source§

impl PartialEq<TranscoderBlockFormat> for TranscoderBlockFormat

source§

fn eq(&self, other: &TranscoderBlockFormat) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for TranscoderBlockFormat

source§

impl StructuralPartialEq for TranscoderBlockFormat

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.