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)
| 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 |
no test coverage detected