pub fn encode_into(
format: TextureFormat,
dst: &mut [u8],
src: &[u8],
width: u32,
height: u32,
)Expand description
Encodes a Nintendo GameCube or Wii texture into the specified format and writes the result into the provided destination buffer.
Based on the alignment of the texture’s dimensions, this method determines if the fast encoding method (encode_fast) can be utilized.
If the texture dimensions are not block-aligned, padding will be handled, and then the fast encoding method is employed.
§Arguments
format- The format of the texture specific to GameCube and Wii to which the source data will be encoded.dst- The destination buffer to write the encoded data into.src- The source buffer containing the RGBA texture data to be encoded.width- The width of the texture.height- The height of the texture.
§Panics
This function will panic if:
- The destination buffer is too small to hold the encoded data for the specified format and texture dimensions.
- The source buffer does not have the expected size for the given
widthandheight. - An unsupported
TextureFormatis provided.