更新UCD-API库及文档

This commit is contained in:
xinzhu.yin
2026-07-02 17:16:18 +08:00
parent a500751d85
commit 9fa811a9eb
290 changed files with 9558 additions and 2306 deletions

View File

@@ -1,8 +1,5 @@
from UniTAP.common import ColorInfo, VideoMode
from UniTAP.libs.lib_tsi.tsi_types import TSI_IMF_PK444_RGB_W8_C8, TSI_IMF_PK444_RGB_W16_C12, \
TSI_IMF_PK444_RGB_W16_C16, TSI_IMF_PK444_YCbCr_W8_C8, TSI_IMF_PK444_YCbCr_W16_C16, \
TSI_IMF_PK422_CbYCrY_W16_C8, TSI_IMF_PK422_CbYCrY_W16_C16, TSI_IMF_PK420_CxYY0_W8_C8, \
TSI_IMF_PK420_CxYY0_W8_C10, TSI_IMF_PK420_CxYY_W16_C12, TSI_IMF_PK420_CxYY_W16_C16
import UniTAP.libs.lib_tsi.tsi_types as ci
from .types import PGColorInfo, PGColorDepth, PGColorimetry, PGDynamicRange
@@ -106,30 +103,30 @@ def pg_pixel_format_from_vm(vm: VideoMode) -> int:
if color_format == ColorInfo.ColorFormat.CF_RGB:
if bpc == 8:
return TSI_IMF_PK444_RGB_W8_C8
return ci.TSI_IMF_PK444_RGB_W8_C8
elif bpc in [10, 12]:
return TSI_IMF_PK444_RGB_W16_C12
return ci.TSI_IMF_PK444_RGB_W16_C12
elif bpc == 16:
return TSI_IMF_PK444_RGB_W16_C16
return ci.TSI_IMF_PK444_RGB_W16_C16
elif color_format == ColorInfo.ColorFormat.CF_YCbCr_444:
if bpc == 8:
return TSI_IMF_PK444_YCbCr_W8_C8
return ci.TSI_IMF_PK444_YCbCr_W8_C8
elif bpc in [10, 12, 16]:
return TSI_IMF_PK444_YCbCr_W16_C16
return ci.TSI_IMF_PK444_YCbCr_W16_C16
elif color_format == ColorInfo.ColorFormat.CF_YCbCr_422:
if bpc == 8:
return TSI_IMF_PK422_CbYCrY_W16_C8
return ci.TSI_IMF_PK422_CbYCrY_W16_C8
elif bpc in [10, 12, 16]:
return TSI_IMF_PK422_CbYCrY_W16_C16
return ci.TSI_IMF_PK422_CbYCrY_W16_C16
elif color_format == ColorInfo.ColorFormat.CF_YCbCr_420:
if bpc == 8:
return TSI_IMF_PK420_CxYY0_W8_C8
return ci.TSI_IMF_PK420_CxYY0_W8_C8
elif bpc == 10:
return TSI_IMF_PK420_CxYY0_W8_C10
return ci.TSI_IMF_PK420_CxYY0_W8_C10
elif bpc == 12:
return TSI_IMF_PK420_CxYY_W16_C12
return ci.TSI_IMF_PK420_CxYY_W16_C12
elif bpc == 16:
return TSI_IMF_PK420_CxYY_W16_C16
return ci.TSI_IMF_PK420_CxYY_W16_C16
return 0xffffffff