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

Method transcode_tfmt

python/basisu_py/transcoder.py:471–490  ·  view source on GitHub ↗

High-level convenience wrapper for transcode_tfmt_handle(). Automatically opens/closes the KTX2 file.

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

Source from the content-addressed store, hash-verified

469 # tfmt: the TranscoderTextureFormat to transcode too
470 # -----------------------------------------------------------------------
471 def transcode_tfmt(self, ktx2_bytes: bytes, tfmt: int,
472 level=0, layer=0, face=0, decode_flags=0,
473 channel0=-1, channel1=-1):
474 """
475 High-level convenience wrapper for transcode_tfmt_handle().
476 Automatically opens/closes the KTX2 file.
477 """
478 ktx2_handle = self.open(ktx2_bytes)
479 try:
480 return self.transcode_tfmt_handle(
481 ktx2_handle, tfmt,
482 level=level,
483 layer=layer,
484 face=face,
485 decode_flags=decode_flags,
486 channel0=channel0,
487 channel1=channel1
488 )
489 finally:
490 self.close(ktx2_handle)
491
492 # -----------------------------------------------------------------------
493 # Low-level: choose a specific transcoder_texture_format from a family string

Callers 1

Calls 3

openMethod · 0.95
transcode_tfmt_handleMethod · 0.95
closeMethod · 0.95

Tested by

no test coverage detected