MCPcopy Create free account
hub / github.com/BinomialLLC/basis_universal / transcode

Method transcode

python/basisu_py/transcoder.py:701–732  ·  view source on GitHub ↗

High-level version of transcode_handle(). Calls transcode_handle() internally. Returns: (data_bytes, tfmt, block_width, block_height)

(
        self,
        ktx2_bytes: bytes,
        family: str,
        level=0,
        layer=0,
        face=0,
        decode_flags=0,
        channel0=-1,
        channel1=-1
    )

Source from the content-addressed store, hash-verified

699 # levels/faces/layers.)
700 # -----------------------------------------------------------------------
701 def transcode(
702 self,
703 ktx2_bytes: bytes,
704 family: str,
705 level=0,
706 layer=0,
707 face=0,
708 decode_flags=0,
709 channel0=-1,
710 channel1=-1
711 ):
712 """
713 High-level version of transcode_handle().
714 Calls transcode_handle() internally.
715
716 Returns:
717 (data_bytes, tfmt, block_width, block_height)
718 """
719 ktx2_handle = self.open(ktx2_bytes)
720 try:
721 return self.transcode_handle(
722 ktx2_handle,
723 family,
724 level=level,
725 layer=layer,
726 face=face,
727 decode_flags=decode_flags,
728 channel0=channel0,
729 channel1=channel1
730 )
731 finally:
732 self.close(ktx2_handle)
733
734 def tfmt_name(self, tfmt: int):
735 return TranscoderTextureFormat(tfmt).name

Callers

nothing calls this directly

Calls 3

openMethod · 0.95
transcode_handleMethod · 0.95
closeMethod · 0.95

Tested by

no test coverage detected