diff --git a/.github/workflows/wheel_workflow.yml b/.github/workflows/wheel_workflow.yml index 376b006c0..c8a1d7d2e 100644 --- a/.github/workflows/wheel_workflow.yml +++ b/.github/workflows/wheel_workflow.yml @@ -144,6 +144,9 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 env: + # pass GITHUB_ACTIONS through to the build container so that custom + # processes can tell they are running in CI. + CIBW_ENVIRONMENT_PASS_LINUX: GITHUB_ACTIONS CIBW_BUILD: ${{ matrix.python }} CIBW_ARCHS: ${{ matrix.arch }} CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux }} @@ -151,7 +154,11 @@ jobs: - uses: actions/upload-artifact@v4 with: name: cibw-wheels-${{ matrix.python }}-${{ matrix.manylinux }} - path: ./wheelhouse/*.whl + path: | + ./wheelhouse/*.whl + ./wheelhouse/PyOpenColorIO/__init__.pyi + # if stub validation fails we want to upload the stubs for users to review + if: success() || failure() # --------------------------------------------------------------------------- # Linux ARM Wheels @@ -213,7 +220,11 @@ jobs: - uses: actions/upload-artifact@v4 with: name: cibw-wheels-${{ matrix.python }}-${{ matrix.manylinux }} - path: ./wheelhouse/*.whl + path: | + ./wheelhouse/*.whl + ./wheelhouse/PyOpenColorIO/__init__.pyi + # if stub validation fails we want to upload the stubs for users to review + if: success() || failure() # --------------------------------------------------------------------------- # macOS Wheels diff --git a/docs/quick_start/installation.rst b/docs/quick_start/installation.rst index 8b8e275d5..c64b038df 100644 --- a/docs/quick_start/installation.rst +++ b/docs/quick_start/installation.rst @@ -536,3 +536,51 @@ Note: For other user facing environment variables, see :ref:`using_env_vars`. for Windows, Linux and macOS respectively. For systems that supports it, it is also possible to edit the RPATH of the plugin to add the location of the shared OpenColorIO lib. + +Updating python type stubs +========================== + +The python stubs are built by analyzing the docstrings generated by pybind11 +and are used to drive IDE code completion and static analysis. Changes to +the bindings that result in changes to the stubs should be reviewed together +in a single pull request, so that regressions are not unwittingly introduced. + +The workflow looks like this: + +- Install `uv `_ and + ``docker`` +- Create the temp build directory, cd into it, and run ``cmake /path/to/source`` +- Run ``cmake --build . --target pystubs`` to generate updated stubs in + ``src/bindings/python/stubs/__init__.pyi`` +- Commit the new stubs and push to Github +- In CI, the stubs will be included in the wheels built by ``cibuildwheel``, as + defined in ``.github/workflows/wheel_workflow.yml`` +- In CI, one of the ``cibuildwheel`` Github actions will rebuild the stubs to a + temp location and verify that they match what has been committed to the repo. + This step ensures that if changes to the C++ source code and bindings results + in a change to the stubs, developers are notified of the need to regenerate + the stubs, so that changes can be reviewed and the rules in ``generate_stubs.py`` + can be updated, if necessary. + +If you want to bypass the use of docker, you can use the following steps to +build the python bindings and run the stub generator directly (requires python +3.11+): + +.. code-block:: bash + + python -m venv .venv + . .venv/bin/activate + mkdir build + cd build + cmake -DPython_EXECUTABLE=$(which python) -DCMAKE_INSTALL_PREFIX=../dist .. + cmake --build . --target=install + # extract the deps from the pyproject.toml and install them into the virtualenv + PY_DEPS=$(python -c "import tomllib;print(tomllib.load(open('../pyproject.toml', 'rb'))['tool']['cibuildwheel']['overrides'][0]['test-requires'])") + pip install ${PY_DEPS} + PY_VER=$(python -c "import sys;print(f'{sys.version_info[0]}.{sys.version_info[1]}')") + # generate stubs + PYTHONPATH=../dist/lib/python$PY_VER/site-packages python ../src/bindings/python/stubs/generate_stubs.py + +If all else fails and you can't build the stubs locally, you can push changes +to CI and download an artifact containing the wheel and ``__init__.pyi`` file from +any job that fails the stub validation. diff --git a/pyproject.toml b/pyproject.toml index 356f50f21..607deec6a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,3 +40,33 @@ before-build = "share/ci/scripts/macos/install_docs_env.sh" # Disable for now as wheels are built with static dependencies. environment = { PATH="$GITHUB_WORKSPACE/doxygen;$PATH", OCIO_PYTHON_LOAD_DLLS_FROM_PATH="0" } before-build = 'bash -c "share/ci/scripts/windows/install_docs_env.sh $GITHUB_WORKSPACE/doxygen"' + +[[tool.cibuildwheel.overrides]] +# Trigger the build & validation of the python stubs for certain platforms. +# The test command acts as a kind of "post-build" callback where it's possible +# for the stub-generator to import the freshly-built wheel. +# There are two entry-points which are designed to call generate_stubs.py through +# this test command: +# - `cmake /path/to/source; cmake --build . --target pystubs` is called during +# local development to generate the stubs and copy them into the git repo to +# be committed and reviewed. +# - in CI, the cibuildwheel action is used to validate that the stubs match what +# has been committed to the repo. +test-requires = "mypy~=1.15.0 stubgenlib~=0.2.0" +# Note: the python version here must be kept in sync with src/bindings/python/CMakeLists.txt +select = "cp311-manylinux_*64" +inherit.test-command = "append" +test-command = [ + "python {project}/src/bindings/python/stubs/generate_stubs.py --out-path '/output' --validate-path '{project}/src/bindings/python/stubs/PyOpenColorIO/__init__.pyi'", +] + +[tool.mypy] +files = [ + "tests/python/", + "src/bindings/python/stubs", +] +allow_redefinition = true +check_untyped_defs = true +disable_error_code = [ + "func-returns-value", +] \ No newline at end of file diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt index 94af56302..6e970c465 100644 --- a/src/bindings/python/CMakeLists.txt +++ b/src/bindings/python/CMakeLists.txt @@ -234,6 +234,8 @@ if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY) endif() file(COPY package/__init__.py DESTINATION "${_PyOpenColorIO_BUILD_PACKAGE_DIR}") +file(COPY stubs/PyOpenColorIO/__init__.pyi DESTINATION "${_PyOpenColorIO_BUILD_PACKAGE_DIR}") +file(COPY stubs/PyOpenColorIO/py.typed DESTINATION "${_PyOpenColorIO_BUILD_PACKAGE_DIR}") ############################################################################### # Install layout @@ -259,3 +261,30 @@ install(TARGETS PyOpenColorIO ) install(FILES package/__init__.py DESTINATION ${_PyOpenColorIO_SITE_PACKAGE_DIR}) +install(FILES stubs/PyOpenColorIO/__init__.pyi DESTINATION ${_PyOpenColorIO_SITE_PACKAGE_DIR}) +install(FILES stubs/PyOpenColorIO/py.typed DESTINATION ${_PyOpenColorIO_SITE_PACKAGE_DIR}) + +############################################################################### + +# Note: the python version must be kept in sync with `[[tool.cibuildwheel.overrides]]` in pyproject.toml. +# The stubs are generated within a container so the version of python does not need to match +# the version of python that OpenColorIO is being built against. +# Note: the version of cibuildwheel should be kept in sync with .github/workflows/wheel.yml +add_custom_command (COMMAND ${Python_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/bindings/python/stubs/generate_stubs_local.py + --repo-root ${CMAKE_SOURCE_DIR} --python-version="3.11" --cibuildwheel-version="2.22.0" + --output-dir "${CMAKE_BINARY_DIR}/wheelhouse" + OUTPUT "${CMAKE_BINARY_DIR}/wheelhouse/PyOpenColorIO/__init__.pyi" + DEPENDS "${CMAKE_SOURCE_DIR}/src/bindings/python/stubs/generate_stubs.py" + DEPENDS "${CMAKE_SOURCE_DIR}/src/bindings/python/stubs/generate_stubs_local.py" + COMMENT "pystubs: Generating python stubs" + ) + +add_custom_command (COMMAND ${CMAKE_COMMAND} -E copy + "${CMAKE_BINARY_DIR}/wheelhouse/PyOpenColorIO/__init__.pyi" + "${CMAKE_SOURCE_DIR}/src/bindings/python/stubs/PyOpenColorIO/__init__.pyi" + OUTPUT "${CMAKE_SOURCE_DIR}/src/bindings/python/stubs/PyOpenColorIO/__init__.pyi" + DEPENDS "${CMAKE_BINARY_DIR}/wheelhouse/PyOpenColorIO/__init__.pyi" + COMMENT "pystubs: Copying generated stubs to source" + ) + +add_custom_target (pystubs DEPENDS "${CMAKE_SOURCE_DIR}/src/bindings/python/stubs/PyOpenColorIO/__init__.pyi") diff --git a/src/bindings/python/stubs/PyOpenColorIO/__init__.pyi b/src/bindings/python/stubs/PyOpenColorIO/__init__.pyi new file mode 100644 index 000000000..2ebe64dbc --- /dev/null +++ b/src/bindings/python/stubs/PyOpenColorIO/__init__.pyi @@ -0,0 +1,2631 @@ +# +# This file is auto-generated. DO NOT MODIFY! +# See docs/quick_start/installation.rst for more info +# + +import numpy +from typing import Callable, ClassVar, Iterable, Iterator, overload +from typing_extensions import Buffer + +ALLOCATION_LG2: Allocation +ALLOCATION_UNIFORM: Allocation +ALLOCATION_UNKNOWN: Allocation +AutoStride: int +BIT_DEPTH_F16: BitDepth +BIT_DEPTH_F32: BitDepth +BIT_DEPTH_UINT10: BitDepth +BIT_DEPTH_UINT12: BitDepth +BIT_DEPTH_UINT14: BitDepth +BIT_DEPTH_UINT16: BitDepth +BIT_DEPTH_UINT32: BitDepth +BIT_DEPTH_UINT8: BitDepth +BIT_DEPTH_UNKNOWN: BitDepth +CDL_ASC: CDLStyle +CDL_NO_CLAMP: CDLStyle +CDL_TRANSFORM_DEFAULT: CDLStyle +CHANNEL_ORDERING_ABGR: ChannelOrdering +CHANNEL_ORDERING_BGR: ChannelOrdering +CHANNEL_ORDERING_BGRA: ChannelOrdering +CHANNEL_ORDERING_RGB: ChannelOrdering +CHANNEL_ORDERING_RGBA: ChannelOrdering +COLORSPACE_ACTIVE: ColorSpaceVisibility +COLORSPACE_ALL: ColorSpaceVisibility +COLORSPACE_DIR_FROM_REFERENCE: ColorSpaceDirection +COLORSPACE_DIR_TO_REFERENCE: ColorSpaceDirection +COLORSPACE_INACTIVE: ColorSpaceVisibility +DEFAULT_RULE_NAME: str +DYNAMIC_PROPERTY_CONTRAST: DynamicPropertyType +DYNAMIC_PROPERTY_EXPOSURE: DynamicPropertyType +DYNAMIC_PROPERTY_GAMMA: DynamicPropertyType +DYNAMIC_PROPERTY_GRADING_PRIMARY: DynamicPropertyType +DYNAMIC_PROPERTY_GRADING_RGBCURVE: DynamicPropertyType +DYNAMIC_PROPERTY_GRADING_TONE: DynamicPropertyType +ENV_ENVIRONMENT_LOAD_ALL: EnvironmentMode +ENV_ENVIRONMENT_LOAD_PREDEFINED: EnvironmentMode +ENV_ENVIRONMENT_UNKNOWN: EnvironmentMode +EXPOSURE_CONTRAST_LINEAR: ExposureContrastStyle +EXPOSURE_CONTRAST_LOGARITHMIC: ExposureContrastStyle +EXPOSURE_CONTRAST_VIDEO: ExposureContrastStyle +FILE_PATH_SEARCH_RULE_NAME: str +FIXED_FUNCTION_ACES_DARK_TO_DIM_10: FixedFunctionStyle +FIXED_FUNCTION_ACES_GAMUTMAP_02: FixedFunctionStyle +FIXED_FUNCTION_ACES_GAMUTMAP_07: FixedFunctionStyle +FIXED_FUNCTION_ACES_GAMUT_COMPRESS_20: FixedFunctionStyle +FIXED_FUNCTION_ACES_GAMUT_COMP_13: FixedFunctionStyle +FIXED_FUNCTION_ACES_GLOW_03: FixedFunctionStyle +FIXED_FUNCTION_ACES_GLOW_10: FixedFunctionStyle +FIXED_FUNCTION_ACES_OUTPUT_TRANSFORM_20: FixedFunctionStyle +FIXED_FUNCTION_ACES_RED_MOD_03: FixedFunctionStyle +FIXED_FUNCTION_ACES_RED_MOD_10: FixedFunctionStyle +FIXED_FUNCTION_ACES_RGB_TO_JMH_20: FixedFunctionStyle +FIXED_FUNCTION_ACES_TONESCALE_COMPRESS_20: FixedFunctionStyle +FIXED_FUNCTION_LIN_TO_DOUBLE_LOG: FixedFunctionStyle +FIXED_FUNCTION_LIN_TO_GAMMA_LOG: FixedFunctionStyle +FIXED_FUNCTION_LIN_TO_PQ: FixedFunctionStyle +FIXED_FUNCTION_REC2100_SURROUND: FixedFunctionStyle +FIXED_FUNCTION_RGB_TO_HSV: FixedFunctionStyle +FIXED_FUNCTION_XYZ_TO_LUV: FixedFunctionStyle +FIXED_FUNCTION_XYZ_TO_uvY: FixedFunctionStyle +FIXED_FUNCTION_XYZ_TO_xyY: FixedFunctionStyle +GPU_LANGUAGE_CG: GpuLanguage +GPU_LANGUAGE_GLSL_1_2: GpuLanguage +GPU_LANGUAGE_GLSL_1_3: GpuLanguage +GPU_LANGUAGE_GLSL_4_0: GpuLanguage +GPU_LANGUAGE_GLSL_ES_1_0: GpuLanguage +GPU_LANGUAGE_GLSL_ES_3_0: GpuLanguage +GPU_LANGUAGE_HLSL_DX11: GpuLanguage +GPU_LANGUAGE_MSL_2_0: GpuLanguage +GRADING_LIN: GradingStyle +GRADING_LOG: GradingStyle +GRADING_VIDEO: GradingStyle +HUE_DW3: Lut1DHueAdjust +HUE_NONE: Lut1DHueAdjust +HUE_WYPN: Lut1DHueAdjust +INTERP_BEST: Interpolation +INTERP_CUBIC: Interpolation +INTERP_DEFAULT: Interpolation +INTERP_LINEAR: Interpolation +INTERP_NEAREST: Interpolation +INTERP_TETRAHEDRAL: Interpolation +INTERP_UNKNOWN: Interpolation +LANGUAGE_OSL_1: GpuLanguage +LOGGING_LEVEL_DEBUG: LoggingLevel +LOGGING_LEVEL_INFO: LoggingLevel +LOGGING_LEVEL_NONE: LoggingLevel +LOGGING_LEVEL_UNKNOWN: LoggingLevel +LOGGING_LEVEL_WARNING: LoggingLevel +METADATA_DESCRIPTION: str +METADATA_ID: str +METADATA_INFO: str +METADATA_INPUT_DESCRIPTOR: str +METADATA_NAME: str +METADATA_OUTPUT_DESCRIPTOR: str +NAMEDTRANSFORM_ACTIVE: NamedTransformVisibility +NAMEDTRANSFORM_ALL: NamedTransformVisibility +NAMEDTRANSFORM_INACTIVE: NamedTransformVisibility +NEGATIVE_CLAMP: NegativeStyle +NEGATIVE_LINEAR: NegativeStyle +NEGATIVE_MIRROR: NegativeStyle +NEGATIVE_PASS_THRU: NegativeStyle +OCIO_ACTIVE_DISPLAYS_ENVVAR: str +OCIO_ACTIVE_VIEWS_ENVVAR: str +OCIO_BUILTIN_URI_PREFIX: str +OCIO_CONFIG_ARCHIVE_FILE_EXT: str +OCIO_CONFIG_DEFAULT_FILE_EXT: str +OCIO_CONFIG_DEFAULT_NAME: str +OCIO_CONFIG_ENVVAR: str +OCIO_DISABLE_ALL_CACHES: str +OCIO_DISABLE_CACHE_FALLBACK: str +OCIO_DISABLE_PROCESSOR_CACHES: str +OCIO_INACTIVE_COLORSPACES_ENVVAR: str +OCIO_OPTIMIZATION_FLAGS_ENVVAR: str +OCIO_USER_CATEGORIES_ENVVAR: str +OCIO_VIEW_USE_DISPLAY_NAME: str +OPTIMIZATION_ALL: OptimizationFlags +OPTIMIZATION_COMP_EXPONENT: OptimizationFlags +OPTIMIZATION_COMP_GAMMA: OptimizationFlags +OPTIMIZATION_COMP_LUT1D: OptimizationFlags +OPTIMIZATION_COMP_LUT3D: OptimizationFlags +OPTIMIZATION_COMP_MATRIX: OptimizationFlags +OPTIMIZATION_COMP_RANGE: OptimizationFlags +OPTIMIZATION_COMP_SEPARABLE_PREFIX: OptimizationFlags +OPTIMIZATION_DEFAULT: OptimizationFlags +OPTIMIZATION_DRAFT: OptimizationFlags +OPTIMIZATION_FAST_LOG_EXP_POW: OptimizationFlags +OPTIMIZATION_GOOD: OptimizationFlags +OPTIMIZATION_IDENTITY: OptimizationFlags +OPTIMIZATION_IDENTITY_GAMMA: OptimizationFlags +OPTIMIZATION_LOSSLESS: OptimizationFlags +OPTIMIZATION_LUT_INV_FAST: OptimizationFlags +OPTIMIZATION_NONE: OptimizationFlags +OPTIMIZATION_NO_DYNAMIC_PROPERTIES: OptimizationFlags +OPTIMIZATION_PAIR_IDENTITY_CDL: OptimizationFlags +OPTIMIZATION_PAIR_IDENTITY_EXPOSURE_CONTRAST: OptimizationFlags +OPTIMIZATION_PAIR_IDENTITY_FIXED_FUNCTION: OptimizationFlags +OPTIMIZATION_PAIR_IDENTITY_GAMMA: OptimizationFlags +OPTIMIZATION_PAIR_IDENTITY_GRADING: OptimizationFlags +OPTIMIZATION_PAIR_IDENTITY_LOG: OptimizationFlags +OPTIMIZATION_PAIR_IDENTITY_LUT1D: OptimizationFlags +OPTIMIZATION_PAIR_IDENTITY_LUT3D: OptimizationFlags +OPTIMIZATION_SIMPLIFY_OPS: OptimizationFlags +OPTIMIZATION_VERY_GOOD: OptimizationFlags +PROCESSOR_CACHE_DEFAULT: ProcessorCacheFlags +PROCESSOR_CACHE_ENABLED: ProcessorCacheFlags +PROCESSOR_CACHE_OFF: ProcessorCacheFlags +PROCESSOR_CACHE_SHARE_DYN_PROPERTIES: ProcessorCacheFlags +RANGE_CLAMP: RangeStyle +RANGE_NO_CLAMP: RangeStyle +REFERENCE_SPACE_DISPLAY: ReferenceSpaceType +REFERENCE_SPACE_SCENE: ReferenceSpaceType +RGB_BLUE: RGBCurveType +RGB_GREEN: RGBCurveType +RGB_MASTER: RGBCurveType +RGB_NUM_CURVES: RGBCurveType +RGB_RED: RGBCurveType +ROLE_COLOR_PICKING: str +ROLE_COLOR_TIMING: str +ROLE_COMPOSITING_LOG: str +ROLE_DATA: str +ROLE_DEFAULT: str +ROLE_INTERCHANGE_DISPLAY: str +ROLE_INTERCHANGE_SCENE: str +ROLE_MATTE_PAINT: str +ROLE_REFERENCE: str +ROLE_RENDERING: str +ROLE_SCENE_LINEAR: str +ROLE_TEXTURE_PAINT: str +SEARCH_REFERENCE_SPACE_ALL: SearchReferenceSpaceType +SEARCH_REFERENCE_SPACE_DISPLAY: SearchReferenceSpaceType +SEARCH_REFERENCE_SPACE_SCENE: SearchReferenceSpaceType +TRANSFORM_DIR_FORWARD: TransformDirection +TRANSFORM_DIR_INVERSE: TransformDirection +TRANSFORM_TYPE_ALLOCATION: TransformType +TRANSFORM_TYPE_BUILTIN: TransformType +TRANSFORM_TYPE_CDL: TransformType +TRANSFORM_TYPE_COLORSPACE: TransformType +TRANSFORM_TYPE_DISPLAY_VIEW: TransformType +TRANSFORM_TYPE_EXPONENT: TransformType +TRANSFORM_TYPE_EXPONENT_WITH_LINEAR: TransformType +TRANSFORM_TYPE_EXPOSURE_CONTRAST: TransformType +TRANSFORM_TYPE_FILE: TransformType +TRANSFORM_TYPE_FIXED_FUNCTION: TransformType +TRANSFORM_TYPE_GRADING_PRIMARY: TransformType +TRANSFORM_TYPE_GRADING_RGB_CURVE: TransformType +TRANSFORM_TYPE_GRADING_TONE: TransformType +TRANSFORM_TYPE_GROUP: TransformType +TRANSFORM_TYPE_LOG: TransformType +TRANSFORM_TYPE_LOG_AFFINE: TransformType +TRANSFORM_TYPE_LOG_CAMERA: TransformType +TRANSFORM_TYPE_LOOK: TransformType +TRANSFORM_TYPE_LUT1D: TransformType +TRANSFORM_TYPE_LUT3D: TransformType +TRANSFORM_TYPE_MATRIX: TransformType +TRANSFORM_TYPE_RANGE: TransformType +UNIFORM_BOOL: UniformDataType +UNIFORM_DOUBLE: UniformDataType +UNIFORM_FLOAT3: UniformDataType +UNIFORM_UNKNOWN: UniformDataType +UNIFORM_VECTOR_FLOAT: UniformDataType +UNIFORM_VECTOR_INT: UniformDataType +VIEWTRANSFORM_DIR_FROM_REFERENCE: ViewTransformDirection +VIEWTRANSFORM_DIR_TO_REFERENCE: ViewTransformDirection +VIEW_DISPLAY_DEFINED: ViewType +VIEW_SHARED: ViewType +__status__: str +__version__: str + +class Allocation: + __members__: ClassVar[dict] = ... # read-only + ALLOCATION_LG2: ClassVar[Allocation] = ... + ALLOCATION_UNIFORM: ClassVar[Allocation] = ... + ALLOCATION_UNKNOWN: ClassVar[Allocation] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class AllocationTransform(Transform): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, allocation: Allocation = ..., vars: Iterable[float] = ..., direction: TransformDirection = ...) -> None: ... + def getAllocation(self) -> Allocation: ... + def getVars(self) -> list[float]: ... + def setAllocation(self, allocation: Allocation) -> None: ... + def setVars(self, vars: Iterable[float]) -> None: ... + +class Baker: + class FormatIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> tuple: ... + def __iter__(self) -> Baker.FormatIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> tuple: ... + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, config: Config, format: str, inputSpace: str, targetSpace: str, looks: str = ..., cubeSize: int = ..., shaperSpace: str = ..., shaperSize: int = ...) -> None: ... + @overload + def bake(self, fileName: str) -> None: ... + @overload + def bake(self) -> str: ... + def getConfig(self) -> Config: ... + def getCubeSize(self) -> int: ... + def getDisplay(self) -> str: ... + def getFormat(self) -> str: ... + def getFormatMetadata(self) -> FormatMetadata: ... + @staticmethod + def getFormats() -> Baker.FormatIterator: ... + def getInputSpace(self) -> str: ... + def getLooks(self) -> str: ... + def getShaperSize(self) -> int: ... + def getShaperSpace(self) -> str: ... + def getTargetSpace(self) -> str: ... + def getView(self) -> str: ... + def setConfig(self, config: Config) -> None: ... + def setCubeSize(self, cubeSize: int) -> None: ... + def setDisplayView(self, display: str, view: str) -> None: ... + def setFormat(self, formatName: str) -> None: ... + def setInputSpace(self, inputSpace: str) -> None: ... + def setLooks(self, looks: str) -> None: ... + def setShaperSize(self, shaperSize: int) -> None: ... + def setShaperSpace(self, shaperSpace: str) -> None: ... + def setTargetSpace(self, targetSpace: str) -> None: ... + def __deepcopy__(self, memo: dict) -> Baker: ... + +class BitDepth: + __members__: ClassVar[dict] = ... # read-only + BIT_DEPTH_F16: ClassVar[BitDepth] = ... + BIT_DEPTH_F32: ClassVar[BitDepth] = ... + BIT_DEPTH_UINT10: ClassVar[BitDepth] = ... + BIT_DEPTH_UINT12: ClassVar[BitDepth] = ... + BIT_DEPTH_UINT14: ClassVar[BitDepth] = ... + BIT_DEPTH_UINT16: ClassVar[BitDepth] = ... + BIT_DEPTH_UINT32: ClassVar[BitDepth] = ... + BIT_DEPTH_UINT8: ClassVar[BitDepth] = ... + BIT_DEPTH_UNKNOWN: ClassVar[BitDepth] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __and__(self, other: object) -> object: ... + def __eq__(self, other: object) -> bool: ... + def __ge__(self, other: object) -> bool: ... + def __gt__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __invert__(self) -> object: ... + def __le__(self, other: object) -> bool: ... + def __lt__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __or__(self, other: object) -> object: ... + def __rand__(self, other: object) -> object: ... + def __ror__(self, other: object) -> object: ... + def __rxor__(self, other: object) -> object: ... + def __xor__(self, other: object) -> object: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class BuiltinConfigRegistry: + class BuiltinConfigIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> tuple: ... + def __iter__(self) -> BuiltinConfigRegistry.BuiltinConfigIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> tuple: ... + + class BuiltinConfigNameIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> BuiltinConfigRegistry.BuiltinConfigNameIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + def __init__(self) -> None: ... + def getBuiltinConfigs(self) -> BuiltinConfigRegistry.BuiltinConfigIterator: ... + def getDefaultBuiltinConfigName(self) -> str: ... + def __contains__(self, arg0: str, /) -> bool: ... + def __getitem__(self, arg0: str, /) -> str: ... + def __iter__(self) -> BuiltinConfigRegistry.BuiltinConfigNameIterator: ... + def __len__(self) -> int: ... + +class BuiltinTransform(Transform): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, style: str = ..., direction: TransformDirection = ...) -> None: ... + def getDescription(self) -> str: ... + def getStyle(self) -> str: ... + def setStyle(self, style: str) -> None: ... + +class BuiltinTransformRegistry: + class BuiltinIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> tuple: ... + def __iter__(self) -> BuiltinTransformRegistry.BuiltinIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> tuple: ... + + class BuiltinStyleIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> BuiltinTransformRegistry.BuiltinStyleIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + def __init__(self) -> None: ... + def getBuiltins(self) -> BuiltinTransformRegistry.BuiltinIterator: ... + def __contains__(self, arg0: str, /) -> bool: ... + def __getitem__(self, arg0: str, /) -> str: ... + def __iter__(self) -> BuiltinTransformRegistry.BuiltinStyleIterator: ... + def __len__(self) -> int: ... + +class CDLStyle: + __members__: ClassVar[dict] = ... # read-only + CDL_ASC: ClassVar[CDLStyle] = ... + CDL_NO_CLAMP: ClassVar[CDLStyle] = ... + CDL_TRANSFORM_DEFAULT: ClassVar[CDLStyle] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class CDLTransform(Transform): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, direction: TransformDirection = ...) -> None: ... + @overload + def __init__(self, slope=..., offset=..., power=..., sat: float = ..., id: str = ..., description: str = ..., direction: TransformDirection = ...) -> None: ... + @staticmethod + def CreateFromFile(src: str, id: str) -> CDLTransform: ... + @staticmethod + def CreateGroupFromFile(src: str) -> GroupTransform: ... + def equals(self, other: CDLTransform) -> bool: ... + def getFirstSOPDescription(self) -> str: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def getID(self) -> str: ... + def getOffset(self, *args, **kwargs): ... + def getPower(self, *args, **kwargs): ... + def getSOP(self, *args, **kwargs): ... + def getSat(self) -> float: ... + def getSatLumaCoefs(self, *args, **kwargs): ... + def getSlope(self, *args, **kwargs): ... + def getStyle(self) -> CDLStyle: ... + def setFirstSOPDescription(self, description: str) -> None: ... + def setID(self, id: str) -> None: ... + def setOffset(self, rgb) -> None: ... + def setPower(self, rgb) -> None: ... + def setSOP(self, vec9) -> None: ... + def setSat(self, sat: float) -> None: ... + def setSlope(self, rgb) -> None: ... + def setStyle(self, style: CDLStyle) -> None: ... + +class CPUProcessor: + def __init__(self, *args, **kwargs) -> None: ... + @overload + def apply(self, imgDesc: ImageDesc) -> None: ... + @overload + def apply(self, srcImgDesc: ImageDesc, dstImgDesc: ImageDesc) -> None: ... + @overload + def applyRGB(self, data: Buffer) -> None: ... + @overload + def applyRGB(self, data: Iterable[float]) -> list[float]: ... + @overload + def applyRGBA(self, data: Buffer) -> None: ... + @overload + def applyRGBA(self, data: Iterable[float]) -> list[float]: ... + def getCacheID(self) -> str: ... + def getDynamicProperty(self, type: DynamicPropertyType) -> DynamicProperty: ... + def getInputBitDepth(self) -> BitDepth: ... + def getOutputBitDepth(self) -> BitDepth: ... + def hasChannelCrosstalk(self) -> bool: ... + def hasDynamicProperty(self, type: DynamicPropertyType) -> bool: ... + def isDynamic(self) -> bool: ... + def isIdentity(self) -> bool: ... + def isNoOp(self) -> bool: ... + +class ChannelOrdering: + __members__: ClassVar[dict] = ... # read-only + CHANNEL_ORDERING_ABGR: ClassVar[ChannelOrdering] = ... + CHANNEL_ORDERING_BGR: ClassVar[ChannelOrdering] = ... + CHANNEL_ORDERING_BGRA: ClassVar[ChannelOrdering] = ... + CHANNEL_ORDERING_RGB: ClassVar[ChannelOrdering] = ... + CHANNEL_ORDERING_RGBA: ClassVar[ChannelOrdering] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class ColorSpace: + class ColorSpaceAliasIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> ColorSpace.ColorSpaceAliasIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class ColorSpaceCategoryIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> ColorSpace.ColorSpaceCategoryIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, referenceSpace: ReferenceSpaceType) -> None: ... + @overload + def __init__(self, referenceSpace: ReferenceSpaceType = ..., name: str = ..., aliases: Iterable[str] = ..., family: str = ..., encoding: str = ..., equalityGroup: str = ..., description: str = ..., bitDepth: BitDepth = ..., isData: bool = ..., allocation: Allocation = ..., allocationVars: Iterable[float] = ..., toReference: Transform = ..., fromReference: Transform = ..., categories: Iterable[str] = ...) -> None: ... + def addAlias(self, alias: str) -> None: ... + def addCategory(self, category: str) -> None: ... + def clearAliases(self) -> None: ... + def clearCategories(self) -> None: ... + def getAliases(self) -> ColorSpace.ColorSpaceAliasIterator: ... + def getAllocation(self) -> Allocation: ... + def getAllocationVars(self) -> list[float]: ... + def getBitDepth(self) -> BitDepth: ... + def getCategories(self) -> ColorSpace.ColorSpaceCategoryIterator: ... + def getDescription(self) -> str: ... + def getEncoding(self) -> str: ... + def getEqualityGroup(self) -> str: ... + def getFamily(self) -> str: ... + def getName(self) -> str: ... + def getReferenceSpaceType(self) -> ReferenceSpaceType: ... + def getTransform(self, direction: ColorSpaceDirection) -> Transform: ... + def hasAlias(self, alias: str) -> bool: ... + def hasCategory(self, category: str) -> bool: ... + def isData(self) -> bool: ... + def removeAlias(self, alias: str) -> None: ... + def removeCategory(self, category: str) -> None: ... + def setAllocation(self, allocation: Allocation) -> None: ... + def setAllocationVars(self, vars: Iterable[float]) -> None: ... + def setBitDepth(self, bitDepth: BitDepth) -> None: ... + def setDescription(self, description: str) -> None: ... + def setEncoding(self, encoding: str) -> None: ... + def setEqualityGroup(self, equalityGroup: str) -> None: ... + def setFamily(self, family: str) -> None: ... + def setIsData(self, isData: bool) -> None: ... + def setName(self, name: str) -> None: ... + def setTransform(self, transform: Transform, direction: ColorSpaceDirection) -> None: ... + def __deepcopy__(self, memo: dict) -> ColorSpace: ... + +class ColorSpaceDirection: + __members__: ClassVar[dict] = ... # read-only + COLORSPACE_DIR_FROM_REFERENCE: ClassVar[ColorSpaceDirection] = ... + COLORSPACE_DIR_TO_REFERENCE: ClassVar[ColorSpaceDirection] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class ColorSpaceMenuHelper: + class ColorSpaceLevelIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> ColorSpaceMenuHelper.ColorSpaceLevelIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + def __init__(self, parameters: ColorSpaceMenuParameters) -> None: ... + def getDescription(self, index: int) -> str: ... + def getFamily(self, index: int) -> str: ... + def getHierarchyLevels(self, index: int) -> ColorSpaceMenuHelper.ColorSpaceLevelIterator: ... + def getIndexFromName(self, name: str) -> int: ... + def getIndexFromUIName(self, name: str) -> int: ... + def getName(self, index: int) -> str: ... + def getNameFromUIName(self, name: str) -> str: ... + def getNumColorSpaces(self) -> int: ... + def getUIName(self, index: int) -> str: ... + def getUINameFromName(self, name: str) -> str: ... + +class ColorSpaceMenuParameters: + class AddedColorSpaceIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> ColorSpaceMenuParameters.AddedColorSpaceIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + @overload + def __init__(self, config: Config) -> None: ... + @overload + def __init__(self, config: Config, role: str = ..., includeColorSpaces: bool = ..., searchReferenceSpaceType: SearchReferenceSpaceType = ..., includeNamedTransforms: bool = ..., appCategories: str = ..., encodings: str = ..., userCategories: str = ..., includeRoles: bool = ...) -> None: ... + def addColorSpace(self, colorSpace: str) -> None: ... + def clearAddedColorSpaces(self) -> None: ... + def getAddedColorSpaces(self) -> ColorSpaceMenuParameters.AddedColorSpaceIterator: ... + def getAppCategories(self) -> str: ... + def getConfig(self) -> Config: ... + def getEncodings(self) -> str: ... + def getIncludeColorSpaces(self) -> bool: ... + def getIncludeNamedTransforms(self) -> bool: ... + def getIncludeRoles(self) -> bool: ... + def getRole(self) -> str: ... + def getSearchReferenceSpaceType(self) -> SearchReferenceSpaceType: ... + def getUserCategories(self) -> str: ... + def setAppCategories(self, appCategories: str) -> None: ... + def setConfig(self, config: Config) -> None: ... + def setEncodings(self, encodings: str) -> None: ... + def setIncludeColorSpaces(self, includeColorSpaces: bool = ...) -> None: ... + def setIncludeNamedTransforms(self, includeNamedTransforms: bool = ...) -> None: ... + def setIncludeRoles(self, includeRoles: bool = ...) -> None: ... + def setRole(self, role: str) -> None: ... + def setSearchReferenceSpaceType(self, searchReferenceSpaceType: SearchReferenceSpaceType) -> None: ... + def setUserCategories(self, categories: str) -> None: ... + +class ColorSpaceSet: + class ColorSpaceIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> ColorSpace: ... + def __iter__(self) -> ColorSpaceSet.ColorSpaceIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> ColorSpace: ... + + class ColorSpaceNameIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> ColorSpaceSet.ColorSpaceNameIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + def __init__(self) -> None: ... + def addColorSpace(self, colorSpace: ColorSpace) -> None: ... + def addColorSpaces(self, colorSpaces: ColorSpaceSet) -> None: ... + def clearColorSpaces(self) -> None: ... + def getColorSpace(self, name: str) -> ColorSpace: ... + def getColorSpaceNames(self) -> ColorSpaceSet.ColorSpaceNameIterator: ... + def getColorSpaces(self) -> ColorSpaceSet.ColorSpaceIterator: ... + def hasColorSpace(self, name: str) -> bool: ... + def removeColorSpace(self, colorSpace: str) -> None: ... + def removeColorSpaces(self, colorSpaces: ColorSpaceSet) -> None: ... + def __and__(self, arg0: ColorSpaceSet, /) -> ColorSpaceSet: ... + def __deepcopy__(self, memo: dict) -> ColorSpaceSet: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __or__(self, arg0: ColorSpaceSet, /) -> ColorSpaceSet: ... + def __sub__(self, arg0: ColorSpaceSet, /) -> ColorSpaceSet: ... + +class ColorSpaceTransform(Transform): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, src: str = ..., dst: str = ..., direction: TransformDirection = ..., dataBypass: bool = ...) -> None: ... + def getDataBypass(self) -> bool: ... + def getDst(self) -> str: ... + def getSrc(self) -> str: ... + def setDataBypass(self, dataBypass: bool) -> None: ... + def setDst(self, dst: str) -> None: ... + def setSrc(self, src: str) -> None: ... + +class ColorSpaceVisibility: + __members__: ClassVar[dict] = ... # read-only + COLORSPACE_ACTIVE: ClassVar[ColorSpaceVisibility] = ... + COLORSPACE_ALL: ClassVar[ColorSpaceVisibility] = ... + COLORSPACE_INACTIVE: ClassVar[ColorSpaceVisibility] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class Config: + class ActiveColorSpaceIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> ColorSpace: ... + def __iter__(self) -> Config.ActiveColorSpaceIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> ColorSpace: ... + + class ActiveColorSpaceNameIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.ActiveColorSpaceNameIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class ActiveNamedTransformIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> NamedTransform: ... + def __iter__(self) -> Config.ActiveNamedTransformIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> NamedTransform: ... + + class ActiveNamedTransformNameIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.ActiveNamedTransformNameIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class ColorSpaceIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> ColorSpace: ... + def __iter__(self) -> Config.ColorSpaceIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> ColorSpace: ... + + class ColorSpaceNameIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.ColorSpaceNameIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class DisplayAllIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.DisplayAllIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class DisplayIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.DisplayIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class EnvironmentVarNameIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.EnvironmentVarNameIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class LookIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> Look: ... + def __iter__(self) -> Config.LookIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> Look: ... + + class LookNameIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.LookNameIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class NamedTransformIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> NamedTransform: ... + def __iter__(self) -> Config.NamedTransformIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> NamedTransform: ... + + class NamedTransformNameIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.NamedTransformNameIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class RoleColorSpaceIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> tuple: ... + def __iter__(self) -> Config.RoleColorSpaceIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> tuple: ... + + class RoleNameIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.RoleNameIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class SearchPathIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.SearchPathIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class SharedViewIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.SharedViewIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class ViewForColorSpaceIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.ViewForColorSpaceIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class ViewForViewTypeIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.ViewForViewTypeIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class ViewIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.ViewIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class ViewTransformIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> ViewTransform: ... + def __iter__(self) -> Config.ViewTransformIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> ViewTransform: ... + + class ViewTransformNameIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.ViewTransformNameIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class VirtualViewIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Config.VirtualViewIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + def __init__(self) -> None: ... + @staticmethod + def CreateFromBuiltinConfig(arg0: str, /) -> Config: ... + @staticmethod + def CreateFromConfigIOProxy(arg0, /) -> Config: ... + @staticmethod + def CreateFromEnv() -> Config: ... + @staticmethod + def CreateFromFile(fileName: str) -> Config: ... + @staticmethod + def CreateFromStream(str: str) -> Config: ... + @staticmethod + def CreateRaw() -> Config: ... + @staticmethod + def GetProcessorFromBuiltinColorSpace(builtinColorSpaceName: str, srcConfig: Config, srcColorSpaceName: str) -> Processor: ... + @overload + @staticmethod + def GetProcessorFromConfigs(srcConfig: Config, srcColorSpaceName: str, dstConfig: Config, dstColorSpaceName: str) -> Processor: ... + @overload + @staticmethod + def GetProcessorFromConfigs(srcContext: Context, srcConfig: Config, srcColorSpaceName: str, dstContext: Context, dstConfig: Config, dstColorSpaceName: str) -> Processor: ... + @overload + @staticmethod + def GetProcessorFromConfigs(srcConfig: Config, srcColorSpaceName: str, srcInterchangeName: str, dstConfig: Config, dstColorSpaceName: str, dstInterchangeName: str) -> Processor: ... + @overload + @staticmethod + def GetProcessorFromConfigs(srcContext: Context, srcConfig: Config, srcColorSpaceName: str, srcInterchangeName: str, dstContext: Context, dstConfig: Config, dstColorSpaceName: str, dstInterchangeName: str) -> Processor: ... + @overload + @staticmethod + def GetProcessorFromConfigs(srcConfig: Config, srcColorSpaceName: str, dstConfig: Config, dstDisplay: str, dstView: str, direction: TransformDirection) -> Processor: ... + @overload + @staticmethod + def GetProcessorFromConfigs(srcContext: Context, srcConfig: Config, srcColorSpaceName: str, dstContext: Context, dstConfig: Config, dstView: str, dstDisplay: str, direction: TransformDirection) -> Processor: ... + @overload + @staticmethod + def GetProcessorFromConfigs(srcConfig: Config, srcColorSpaceName: str, srcInterchangeName: str, dstConfig: Config, dstDisplay: str, dstView: str, dstInterchangeName: str, direction: TransformDirection) -> Processor: ... + @overload + @staticmethod + def GetProcessorFromConfigs(srcContext: Context, srcConfig: Config, srcColorSpaceName: str, srcInterchangeName: str, dstContext: Context, dstConfig: Config, dstDisplay: str, dstView: str, dstInterchangeName: str, direction: TransformDirection) -> Processor: ... + @staticmethod + def GetProcessorToBuiltinColorSpace(srcConfig: Config, srcColorSpaceName: str, builtinColorSpaceName: str) -> Processor: ... + @staticmethod + def IdentifyBuiltinColorSpace(srcConfig: Config, builtinConfig: Config, builtinColorSpaceName: str) -> str: ... + @staticmethod + def IdentifyInterchangeSpace(srcConfig: Config, srcColorSpaceName: str, builtinConfig: Config, builtinColorSpaceName: str) -> tuple[str, str]: ... + @staticmethod + def ViewsAreEqual(first: Config, second: Config, dispName: str, viewName: str) -> bool: ... + @staticmethod + def VirtualViewsAreEqual(first: Config, second: Config, viewName: str) -> bool: ... + def addColorSpace(self, colorSpace: ColorSpace) -> None: ... + def addDisplaySharedView(self, display: str, view: str) -> None: ... + @overload + def addDisplayView(self, display: str, view: str, colorSpaceName: str, looks: str = ...) -> None: ... + @overload + def addDisplayView(self, display: str, view: str, viewTransform: str, displayColorSpaceName: str, looks: str = ..., ruleName: str = ..., description: str = ...) -> None: ... + def addEnvironmentVar(self, name: str, defaultValue: str) -> None: ... + def addLook(self, look: Look) -> None: ... + def addNamedTransform(self, namedTransform: NamedTransform) -> None: ... + def addSearchPath(self, path: str) -> None: ... + def addSharedView(self, view: str, viewTransformName: str, colorSpaceName: str, looks: str = ..., ruleName: str = ..., description: str = ...) -> None: ... + def addViewTransform(self, viewTransform: ViewTransform) -> None: ... + def addVirtualDisplaySharedView(self, sharedView: str) -> None: ... + def addVirtualDisplayView(self, view: str, viewTransformName: str, colorSpaceName: str, looks: str = ..., ruleName: str = ..., description: str = ...) -> None: ... + def archive(self, arg0: str, /) -> None: ... + def clearColorSpaces(self) -> None: ... + def clearDisplays(self) -> None: ... + def clearEnvironmentVars(self) -> None: ... + def clearLooks(self) -> None: ... + def clearNamedTransforms(self) -> None: ... + def clearProcessorCache(self) -> None: ... + def clearSearchPaths(self) -> None: ... + def clearSharedViews(self) -> None: ... + def clearViewTransforms(self) -> None: ... + def clearVirtualDisplay(self) -> None: ... + def displayHasView(self, display: str, view: str) -> bool: ... + def filepathOnlyMatchesDefaultRule(self, filePath: str) -> bool: ... + def getActiveDisplays(self) -> str: ... + def getActiveViews(self) -> str: ... + @overload + def getCacheID(self) -> str: ... + @overload + def getCacheID(self, context: Context) -> str: ... + def getCanonicalName(self, name: str) -> str: ... + def getColorSpace(self, name: str) -> ColorSpace: ... + def getColorSpaceFromFilepath(self, filePath: str) -> tuple: ... + @overload + def getColorSpaceNames(self, searchReferenceType: SearchReferenceSpaceType, visibility: ColorSpaceVisibility) -> Config.ColorSpaceNameIterator: ... + @overload + def getColorSpaceNames(self) -> Config.ActiveColorSpaceNameIterator: ... + @overload + def getColorSpaces(self, category: str) -> ColorSpaceSet: ... + @overload + def getColorSpaces(self, searchReferenceType: SearchReferenceSpaceType, visibility: ColorSpaceVisibility) -> Config.ColorSpaceIterator: ... + @overload + def getColorSpaces(self) -> Config.ActiveColorSpaceIterator: ... + def getConfigIOProxy(self, *args, **kwargs): ... + def getCurrentContext(self) -> Context: ... + def getDefaultDisplay(self) -> str: ... + def getDefaultLumaCoefs(self, *args, **kwargs): ... + def getDefaultSceneToDisplayViewTransform(self) -> ViewTransform: ... + @overload + def getDefaultView(self, display: str) -> str: ... + @overload + def getDefaultView(self, display: str, colorSpacename: str) -> str: ... + def getDefaultViewTransformName(self) -> str: ... + def getDescription(self) -> str: ... + def getDisplayViewColorSpaceName(self, display: str, view: str) -> str: ... + def getDisplayViewDescription(self, display: str, view: str) -> str: ... + def getDisplayViewLooks(self, display: str, view: str) -> str: ... + def getDisplayViewRule(self, display: str, view: str) -> str: ... + def getDisplayViewTransformName(self, display: str, view: str) -> str: ... + def getDisplays(self) -> Config.DisplayIterator: ... + def getDisplaysAll(self) -> Config.DisplayAllIterator: ... + def getEnvironmentMode(self) -> EnvironmentMode: ... + def getEnvironmentVarDefault(self, name: str) -> str: ... + def getEnvironmentVarNames(self) -> Config.EnvironmentVarNameIterator: ... + def getFamilySeparator(self) -> str: ... + def getFileRules(self) -> FileRules: ... + def getInactiveColorSpaces(self) -> str: ... + def getLook(self, name: str) -> Look: ... + def getLookNames(self) -> Config.LookNameIterator: ... + def getLooks(self) -> Config.LookIterator: ... + def getMajorVersion(self) -> int: ... + def getMinorVersion(self) -> int: ... + def getName(self) -> str: ... + def getNamedTransform(self, name: str) -> NamedTransform: ... + @overload + def getNamedTransformNames(self, visibility: NamedTransformVisibility) -> Config.NamedTransformNameIterator: ... + @overload + def getNamedTransformNames(self) -> Config.ActiveNamedTransformNameIterator: ... + @overload + def getNamedTransforms(self, visibility: NamedTransformVisibility) -> Config.NamedTransformIterator: ... + @overload + def getNamedTransforms(self) -> Config.ActiveNamedTransformIterator: ... + @overload + def getProcessor(self, srcColorSpace: ColorSpace, dstColorSpace: ColorSpace) -> Processor: ... + @overload + def getProcessor(self, context: Context, srcColorSpace: ColorSpace, dstColorSpace: ColorSpace) -> Processor: ... + @overload + def getProcessor(self, srcColorSpaceName: str, dstColorSpaceName: str) -> Processor: ... + @overload + def getProcessor(self, context: Context, srcColorSpaceName: str, dstColorSpaceName: str) -> Processor: ... + @overload + def getProcessor(self, srcColorSpaceName: str, display: str, view: str, direction: TransformDirection) -> Processor: ... + @overload + def getProcessor(self, context: Context, srcColorSpaceName: str, display: str, view: str, direction: TransformDirection) -> Processor: ... + @overload + def getProcessor(self, namedTransform: NamedTransform, direction: TransformDirection) -> Processor: ... + @overload + def getProcessor(self, context: Context, namedTransform: NamedTransform, direction: TransformDirection) -> Processor: ... + @overload + def getProcessor(self, namedTransformName: str, direction: TransformDirection) -> Processor: ... + @overload + def getProcessor(self, context: Context, namedTransformName: str, direction: TransformDirection) -> Processor: ... + @overload + def getProcessor(self, transform: Transform) -> Processor: ... + @overload + def getProcessor(self, transform: Transform, direction: TransformDirection) -> Processor: ... + @overload + def getProcessor(self, context: Context, transform: Transform, direction: TransformDirection) -> Processor: ... + def getRoleColorSpace(self, roleName: str) -> str: ... + def getRoleNames(self) -> Config.RoleNameIterator: ... + def getRoles(self) -> Config.RoleColorSpaceIterator: ... + def getSearchPath(self) -> str: ... + def getSearchPaths(self) -> Config.SearchPathIterator: ... + def getSharedViews(self) -> Config.SharedViewIterator: ... + def getViewTransform(self, name: str) -> ViewTransform: ... + def getViewTransformNames(self) -> Config.ViewTransformNameIterator: ... + def getViewTransforms(self) -> Config.ViewTransformIterator: ... + def getViewingRules(self) -> ViewingRules: ... + @overload + def getViews(self, display: str) -> Config.ViewIterator: ... + @overload + def getViews(self, type: ViewType, display: str) -> Config.ViewForViewTypeIterator: ... + @overload + def getViews(self, display: str, colorSpaceName: str) -> Config.ViewForColorSpaceIterator: ... + def getVirtualDisplayViewColorSpaceName(self, view: str) -> str: ... + def getVirtualDisplayViewDescription(self, view: str) -> str: ... + def getVirtualDisplayViewLooks(self, view: str) -> str: ... + def getVirtualDisplayViewRule(self, view: str) -> str: ... + def getVirtualDisplayViewTransformName(self, view: str) -> str: ... + def getVirtualDisplayViews(self, display: ViewType) -> Config.VirtualViewIterator: ... + def getWorkingDir(self) -> str: ... + def hasRole(self, role: str) -> bool: ... + def hasVirtualView(self, view: str) -> bool: ... + def instantiateDisplayFromICCProfile(self, ICCProfileFilepath: str) -> int: ... + def instantiateDisplayFromMonitorName(self, monitorName: str) -> int: ... + def isArchivable(self) -> bool: ... + def isColorSpaceLinear(self, colorSpace: str, referenceSpaceType: ReferenceSpaceType) -> bool: ... + def isColorSpaceUsed(self, name: str) -> bool: ... + def isDisplayTemporary(self, display: str) -> bool: ... + def isInactiveColorSpace(self, colorspace: str) -> bool: ... + def isStrictParsingEnabled(self) -> bool: ... + def loadEnvironment(self) -> None: ... + def parseColorSpaceFromString(self, str: str) -> str: ... + def removeColorSpace(self, name: str) -> None: ... + def removeDisplayView(self, display: str, view: str) -> None: ... + def removeSharedView(self, view: str) -> None: ... + def removeVirtualDisplayView(self, view: str) -> None: ... + @overload + def serialize(self, fileName: str) -> None: ... + @overload + def serialize(self) -> str: ... + def setActiveDisplays(self, displays: str) -> None: ... + def setActiveViews(self, views: str) -> None: ... + def setConfigIOProxy(self, ciop) -> None: ... + def setDefaultLumaCoefs(self, rgb) -> None: ... + def setDefaultViewTransformName(self, name: str) -> None: ... + def setDescription(self, description: str) -> None: ... + def setEnvironmentMode(self, mode: EnvironmentMode) -> None: ... + def setFamilySeparator(self, separator: str) -> None: ... + def setFileRules(self, fileRules: FileRules) -> None: ... + def setInactiveColorSpaces(self, inactiveColorSpaces: str) -> None: ... + def setMajorVersion(self, major: int) -> None: ... + def setMinorVersion(self, minor: int) -> None: ... + def setName(self, name: str) -> None: ... + def setProcessorCacheFlags(self, flags: ProcessorCacheFlags) -> None: ... + def setRole(self, role: str, colorSpaceName: str) -> None: ... + def setSearchPath(self, path: str) -> None: ... + def setStrictParsingEnabled(self, enabled: bool) -> None: ... + def setVersion(self, major: int, minor: int) -> None: ... + def setViewingRules(self, ViewingRules: ViewingRules) -> None: ... + def setWorkingDir(self, dirName: str) -> None: ... + def upgradeToLatestVersion(self) -> None: ... + def validate(self) -> None: ... + def viewIsShared(self, display: str, view: str) -> bool: ... + def virtualViewIsShared(self, view: str) -> bool: ... + def __deepcopy__(self, memo: dict) -> Config: ... + +class Context: + class SearchPathIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Context.SearchPathIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class StringVarIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> tuple: ... + def __iter__(self) -> Context.StringVarIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> tuple: ... + + class StringVarNameIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> Context.StringVarNameIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, workingDir: str = ..., searchPaths: Iterable[str] = ..., stringVars: dict[str, str] = ..., environmentMode: EnvironmentMode = ...) -> None: ... + def addSearchPath(self, path: str) -> None: ... + def clearSearchPaths(self) -> None: ... + def clearStringVars(self) -> None: ... + def getCacheID(self) -> str: ... + def getEnvironmentMode(self) -> EnvironmentMode: ... + def getSearchPath(self) -> str: ... + def getSearchPaths(self) -> Context.SearchPathIterator: ... + def getStringVars(self) -> Context.StringVarIterator: ... + def getWorkingDir(self) -> str: ... + def loadEnvironment(self) -> None: ... + @overload + def resolveFileLocation(self, filename: str) -> str: ... + @overload + def resolveFileLocation(self, filename: str, usedContextVars: Context) -> str: ... + @overload + def resolveStringVar(self, string: str) -> str: ... + @overload + def resolveStringVar(self, string: str, usedContextVars: Context) -> str: ... + def setEnvironmentMode(self, mode: EnvironmentMode) -> None: ... + def setSearchPath(self, path: str) -> None: ... + def setWorkingDir(self, dirName: str) -> None: ... + def __contains__(self, name: str) -> bool: ... + def __deepcopy__(self, memo: dict) -> Context: ... + def __getitem__(self, name: str) -> str: ... + def __iter__(self) -> Context.StringVarNameIterator: ... + def __len__(self) -> int: ... + def __setitem__(self, name: str, value: str) -> None: ... + +class DisplayViewTransform(Transform): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, src: str = ..., display: str = ..., view: str = ..., looksBypass: bool = ..., dataBypass: bool = ..., direction: TransformDirection = ...) -> None: ... + def getDataBypass(self) -> bool: ... + def getDisplay(self) -> str: ... + def getLooksBypass(self) -> bool: ... + def getSrc(self) -> str: ... + def getView(self) -> str: ... + def setDataBypass(self, dataBypass: bool) -> None: ... + def setDisplay(self, display: str) -> None: ... + def setLooksBypass(self, looksBypass: bool) -> None: ... + def setSrc(self, src: str) -> None: ... + def setView(self, view: str) -> None: ... + +class DynamicProperty: + def __init__(self, *args, **kwargs) -> None: ... + def getDouble(self) -> float: ... + def getGradingPrimary(self) -> GradingPrimary: ... + def getGradingRGBCurve(self) -> GradingRGBCurve: ... + def getGradingTone(self) -> GradingTone: ... + def getType(self) -> DynamicPropertyType: ... + def setDouble(self, val: float) -> None: ... + def setGradingPrimary(self, val: GradingPrimary) -> None: ... + def setGradingRGBCurve(self, val: GradingRGBCurve) -> None: ... + def setGradingTone(self, val: GradingTone) -> None: ... + +class DynamicPropertyType: + __members__: ClassVar[dict] = ... # read-only + DYNAMIC_PROPERTY_CONTRAST: ClassVar[DynamicPropertyType] = ... + DYNAMIC_PROPERTY_EXPOSURE: ClassVar[DynamicPropertyType] = ... + DYNAMIC_PROPERTY_GAMMA: ClassVar[DynamicPropertyType] = ... + DYNAMIC_PROPERTY_GRADING_PRIMARY: ClassVar[DynamicPropertyType] = ... + DYNAMIC_PROPERTY_GRADING_RGBCURVE: ClassVar[DynamicPropertyType] = ... + DYNAMIC_PROPERTY_GRADING_TONE: ClassVar[DynamicPropertyType] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class EnvironmentMode: + __members__: ClassVar[dict] = ... # read-only + ENV_ENVIRONMENT_LOAD_ALL: ClassVar[EnvironmentMode] = ... + ENV_ENVIRONMENT_LOAD_PREDEFINED: ClassVar[EnvironmentMode] = ... + ENV_ENVIRONMENT_UNKNOWN: ClassVar[EnvironmentMode] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class Exception(__builtins__.Exception): ... + +class ExceptionMissingFile(Exception): ... + +class ExponentTransform(Transform): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, value=..., negativeStyle: NegativeStyle = ..., direction: TransformDirection = ...) -> None: ... + def equals(self, other: ExponentTransform) -> bool: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def getNegativeStyle(self) -> NegativeStyle: ... + def getValue(self, *args, **kwargs): ... + def setNegativeStyle(self, style: NegativeStyle) -> None: ... + def setValue(self, value) -> None: ... + +class ExponentWithLinearTransform(Transform): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, gamma=..., offset=..., negativeStyle: NegativeStyle = ..., direction: TransformDirection = ...) -> None: ... + def equals(self, other: ExponentWithLinearTransform) -> bool: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def getGamma(self, *args, **kwargs): ... + def getNegativeStyle(self) -> NegativeStyle: ... + def getOffset(self, *args, **kwargs): ... + def setGamma(self, values) -> None: ... + def setNegativeStyle(self, style: NegativeStyle) -> None: ... + def setOffset(self, values) -> None: ... + +class ExposureContrastStyle: + __members__: ClassVar[dict] = ... # read-only + EXPOSURE_CONTRAST_LINEAR: ClassVar[ExposureContrastStyle] = ... + EXPOSURE_CONTRAST_LOGARITHMIC: ClassVar[ExposureContrastStyle] = ... + EXPOSURE_CONTRAST_VIDEO: ClassVar[ExposureContrastStyle] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class ExposureContrastTransform(Transform): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, style: ExposureContrastStyle = ..., exposure: float = ..., contrast: float = ..., gamma: float = ..., pivot: float = ..., logExposureStep: float = ..., logMidGray: float = ..., dynamicExposure: bool = ..., dynamicContrast: bool = ..., dynamicGamma: bool = ..., direction: TransformDirection = ...) -> None: ... + def equals(self, other: ExposureContrastTransform) -> bool: ... + def getContrast(self) -> float: ... + def getExposure(self) -> float: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def getGamma(self) -> float: ... + def getLogExposureStep(self) -> float: ... + def getLogMidGray(self) -> float: ... + def getPivot(self) -> float: ... + def getStyle(self) -> ExposureContrastStyle: ... + def isContrastDynamic(self) -> bool: ... + def isExposureDynamic(self) -> bool: ... + def isGammaDynamic(self) -> bool: ... + def makeContrastDynamic(self) -> None: ... + def makeContrastNonDynamic(self) -> None: ... + def makeExposureDynamic(self) -> None: ... + def makeExposureNonDynamic(self) -> None: ... + def makeGammaDynamic(self) -> None: ... + def makeGammaNonDynamic(self) -> None: ... + def setContrast(self, contrast: float) -> None: ... + def setExposure(self, exposure: float) -> None: ... + def setGamma(self, gamma: float) -> None: ... + def setLogExposureStep(self, logExposureStep: float) -> None: ... + def setLogMidGray(self, logMidGray: float) -> None: ... + def setPivot(self, pivot: float) -> None: ... + def setStyle(self, style: ExposureContrastStyle) -> None: ... + +class FileRules: + def __init__(self) -> None: ... + def decreaseRulePriority(self, ruleIndex: int) -> None: ... + def getColorSpace(self, ruleIndex: int) -> str: ... + def getCustomKeyName(self, ruleIndex: int, key: int) -> str: ... + def getCustomKeyValue(self, ruleIndex: int, key: int) -> str: ... + def getExtension(self, ruleIndex: int) -> str: ... + def getIndexForRule(self, ruleName: str) -> int: ... + def getName(self, ruleIndex: int) -> str: ... + def getNumCustomKeys(self, ruleIndex: int) -> int: ... + def getNumEntries(self) -> int: ... + def getPattern(self, ruleIndex: int) -> str: ... + def getRegex(self, ruleIndex: int) -> str: ... + def increaseRulePriority(self, ruleIndex: int) -> None: ... + def insertPathSearchRule(self, ruleIndex: int) -> None: ... + @overload + def insertRule(self, ruleIndex: int, name: str, colorSpace: str, pattern: str, extension: str) -> None: ... + @overload + def insertRule(self, ruleIndex: int, name: str, colorSpace: str, regex: str) -> None: ... + def isDefault(self) -> bool: ... + def removeRule(self, ruleIndex: int) -> None: ... + def setColorSpace(self, ruleIndex: int, colorSpace: str) -> None: ... + def setCustomKey(self, ruleIndex: int, key: str, value: str) -> None: ... + def setDefaultRuleColorSpace(self, colorSpace: str) -> None: ... + def setExtension(self, ruleIndex: int, extension: str) -> None: ... + def setPattern(self, ruleIndex: int, pattern: str) -> None: ... + def setRegex(self, ruleIndex: int, regex: str) -> None: ... + def __deepcopy__(self, memo: dict) -> FileRules: ... + +class FileTransform(Transform): + class FormatIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> tuple: ... + def __iter__(self) -> FileTransform.FormatIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> tuple: ... + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, src: str = ..., cccId: str = ..., interpolation: Interpolation = ..., direction: TransformDirection = ...) -> None: ... + @staticmethod + def IsFormatExtensionSupported(extension: str) -> bool: ... + def getCCCId(self) -> str: ... + def getCDLStyle(self) -> CDLStyle: ... + @staticmethod + def getFormats() -> FileTransform.FormatIterator: ... + def getInterpolation(self) -> Interpolation: ... + def getSrc(self) -> str: ... + def setCCCId(self, cccId: str) -> None: ... + def setCDLStyle(self, style: CDLStyle) -> None: ... + def setInterpolation(self, interpolation: Interpolation) -> None: ... + def setSrc(self, src: str) -> None: ... + +class FixedFunctionStyle: + __members__: ClassVar[dict] = ... # read-only + FIXED_FUNCTION_ACES_DARK_TO_DIM_10: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_ACES_GAMUTMAP_02: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_ACES_GAMUTMAP_07: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_ACES_GAMUT_COMPRESS_20: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_ACES_GAMUT_COMP_13: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_ACES_GLOW_03: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_ACES_GLOW_10: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_ACES_OUTPUT_TRANSFORM_20: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_ACES_RED_MOD_03: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_ACES_RED_MOD_10: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_ACES_RGB_TO_JMH_20: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_ACES_TONESCALE_COMPRESS_20: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_LIN_TO_DOUBLE_LOG: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_LIN_TO_GAMMA_LOG: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_LIN_TO_PQ: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_REC2100_SURROUND: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_RGB_TO_HSV: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_XYZ_TO_LUV: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_XYZ_TO_uvY: ClassVar[FixedFunctionStyle] = ... + FIXED_FUNCTION_XYZ_TO_xyY: ClassVar[FixedFunctionStyle] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class FixedFunctionTransform(Transform): + def __init__(self, style: FixedFunctionStyle, params: Iterable[float] = ..., direction: TransformDirection = ...) -> None: ... + def equals(self, other: FixedFunctionTransform) -> bool: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def getParams(self) -> list[float]: ... + def getStyle(self) -> FixedFunctionStyle: ... + def setParams(self, params: Iterable[float]) -> None: ... + def setStyle(self, style: FixedFunctionStyle) -> None: ... + +class FormatMetadata: + class AttributeIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> tuple: ... + def __iter__(self) -> FormatMetadata.AttributeIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> tuple: ... + + class AttributeNameIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> FormatMetadata.AttributeNameIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class ChildElementIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> FormatMetadata: ... + def __iter__(self) -> FormatMetadata.ChildElementIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> FormatMetadata: ... + + class ConstChildElementIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> FormatMetadata: ... + def __iter__(self) -> FormatMetadata.ConstChildElementIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> FormatMetadata: ... + def __init__(self, *args, **kwargs) -> None: ... + def addChildElement(self, name: str, value: str) -> None: ... + def clear(self) -> None: ... + def getAttributes(self) -> FormatMetadata.AttributeIterator: ... + def getChildElements(self) -> FormatMetadata.ChildElementIterator: ... + def getElementName(self) -> str: ... + def getElementValue(self) -> str: ... + def getID(self) -> str: ... + def getName(self) -> str: ... + def setElementName(self, name: str) -> None: ... + def setElementValue(self, value: str) -> None: ... + def setID(self, id: str) -> None: ... + def setName(self, name: str) -> None: ... + def __contains__(self, name: str) -> bool: ... + def __getitem__(self, name: str) -> str: ... + def __iter__(self) -> FormatMetadata.AttributeNameIterator: ... + def __len__(self) -> int: ... + def __setitem__(self, name: str, value: str) -> None: ... + +class GPUProcessor: + def __init__(self, *args, **kwargs) -> None: ... + def extractGpuShaderInfo(self, shaderDesc: GpuShaderDesc) -> None: ... + def getCacheID(self) -> str: ... + def hasChannelCrosstalk(self) -> bool: ... + def isNoOp(self) -> bool: ... + +class GpuLanguage: + __members__: ClassVar[dict] = ... # read-only + GPU_LANGUAGE_CG: ClassVar[GpuLanguage] = ... + GPU_LANGUAGE_GLSL_1_2: ClassVar[GpuLanguage] = ... + GPU_LANGUAGE_GLSL_1_3: ClassVar[GpuLanguage] = ... + GPU_LANGUAGE_GLSL_4_0: ClassVar[GpuLanguage] = ... + GPU_LANGUAGE_GLSL_ES_1_0: ClassVar[GpuLanguage] = ... + GPU_LANGUAGE_GLSL_ES_3_0: ClassVar[GpuLanguage] = ... + GPU_LANGUAGE_HLSL_DX11: ClassVar[GpuLanguage] = ... + GPU_LANGUAGE_MSL_2_0: ClassVar[GpuLanguage] = ... + LANGUAGE_OSL_1: ClassVar[GpuLanguage] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class GpuShaderCreator: + class DynamicPropertyIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> DynamicProperty: ... + def __iter__(self) -> GpuShaderCreator.DynamicPropertyIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> DynamicProperty: ... + + class TextureDimensions: + __members__: ClassVar[dict] = ... # read-only + TEXTURE_1D: ClassVar[GpuShaderCreator.TextureDimensions] = ... + TEXTURE_2D: ClassVar[GpuShaderCreator.TextureDimensions] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + + class TextureType: + __members__: ClassVar[dict] = ... # read-only + TEXTURE_RED_CHANNEL: ClassVar[GpuShaderCreator.TextureType] = ... + TEXTURE_RGB_CHANNEL: ClassVar[GpuShaderCreator.TextureType] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + TEXTURE_1D: ClassVar[GpuShaderCreator.TextureDimensions] = ... + TEXTURE_2D: ClassVar[GpuShaderCreator.TextureDimensions] = ... + TEXTURE_RED_CHANNEL: ClassVar[GpuShaderCreator.TextureType] = ... + TEXTURE_RGB_CHANNEL: ClassVar[GpuShaderCreator.TextureType] = ... + def __init__(self, *args, **kwargs) -> None: ... + def addToDeclareShaderCode(self, shaderCode: str) -> None: ... + def addToFunctionFooterShaderCode(self, shaderCode: str) -> None: ... + def addToFunctionHeaderShaderCode(self, shaderCode: str) -> None: ... + def addToFunctionShaderCode(self, shaderCode: str) -> None: ... + def addToHelperShaderCode(self, shaderCode: str) -> None: ... + def begin(self, uid: str) -> None: ... + def clone(self) -> GpuShaderCreator: ... + def createShaderText(self, shaderDeclarations: str, shaderHelperMethods: str, shaderFunctionHeader: str, shaderFunctionBody: str, shaderFunctionFooter: str) -> None: ... + def end(self) -> None: ... + def finalize(self) -> None: ... + def getAllowTexture1D(self) -> bool: ... + def getCacheID(self) -> str: ... + def getDynamicProperties(self) -> GpuShaderCreator.DynamicPropertyIterator: ... + def getDynamicProperty(self, type: DynamicPropertyType) -> DynamicProperty: ... + def getFunctionName(self) -> str: ... + def getLanguage(self) -> GpuLanguage: ... + def getNextResourceIndex(self) -> int: ... + def getPixelName(self) -> str: ... + def getResourcePrefix(self) -> str: ... + def getTextureMaxWidth(self) -> int: ... + def getUniqueID(self) -> str: ... + def hasDynamicProperty(self, type: DynamicPropertyType) -> bool: ... + def setAllowTexture1D(self, allowed: bool) -> None: ... + def setFunctionName(self, name: str) -> None: ... + def setLanguage(self, language: GpuLanguage) -> None: ... + def setPixelName(self, name: str) -> None: ... + def setResourcePrefix(self, prefix: str) -> None: ... + def setTextureMaxWidth(self, maxWidth: int) -> None: ... + def setUniqueID(self, uid: str) -> None: ... + +class GpuShaderDesc(GpuShaderCreator): + class Texture: + def __init__(self, *args, **kwargs) -> None: ... + def getValues(self) -> numpy.ndarray: ... + @property + def channel(self) -> GpuShaderCreator.TextureType: ... + @property + def dimensions(self) -> GpuShaderCreator.TextureDimensions: ... + @property + def height(self) -> int: ... + @property + def interpolation(self) -> Interpolation: ... + @property + def samplerName(self) -> str: ... + @property + def textureName(self) -> str: ... + @property + def width(self) -> int: ... + + class Texture3D: + def __init__(self, *args, **kwargs) -> None: ... + def getValues(self) -> numpy.ndarray: ... + @property + def edgeLen(self) -> int: ... + @property + def interpolation(self) -> Interpolation: ... + @property + def samplerName(self) -> str: ... + @property + def textureName(self) -> str: ... + + class Texture3DIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> GpuShaderDesc.Texture3D: ... + def __iter__(self) -> GpuShaderDesc.Texture3DIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> GpuShaderDesc.Texture3D: ... + + class TextureIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> GpuShaderDesc.Texture: ... + def __iter__(self) -> GpuShaderDesc.TextureIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> GpuShaderDesc.Texture: ... + + class UniformData: + type: UniformDataType + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, data: GpuShaderDesc.UniformData) -> None: ... + def getBool(self) -> bool: ... + def getDouble(self) -> float: ... + def getFloat3(self, *args, **kwargs): ... + def getVectorFloat(self) -> numpy.ndarray: ... + def getVectorInt(self) -> numpy.ndarray: ... + + class UniformIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> tuple: ... + def __iter__(self) -> GpuShaderDesc.UniformIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> tuple: ... + def __init__(self, *args, **kwargs) -> None: ... + @staticmethod + def CreateShaderDesc(language: GpuLanguage = ..., functionName: str = ..., pixelName: str = ..., resourcePrefix: str = ..., uid: str = ...) -> GpuShaderDesc: ... + def add3DTexture(self, textureName: str, samplerName: str, edgeLen: int, interpolation: Interpolation, values: Buffer) -> None: ... + def addTexture(self, textureName: str, samplerName: str, width: int, height: int, channel: GpuShaderCreator.TextureType, dimensions: GpuShaderCreator.TextureDimensions, interpolation: Interpolation, values: Buffer) -> None: ... + def clone(self) -> GpuShaderCreator: ... + def get3DTextures(self) -> GpuShaderDesc.Texture3DIterator: ... + def getShaderText(self) -> str: ... + def getTextures(self) -> GpuShaderDesc.TextureIterator: ... + def getUniforms(self) -> GpuShaderDesc.UniformIterator: ... + +class GradingBSplineCurve: + class GradingControlPointIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> GradingControlPoint: ... + def __iter__(self) -> GradingBSplineCurve.GradingControlPointIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> GradingControlPoint: ... + def __setitem__(self, arg0: int, arg1: GradingControlPoint, /) -> None: ... + @overload + def __init__(self, size: int) -> None: ... + @overload + def __init__(self, arg0: Iterable[float], /) -> None: ... + def getControlPoints(self) -> GradingBSplineCurve.GradingControlPointIterator: ... + def setNumControlPoints(self, size: int) -> None: ... + def validate(self) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + +class GradingControlPoint: + x: float + y: float + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, x: float = ..., y: float = ...) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + +class GradingPrimary: + NoClampBlack: ClassVar[float] = ... # read-only + NoClampWhite: ClassVar[float] = ... # read-only + brightness: GradingRGBM + clampBlack: float + clampWhite: float + contrast: GradingRGBM + exposure: GradingRGBM + gain: GradingRGBM + gamma: GradingRGBM + lift: GradingRGBM + offset: GradingRGBM + pivot: float + pivotBlack: float + pivotWhite: float + saturation: float + def __init__(self, arg0: GradingStyle, /) -> None: ... + def validate(self, arg0: GradingStyle, /) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + +class GradingPrimaryTransform(Transform): + @overload + def __init__(self, values: GradingPrimary, style: GradingStyle = ..., dynamic: bool = ..., dir: TransformDirection = ...) -> None: ... + @overload + def __init__(self, style: GradingStyle = ..., dynamic: bool = ..., dir: TransformDirection = ...) -> None: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def getStyle(self) -> GradingStyle: ... + def getValue(self) -> GradingPrimary: ... + def isDynamic(self) -> bool: ... + def makeDynamic(self) -> None: ... + def makeNonDynamic(self) -> None: ... + def setStyle(self, style: GradingStyle) -> None: ... + def setValue(self, values: GradingPrimary) -> None: ... + +class GradingRGBCurve: + blue: GradingBSplineCurve + green: GradingBSplineCurve + master: GradingBSplineCurve + red: GradingBSplineCurve + @overload + def __init__(self, style: GradingStyle) -> None: ... + @overload + def __init__(self, red: GradingBSplineCurve = ..., green: GradingBSplineCurve = ..., blue: GradingBSplineCurve = ..., master: GradingBSplineCurve = ...) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + +class GradingRGBCurveTransform(Transform): + @overload + def __init__(self, values: GradingRGBCurve, style: GradingStyle = ..., dynamic: bool = ..., dir: TransformDirection = ...) -> None: ... + @overload + def __init__(self, style: GradingStyle = ..., dynamic: bool = ..., dir: TransformDirection = ...) -> None: ... + def getBypassLinToLog(self) -> bool: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def getSlope(self, channel: RGBCurveType, index: int) -> float: ... + def getStyle(self) -> GradingStyle: ... + def getValue(self) -> GradingRGBCurve: ... + def isDynamic(self) -> bool: ... + def makeDynamic(self) -> None: ... + def makeNonDynamic(self) -> None: ... + def setBypassLinToLog(self, bypass: bool) -> None: ... + def setSlope(self, channel: RGBCurveType, index: int, slope: float) -> None: ... + def setStyle(self, style: GradingStyle) -> None: ... + def setValue(self, values: GradingRGBCurve) -> None: ... + def slopesAreDefault(self, channel: RGBCurveType) -> bool: ... + +class GradingRGBM: + blue: float + green: float + master: float + red: float + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, red: float, green: float, blue: float, master: float) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + +class GradingRGBMSW: + blue: float + green: float + master: float + red: float + start: float + width: float + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, red: float, green: float, blue: float, master: float, start: float, width: float) -> None: ... + @overload + def __init__(self, start: float, width: float) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + +class GradingStyle: + __members__: ClassVar[dict] = ... # read-only + GRADING_LIN: ClassVar[GradingStyle] = ... + GRADING_LOG: ClassVar[GradingStyle] = ... + GRADING_VIDEO: ClassVar[GradingStyle] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class GradingTone: + blacks: GradingRGBMSW + highlights: GradingRGBMSW + midtones: GradingRGBMSW + scontrast: float + shadows: GradingRGBMSW + whites: GradingRGBMSW + def __init__(self, arg0: GradingStyle, /) -> None: ... + def validate(self) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + +class GradingToneTransform(Transform): + @overload + def __init__(self, values: GradingTone, style: GradingStyle = ..., dynamic: bool = ..., dir: TransformDirection = ...) -> None: ... + @overload + def __init__(self, style: GradingStyle = ..., dynamic: bool = ..., dir: TransformDirection = ...) -> None: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def getStyle(self) -> GradingStyle: ... + def getValue(self) -> GradingTone: ... + def isDynamic(self) -> bool: ... + def makeDynamic(self) -> None: ... + def makeNonDynamic(self) -> None: ... + def setStyle(self, style: GradingStyle) -> None: ... + def setValue(self, values: GradingTone) -> None: ... + +class GroupTransform(Transform): + class TransformIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> Transform: ... + def __iter__(self) -> GroupTransform.TransformIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> Transform: ... + + class WriteFormatIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> tuple: ... + def __iter__(self) -> GroupTransform.WriteFormatIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> tuple: ... + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, transforms: Iterable[Transform] = ..., direction: TransformDirection = ...) -> None: ... + @staticmethod + def GetWriteFormats() -> GroupTransform.WriteFormatIterator: ... + def appendTransform(self, transform: Transform) -> None: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def prependTransform(self, transform: Transform) -> None: ... + @overload + def write(self, formatName: str, fileName: str, config: Config = ...) -> None: ... + @overload + def write(self, formatName: str, config: Config = ...) -> str: ... + def __getitem__(self, index: int) -> Transform: ... + def __iter__(self) -> GroupTransform.TransformIterator: ... + def __len__(self) -> int: ... + +class ImageDesc: + def __init__(self) -> None: ... + def getBitDepth(self) -> BitDepth: ... + def getHeight(self) -> int: ... + def getWidth(self) -> int: ... + def getXStrideBytes(self) -> int: ... + def getYStrideBytes(self) -> int: ... + def isFloat(self) -> bool: ... + def isRGBAPacked(self) -> bool: ... + +class Interpolation: + __members__: ClassVar[dict] = ... # read-only + INTERP_BEST: ClassVar[Interpolation] = ... + INTERP_CUBIC: ClassVar[Interpolation] = ... + INTERP_DEFAULT: ClassVar[Interpolation] = ... + INTERP_LINEAR: ClassVar[Interpolation] = ... + INTERP_NEAREST: ClassVar[Interpolation] = ... + INTERP_TETRAHEDRAL: ClassVar[Interpolation] = ... + INTERP_UNKNOWN: ClassVar[Interpolation] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class LegacyViewingPipeline: + def __init__(self) -> None: ... + def getChannelView(self) -> Transform: ... + def getColorTimingCC(self) -> Transform: ... + def getDisplayCC(self) -> Transform: ... + def getDisplayViewTransform(self) -> DisplayViewTransform: ... + def getLinearCC(self) -> Transform: ... + def getLooksOverride(self) -> str: ... + def getLooksOverrideEnabled(self) -> bool: ... + def getProcessor(self, config: Config, context: Context = ...) -> Processor: ... + def setChannelView(self, arg0: Transform, /) -> None: ... + def setColorTimingCC(self, arg0: Transform, /) -> None: ... + def setDisplayCC(self, arg0: Transform, /) -> None: ... + def setDisplayViewTransform(self, arg0: DisplayViewTransform, /) -> None: ... + def setLinearCC(self, arg0: Transform, /) -> None: ... + def setLooksOverride(self, looks: str) -> None: ... + def setLooksOverrideEnabled(self, arg0: bool, /) -> None: ... + +class LogAffineTransform(Transform): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, logSideSlope=..., logSideOffset=..., linSideSlope=..., linSideOffset=..., direction: TransformDirection = ...) -> None: ... + def equals(self, other: LogAffineTransform) -> bool: ... + def getBase(self) -> float: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def getLinSideOffsetValue(self, *args, **kwargs): ... + def getLinSideSlopeValue(self, *args, **kwargs): ... + def getLogSideOffsetValue(self, *args, **kwargs): ... + def getLogSideSlopeValue(self, *args, **kwargs): ... + def setBase(self, base: float) -> None: ... + def setLinSideOffsetValue(self, values) -> None: ... + def setLinSideSlopeValue(self, values) -> None: ... + def setLogSideOffsetValue(self, values) -> None: ... + def setLogSideSlopeValue(self, values) -> None: ... + +class LogCameraTransform(Transform): + def __init__(self, linSideBreak, base: float = ..., logSideSlope=..., logSideOffset=..., linSideSlope=..., linSideOffset=..., linearSlope: Iterable[float] = ..., direction: TransformDirection = ...) -> None: ... + def equals(self, other: LogCameraTransform) -> bool: ... + def getBase(self) -> float: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def getLinSideBreakValue(self, *args, **kwargs): ... + def getLinSideOffsetValue(self, *args, **kwargs): ... + def getLinSideSlopeValue(self, *args, **kwargs): ... + def getLinearSlopeValue(self, *args, **kwargs): ... + def getLogSideOffsetValue(self, *args, **kwargs): ... + def getLogSideSlopeValue(self, *args, **kwargs): ... + def isLinearSlopeValueSet(self) -> bool: ... + def setBase(self, base: float) -> None: ... + def setLinSideBreakValue(self, values) -> None: ... + def setLinSideOffsetValue(self, values) -> None: ... + def setLinSideSlopeValue(self, values) -> None: ... + def setLinearSlopeValue(self, values) -> None: ... + def setLogSideOffsetValue(self, values) -> None: ... + def setLogSideSlopeValue(self, values) -> None: ... + def unsetLinearSlopeValue(self) -> None: ... + +class LogTransform(Transform): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, base: float = ..., direction: TransformDirection = ...) -> None: ... + def equals(self, other: LogTransform) -> bool: ... + def getBase(self) -> float: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def setBase(self, base: float) -> None: ... + +class LoggingLevel: + __members__: ClassVar[dict] = ... # read-only + LOGGING_LEVEL_DEBUG: ClassVar[LoggingLevel] = ... + LOGGING_LEVEL_INFO: ClassVar[LoggingLevel] = ... + LOGGING_LEVEL_NONE: ClassVar[LoggingLevel] = ... + LOGGING_LEVEL_UNKNOWN: ClassVar[LoggingLevel] = ... + LOGGING_LEVEL_WARNING: ClassVar[LoggingLevel] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __and__(self, other: object) -> object: ... + def __eq__(self, other: object) -> bool: ... + def __ge__(self, other: object) -> bool: ... + def __gt__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __invert__(self) -> object: ... + def __le__(self, other: object) -> bool: ... + def __lt__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __or__(self, other: object) -> object: ... + def __rand__(self, other: object) -> object: ... + def __ror__(self, other: object) -> object: ... + def __rxor__(self, other: object) -> object: ... + def __xor__(self, other: object) -> object: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class Look: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, name: str = ..., processSpace: str = ..., transform: Transform = ..., inverseTransform: Transform = ..., description: str = ...) -> None: ... + def getDescription(self) -> str: ... + def getInverseTransform(self) -> Transform: ... + def getName(self) -> str: ... + def getProcessSpace(self) -> str: ... + def getTransform(self) -> Transform: ... + def setDescription(self, description: str) -> None: ... + def setInverseTransform(self, transform: Transform) -> None: ... + def setName(self, name: str) -> None: ... + def setProcessSpace(self, processSpace: str) -> None: ... + def setTransform(self, transform: Transform) -> None: ... + def __deepcopy__(self, memo: dict) -> Look: ... + +class LookTransform(Transform): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, src: str, dst: str, looks: str = ..., skipColorSpaceConversion: bool = ..., direction: TransformDirection = ...) -> None: ... + def getDst(self) -> str: ... + def getLooks(self) -> str: ... + def getSkipColorSpaceConversion(self) -> bool: ... + def getSrc(self) -> str: ... + def setDst(self, dst: str) -> None: ... + def setLooks(self, looks: str) -> None: ... + def setSkipColorSpaceConversion(self, skipColorSpaceConversion: bool) -> None: ... + def setSrc(self, src: str) -> None: ... + +class Lut1DHueAdjust: + __members__: ClassVar[dict] = ... # read-only + HUE_DW3: ClassVar[Lut1DHueAdjust] = ... + HUE_NONE: ClassVar[Lut1DHueAdjust] = ... + HUE_WYPN: ClassVar[Lut1DHueAdjust] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class Lut1DTransform(Transform): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, length: int, inputHalfDomain: bool) -> None: ... + @overload + def __init__(self, length: int = ..., inputHalfDomain: bool = ..., outputRawHalfs: bool = ..., fileOutputBitDepth: BitDepth = ..., hueAdjust: Lut1DHueAdjust = ..., interpolation: Interpolation = ..., direction: TransformDirection = ...) -> None: ... + def equals(self, other: Lut1DTransform) -> bool: ... + def getData(self) -> numpy.ndarray: ... + def getFileOutputBitDepth(self) -> BitDepth: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def getHueAdjust(self) -> Lut1DHueAdjust: ... + def getInputHalfDomain(self) -> bool: ... + def getInterpolation(self) -> Interpolation: ... + def getLength(self) -> int: ... + def getOutputRawHalfs(self) -> bool: ... + def getValue(self, index: int) -> tuple: ... + def setData(self, data: Buffer) -> None: ... + def setFileOutputBitDepth(self, bitDepth: BitDepth) -> None: ... + def setHueAdjust(self, hueAdjust: Lut1DHueAdjust) -> None: ... + def setInputHalfDomain(self, isHalfDomain: bool) -> None: ... + def setInterpolation(self, interpolation: Interpolation) -> None: ... + def setLength(self, length: int) -> None: ... + def setOutputRawHalfs(self, isRawHalfs: bool) -> None: ... + def setValue(self, index: int, r: float, g: float, b: float) -> None: ... + +class Lut3DTransform(Transform): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, gridSize: int) -> None: ... + @overload + def __init__(self, gridSize: int = ..., fileOutputBitDepth: BitDepth = ..., interpolation: Interpolation = ..., direction: TransformDirection = ...) -> None: ... + def equals(self, other: Lut3DTransform) -> bool: ... + def getData(self) -> numpy.ndarray: ... + def getFileOutputBitDepth(self) -> BitDepth: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def getGridSize(self) -> int: ... + def getInterpolation(self) -> Interpolation: ... + def getValue(self, indexR: int, indexG: int, indexB: int) -> tuple: ... + def setData(self, data: Buffer) -> None: ... + def setFileOutputBitDepth(self, bitDepth: BitDepth) -> None: ... + def setGridSize(self, gridSize: int) -> None: ... + def setInterpolation(self, interpolation: Interpolation) -> None: ... + def setValue(self, indexR: int, indexG: int, indexB: int, r: float, g: float, b: float) -> None: ... + +class MatrixTransform(Transform): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, matrix=..., offset=..., direction: TransformDirection = ...) -> None: ... + @staticmethod + def Fit(oldMin=..., oldMax=..., newMin=..., newMax=...) -> MatrixTransform: ... + @staticmethod + def Identity() -> MatrixTransform: ... + @staticmethod + def Sat(sat: float, lumaCoef) -> MatrixTransform: ... + @staticmethod + def Scale(scale) -> MatrixTransform: ... + @staticmethod + def View(channelHot, lumaCoef) -> MatrixTransform: ... + def equals(self, other: MatrixTransform) -> bool: ... + def getFileInputBitDepth(self) -> BitDepth: ... + def getFileOutputBitDepth(self) -> BitDepth: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def getMatrix(self, *args, **kwargs): ... + def getOffset(self, *args, **kwargs): ... + def setFileInputBitDepth(self, bitDepth: BitDepth) -> None: ... + def setFileOutputBitDepth(self, bitDepth: BitDepth) -> None: ... + def setMatrix(self, matrix) -> None: ... + def setOffset(self, offset) -> None: ... + +class MixingColorSpaceManager: + class MixingEncodingIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> MixingColorSpaceManager.MixingEncodingIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class MixingSpaceIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> MixingColorSpaceManager.MixingSpaceIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + def __init__(self, config: Config) -> None: ... + def getMixingEncodings(self) -> MixingColorSpaceManager.MixingEncodingIterator: ... + def getMixingSpaces(self) -> MixingColorSpaceManager.MixingSpaceIterator: ... + def getProcessor(self, workingSpaceName: str, displayName: str, viewName: str, direction: TransformDirection = ...) -> Processor: ... + def getSelectedMixingEncodingIdx(self) -> int: ... + def getSelectedMixingSpaceIdx(self) -> int: ... + @overload + def getSlider(self) -> MixingSlider: ... + @overload + def getSlider(self, sliderMixingMinEdge: float, sliderMixingMaxEdge: float) -> MixingSlider: ... + def isPerceptuallyUniform(self) -> bool: ... + def refresh(self, config: Config) -> None: ... + def setSelectedMixingEncoding(self, mixingEncoding: str) -> None: ... + def setSelectedMixingEncodingIdx(self, arg0: int, /) -> None: ... + def setSelectedMixingSpace(self, mixingSpace: str) -> None: ... + def setSelectedMixingSpaceIdx(self, arg0: int, /) -> None: ... + +class MixingSlider: + def __init__(self, *args, **kwargs) -> None: ... + def getSliderMaxEdge(self) -> float: ... + def getSliderMinEdge(self) -> float: ... + def mixingToSlider(self, mixingUnits: float) -> float: ... + def setSliderMaxEdge(self, arg0: float, /) -> None: ... + def setSliderMinEdge(self, arg0: float, /) -> None: ... + def sliderToMixing(self, sliderUnits: float) -> float: ... + +class NamedTransform: + class NamedTransformAliasIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> NamedTransform.NamedTransformAliasIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class NamedTransformCategoryIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> NamedTransform.NamedTransformCategoryIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, name: str = ..., aliases: Iterable[str] = ..., family: str = ..., description: str = ..., forwardTransform: Transform = ..., inverseTransform: Transform = ..., categories: Iterable[str] = ...) -> None: ... + @staticmethod + def GetTransform(transform: NamedTransform, direction: TransformDirection) -> Transform: ... + def addAlias(self, alias: str) -> None: ... + def addCategory(self, category: str) -> None: ... + def clearAliases(self) -> None: ... + def clearCategories(self) -> None: ... + def getAliases(self) -> NamedTransform.NamedTransformAliasIterator: ... + def getCategories(self) -> NamedTransform.NamedTransformCategoryIterator: ... + def getDescription(self) -> str: ... + def getEncoding(self) -> str: ... + def getFamily(self) -> str: ... + def getName(self) -> str: ... + def getTransform(self, direction: TransformDirection) -> Transform: ... + def hasAlias(self, alias: str) -> bool: ... + def hasCategory(self, category: str) -> bool: ... + def removeAlias(self, alias: str) -> None: ... + def removeCategory(self, category: str) -> None: ... + def setDescription(self, description: str) -> None: ... + def setEncoding(self, encoding: str) -> None: ... + def setFamily(self, family: str) -> None: ... + def setName(self, name: str) -> None: ... + def setTransform(self, transform: Transform, direction: TransformDirection) -> None: ... + def __deepcopy__(self, memo: dict) -> NamedTransform: ... + +class NamedTransformVisibility: + __members__: ClassVar[dict] = ... # read-only + NAMEDTRANSFORM_ACTIVE: ClassVar[NamedTransformVisibility] = ... + NAMEDTRANSFORM_ALL: ClassVar[NamedTransformVisibility] = ... + NAMEDTRANSFORM_INACTIVE: ClassVar[NamedTransformVisibility] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class NegativeStyle: + __members__: ClassVar[dict] = ... # read-only + NEGATIVE_CLAMP: ClassVar[NegativeStyle] = ... + NEGATIVE_LINEAR: ClassVar[NegativeStyle] = ... + NEGATIVE_MIRROR: ClassVar[NegativeStyle] = ... + NEGATIVE_PASS_THRU: ClassVar[NegativeStyle] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class OptimizationFlags: + __members__: ClassVar[dict] = ... # read-only + OPTIMIZATION_ALL: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_COMP_EXPONENT: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_COMP_GAMMA: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_COMP_LUT1D: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_COMP_LUT3D: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_COMP_MATRIX: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_COMP_RANGE: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_COMP_SEPARABLE_PREFIX: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_DEFAULT: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_DRAFT: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_FAST_LOG_EXP_POW: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_GOOD: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_IDENTITY: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_IDENTITY_GAMMA: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_LOSSLESS: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_LUT_INV_FAST: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_NONE: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_NO_DYNAMIC_PROPERTIES: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_PAIR_IDENTITY_CDL: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_PAIR_IDENTITY_EXPOSURE_CONTRAST: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_PAIR_IDENTITY_FIXED_FUNCTION: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_PAIR_IDENTITY_GAMMA: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_PAIR_IDENTITY_GRADING: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_PAIR_IDENTITY_LOG: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_PAIR_IDENTITY_LUT1D: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_PAIR_IDENTITY_LUT3D: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_SIMPLIFY_OPS: ClassVar[OptimizationFlags] = ... + OPTIMIZATION_VERY_GOOD: ClassVar[OptimizationFlags] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __and__(self, other: object) -> object: ... + def __eq__(self, other: object) -> bool: ... + def __ge__(self, other: object) -> bool: ... + def __gt__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __invert__(self) -> object: ... + def __le__(self, other: object) -> bool: ... + def __lt__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __or__(self, other: object) -> object: ... + def __rand__(self, other: object) -> object: ... + def __ror__(self, other: object) -> object: ... + def __rxor__(self, other: object) -> object: ... + def __xor__(self, other: object) -> object: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class PackedImageDesc(ImageDesc): + @overload + def __init__(self, data: Buffer, width: int, height: int, numChannels: int) -> None: ... + @overload + def __init__(self, data: Buffer, width: int, height: int, numChannels: int, bitDepth: BitDepth, chanStrideBytes: int, xStrideBytes: int, yStrideBytes: int) -> None: ... + @overload + def __init__(self, data: Buffer, width: int, height: int, chanOrder: ChannelOrdering) -> None: ... + @overload + def __init__(self, data: Buffer, width: int, height: int, chanOrder: ChannelOrdering, bitDepth: BitDepth, chanStrideBytes: int, xStrideBytes: int, yStrideBytes: int) -> None: ... + def getChanStrideBytes(self) -> int: ... + def getChannelOrder(self) -> ChannelOrdering: ... + def getData(self) -> numpy.ndarray: ... + def getNumChannels(self) -> int: ... + +class PlanarImageDesc(ImageDesc): + @overload + def __init__(self, rData: Buffer, gData: Buffer, bData: Buffer, width: int, height: int) -> None: ... + @overload + def __init__(self, rData: Buffer, gData: Buffer, bData: Buffer, aData: Buffer, width: int, height: int) -> None: ... + @overload + def __init__(self, rData: Buffer, gData: Buffer, bData: Buffer, width: int, height: int, bitDepth: BitDepth, xStrideBytes: int, yStrideBytes: int) -> None: ... + @overload + def __init__(self, rData: Buffer, gData: Buffer, bData: Buffer, aData: Buffer, width: int, height: int, bitDepth: BitDepth, xStrideBytes: int, yStrideBytes: int) -> None: ... + def getAData(self) -> numpy.ndarray: ... + def getBData(self) -> numpy.ndarray: ... + def getGData(self) -> numpy.ndarray: ... + def getRData(self) -> numpy.ndarray: ... + +class Processor: + class TransformFormatMetadataIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> FormatMetadata: ... + def __iter__(self) -> Processor.TransformFormatMetadataIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> FormatMetadata: ... + def __init__(self, *args, **kwargs) -> None: ... + def createGroupTransform(self) -> GroupTransform: ... + def getCacheID(self) -> str: ... + def getDefaultCPUProcessor(self) -> CPUProcessor: ... + def getDefaultGPUProcessor(self) -> GPUProcessor: ... + def getDynamicProperty(self, type: DynamicPropertyType) -> DynamicProperty: ... + def getFormatMetadata(self) -> FormatMetadata: ... + @overload + def getOptimizedCPUProcessor(self, oFlags: OptimizationFlags) -> CPUProcessor: ... + @overload + def getOptimizedCPUProcessor(self, inBitDepth: BitDepth, outBitDepth: BitDepth, oFlags: OptimizationFlags) -> CPUProcessor: ... + def getOptimizedGPUProcessor(self, oFlags: OptimizationFlags) -> GPUProcessor: ... + @overload + def getOptimizedProcessor(self, oFlags: OptimizationFlags) -> Processor: ... + @overload + def getOptimizedProcessor(self, inBitDepth: BitDepth, outBitDepth: BitDepth, oFlags: OptimizationFlags) -> Processor: ... + def getProcessorMetadata(self) -> ProcessorMetadata: ... + def getTransformFormatMetadata(self) -> Processor.TransformFormatMetadataIterator: ... + def hasChannelCrosstalk(self) -> bool: ... + def hasDynamicProperty(self, type: DynamicPropertyType) -> bool: ... + def isDynamic(self) -> bool: ... + def isNoOp(self) -> bool: ... + +class ProcessorCacheFlags: + __members__: ClassVar[dict] = ... # read-only + PROCESSOR_CACHE_DEFAULT: ClassVar[ProcessorCacheFlags] = ... + PROCESSOR_CACHE_ENABLED: ClassVar[ProcessorCacheFlags] = ... + PROCESSOR_CACHE_OFF: ClassVar[ProcessorCacheFlags] = ... + PROCESSOR_CACHE_SHARE_DYN_PROPERTIES: ClassVar[ProcessorCacheFlags] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class ProcessorMetadata: + class FileIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> ProcessorMetadata.FileIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class LookIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> ProcessorMetadata.LookIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + def __init__(self) -> None: ... + def addFile(self, fileName: str) -> None: ... + def addLook(self, look: str) -> None: ... + def getFiles(self) -> ProcessorMetadata.FileIterator: ... + def getLooks(self) -> ProcessorMetadata.LookIterator: ... + +class PyConfigIOProxy: + def __init__(self) -> None: ... + def getConfigData(self) -> str: ... + def getFastLutFileHash(self, arg0: str, /) -> str: ... + def getLutData(self, arg0: str, /) -> vector_of_uint8_t: ... + +class RGBCurveType: + __members__: ClassVar[dict] = ... # read-only + RGB_BLUE: ClassVar[RGBCurveType] = ... + RGB_GREEN: ClassVar[RGBCurveType] = ... + RGB_MASTER: ClassVar[RGBCurveType] = ... + RGB_NUM_CURVES: ClassVar[RGBCurveType] = ... + RGB_RED: ClassVar[RGBCurveType] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class RangeStyle: + __members__: ClassVar[dict] = ... # read-only + RANGE_CLAMP: ClassVar[RangeStyle] = ... + RANGE_NO_CLAMP: ClassVar[RangeStyle] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class RangeTransform(Transform): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, minInValue: float = ..., maxInValue: float = ..., minOutValue: float = ..., maxOutValue: float = ..., direction: TransformDirection = ...) -> None: ... + def equals(self, other: RangeTransform) -> bool: ... + def getFileInputBitDepth(self) -> BitDepth: ... + def getFileOutputBitDepth(self) -> BitDepth: ... + def getFormatMetadata(self) -> FormatMetadata: ... + def getMaxInValue(self) -> float: ... + def getMaxOutValue(self) -> float: ... + def getMinInValue(self) -> float: ... + def getMinOutValue(self) -> float: ... + def getStyle(self) -> RangeStyle: ... + def hasMaxInValue(self) -> bool: ... + def hasMaxOutValue(self) -> bool: ... + def hasMinInValue(self) -> bool: ... + def hasMinOutValue(self) -> bool: ... + def setFileInputBitDepth(self, bitDepth: BitDepth) -> None: ... + def setFileOutputBitDepth(self, bitDepth: BitDepth) -> None: ... + def setMaxInValue(self, value: float) -> None: ... + def setMaxOutValue(self, value: float) -> None: ... + def setMinInValue(self, value: float) -> None: ... + def setMinOutValue(self, value: float) -> None: ... + def setStyle(self, style: RangeStyle) -> None: ... + def unsetMaxInValue(self) -> None: ... + def unsetMaxOutValue(self) -> None: ... + def unsetMinInValue(self) -> None: ... + def unsetMinOutValue(self) -> None: ... + +class ReferenceSpaceType: + __members__: ClassVar[dict] = ... # read-only + REFERENCE_SPACE_DISPLAY: ClassVar[ReferenceSpaceType] = ... + REFERENCE_SPACE_SCENE: ClassVar[ReferenceSpaceType] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class SearchReferenceSpaceType: + __members__: ClassVar[dict] = ... # read-only + SEARCH_REFERENCE_SPACE_ALL: ClassVar[SearchReferenceSpaceType] = ... + SEARCH_REFERENCE_SPACE_DISPLAY: ClassVar[SearchReferenceSpaceType] = ... + SEARCH_REFERENCE_SPACE_SCENE: ClassVar[SearchReferenceSpaceType] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class SystemMonitors: + class MonitorIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> tuple: ... + def __iter__(self) -> SystemMonitors.MonitorIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> tuple: ... + def __init__(self) -> None: ... + def getMonitors(self) -> SystemMonitors.MonitorIterator: ... + +class Transform: + def __init__(self, *args, **kwargs) -> None: ... + def getDirection(self) -> TransformDirection: ... + def getTransformType(self) -> TransformType: ... + def setDirection(self, direction: TransformDirection) -> None: ... + def validate(self) -> None: ... + def __deepcopy__(self, memo: dict) -> Transform: ... + +class TransformDirection: + __members__: ClassVar[dict] = ... # read-only + TRANSFORM_DIR_FORWARD: ClassVar[TransformDirection] = ... + TRANSFORM_DIR_INVERSE: ClassVar[TransformDirection] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class TransformType: + __members__: ClassVar[dict] = ... # read-only + TRANSFORM_TYPE_ALLOCATION: ClassVar[TransformType] = ... + TRANSFORM_TYPE_BUILTIN: ClassVar[TransformType] = ... + TRANSFORM_TYPE_CDL: ClassVar[TransformType] = ... + TRANSFORM_TYPE_COLORSPACE: ClassVar[TransformType] = ... + TRANSFORM_TYPE_DISPLAY_VIEW: ClassVar[TransformType] = ... + TRANSFORM_TYPE_EXPONENT: ClassVar[TransformType] = ... + TRANSFORM_TYPE_EXPONENT_WITH_LINEAR: ClassVar[TransformType] = ... + TRANSFORM_TYPE_EXPOSURE_CONTRAST: ClassVar[TransformType] = ... + TRANSFORM_TYPE_FILE: ClassVar[TransformType] = ... + TRANSFORM_TYPE_FIXED_FUNCTION: ClassVar[TransformType] = ... + TRANSFORM_TYPE_GRADING_PRIMARY: ClassVar[TransformType] = ... + TRANSFORM_TYPE_GRADING_RGB_CURVE: ClassVar[TransformType] = ... + TRANSFORM_TYPE_GRADING_TONE: ClassVar[TransformType] = ... + TRANSFORM_TYPE_GROUP: ClassVar[TransformType] = ... + TRANSFORM_TYPE_LOG: ClassVar[TransformType] = ... + TRANSFORM_TYPE_LOG_AFFINE: ClassVar[TransformType] = ... + TRANSFORM_TYPE_LOG_CAMERA: ClassVar[TransformType] = ... + TRANSFORM_TYPE_LOOK: ClassVar[TransformType] = ... + TRANSFORM_TYPE_LUT1D: ClassVar[TransformType] = ... + TRANSFORM_TYPE_LUT3D: ClassVar[TransformType] = ... + TRANSFORM_TYPE_MATRIX: ClassVar[TransformType] = ... + TRANSFORM_TYPE_RANGE: ClassVar[TransformType] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class UniformDataType: + __members__: ClassVar[dict] = ... # read-only + UNIFORM_BOOL: ClassVar[UniformDataType] = ... + UNIFORM_DOUBLE: ClassVar[UniformDataType] = ... + UNIFORM_FLOAT3: ClassVar[UniformDataType] = ... + UNIFORM_UNKNOWN: ClassVar[UniformDataType] = ... + UNIFORM_VECTOR_FLOAT: ClassVar[UniformDataType] = ... + UNIFORM_VECTOR_INT: ClassVar[UniformDataType] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class ViewTransform: + class ViewTransformCategoryIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> ViewTransform.ViewTransformCategoryIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + @overload + def __init__(self, referenceSpace: ReferenceSpaceType) -> None: ... + @overload + def __init__(self, referenceSpace: ReferenceSpaceType = ..., name: str = ..., family: str = ..., description: str = ..., toReference: Transform = ..., fromReference: Transform = ..., categories: Iterable[str] = ...) -> None: ... + def addCategory(self, category: str) -> None: ... + def clearCategories(self) -> None: ... + def getCategories(self) -> ViewTransform.ViewTransformCategoryIterator: ... + def getDescription(self) -> str: ... + def getFamily(self) -> str: ... + def getName(self) -> str: ... + def getReferenceSpaceType(self) -> ReferenceSpaceType: ... + def getTransform(self, direction: ViewTransformDirection) -> Transform: ... + def hasCategory(self, category: str) -> bool: ... + def removeCategory(self, category: str) -> None: ... + def setDescription(self, description: str) -> None: ... + def setFamily(self, family: str) -> None: ... + def setName(self, name: str) -> None: ... + def setTransform(self, transform: Transform, direction: ViewTransformDirection) -> None: ... + def __deepcopy__(self, memo: dict) -> ViewTransform: ... + +class ViewTransformDirection: + __members__: ClassVar[dict] = ... # read-only + VIEWTRANSFORM_DIR_FROM_REFERENCE: ClassVar[ViewTransformDirection] = ... + VIEWTRANSFORM_DIR_TO_REFERENCE: ClassVar[ViewTransformDirection] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class ViewType: + __members__: ClassVar[dict] = ... # read-only + VIEW_DISPLAY_DEFINED: ClassVar[ViewType] = ... + VIEW_SHARED: ClassVar[ViewType] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class ViewingRules: + class ViewingRuleColorSpaceIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> ViewingRules.ViewingRuleColorSpaceIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + + class ViewingRuleEncodingIterator: + def __init__(self, *args, **kwargs) -> None: ... + def __getitem__(self, arg0: int, /) -> str: ... + def __iter__(self) -> ViewingRules.ViewingRuleEncodingIterator: ... + def __len__(self) -> int: ... + def __next__(self) -> str: ... + def __init__(self) -> None: ... + def addColorSpace(self, ruleIndex: int, colorSpaceName: str) -> None: ... + def addEncoding(self, ruleIndex: int, encodingName: str) -> None: ... + def getColorSpaces(self, ruleIndex: int) -> ViewingRules.ViewingRuleColorSpaceIterator: ... + def getCustomKeyName(self, ruleIndex: int, key: int) -> str: ... + def getCustomKeyValue(self, ruleIndex: int, key: int) -> str: ... + def getEncodings(self, ruleIndex: int) -> ViewingRules.ViewingRuleEncodingIterator: ... + def getIndexForRule(self, ruleName: str) -> int: ... + def getName(self, ruleIndex: int) -> str: ... + def getNumCustomKeys(self, ruleIndex: int) -> int: ... + def getNumEntries(self) -> int: ... + def insertRule(self, ruleIndex: int, name: str) -> None: ... + def removeColorSpace(self, ruleIndex: int, colorSpaceIndex: int) -> None: ... + def removeEncoding(self, ruleIndex: int, encodingIndex: int) -> None: ... + def removeRule(self, ruleIndex: int) -> None: ... + def setCustomKey(self, ruleIndex: int, key: str, value: str) -> None: ... + def __deepcopy__(self, memo: dict) -> ViewingRules: ... + +class vector_of_uint8_t: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, arg0: vector_of_uint8_t, /) -> None: ... + @overload + def __init__(self, arg0: Iterable, /) -> None: ... + def append(self, x: int) -> None: ... + def clear(self) -> None: ... + def count(self, x: int) -> int: ... + @overload + def extend(self, L: vector_of_uint8_t) -> None: ... + @overload + def extend(self, L: Iterable) -> None: ... + def insert(self, i: int, x: int) -> None: ... + @overload + def pop(self) -> int: ... + @overload + def pop(self, i: int) -> int: ... + def remove(self, x: int) -> None: ... + def __bool__(self) -> bool: ... + def __contains__(self, x: int) -> bool: ... + @overload + def __delitem__(self, arg0: int, /) -> None: ... + @overload + def __delitem__(self, arg0: slice, /) -> None: ... + def __eq__(self, other: object) -> bool: ... + @overload + def __getitem__(self, s: slice) -> vector_of_uint8_t: ... + @overload + def __getitem__(self, arg0: int, /) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __len__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @overload + def __setitem__(self, arg0: int, arg1: int, /) -> None: ... + @overload + def __setitem__(self, arg0: slice, arg1: vector_of_uint8_t, /) -> None: ... + +def AllocationFromString(str: str) -> Allocation: ... +def AllocationToString(allocation: Allocation) -> str: ... +def BitDepthFromString(str: str) -> BitDepth: ... +def BitDepthIsFloat(bitDepth: BitDepth) -> bool: ... +def BitDepthToInt(bitDepth: BitDepth) -> int: ... +def BitDepthToString(bitDepth: BitDepth) -> str: ... +def BoolFromString(str: str) -> bool: ... +def BoolToString(value: bool) -> str: ... +def CDLStyleFromString(str: str) -> CDLStyle: ... +def CDLStyleToString(style: CDLStyle) -> str: ... +def ClearAllCaches() -> None: ... +def CombineTransformDirections(direction1: TransformDirection, direction2: TransformDirection) -> TransformDirection: ... +def EnvironmentModeFromString(str: str) -> EnvironmentMode: ... +def EnvironmentModeToString(mode: EnvironmentMode) -> str: ... +def ExposureContrastStyleFromString(str: str) -> ExposureContrastStyle: ... +def ExposureContrastStyleToString(style: ExposureContrastStyle) -> str: ... +def ExtractOCIOZArchive(arg0: str, arg1: str, /) -> None: ... +def FixedFunctionStyleFromString(str: str) -> FixedFunctionStyle: ... +def FixedFunctionStyleToString(style: FixedFunctionStyle) -> str: ... +def GetCurrentConfig() -> Config: ... +def GetEnvVariable(name: str) -> str: ... +def GetInverseTransformDirection(direction: TransformDirection) -> TransformDirection: ... +def GetLoggingLevel() -> LoggingLevel: ... +def GetVersion() -> str: ... +def GetVersionHex() -> int: ... +def GpuLanguageFromString(str: str) -> GpuLanguage: ... +def GpuLanguageToString(language: GpuLanguage) -> str: ... +def GradingStyleFromString(str: str) -> GradingStyle: ... +def GradingStyleToString(style: GradingStyle) -> str: ... +def InterpolationFromString(str: str) -> Interpolation: ... +def InterpolationToString(interpolation: Interpolation) -> str: ... +def IsEnvVariablePresent(name: str) -> bool: ... +def LogMessage(level: LoggingLevel, message: str) -> None: ... +def LoggingLevelFromString(str: str) -> LoggingLevel: ... +def LoggingLevelToString(level: LoggingLevel) -> str: ... +def NegativeStyleFromString(str: str) -> NegativeStyle: ... +def NegativeStyleToString(style: NegativeStyle) -> str: ... +def RangeStyleFromString(str: str) -> RangeStyle: ... +def RangeStyleToString(style: RangeStyle) -> str: ... +def ResetComputeHashFunction() -> None: ... +def ResetToDefaultLoggingFunction() -> None: ... +def ResolveConfigPath(arg0: str, /) -> str: ... +def SetComputeHashFunction(hashFunction: Callable[[str], str]) -> None: ... +def SetCurrentConfig(config: Config) -> None: ... +def SetEnvVariable(name: str, value: str) -> None: ... +def SetLoggingFunction(logFunction: Callable[[str], None]) -> None: ... +def SetLoggingLevel(level: LoggingLevel) -> None: ... +def TransformDirectionFromString(str: str) -> TransformDirection: ... +def TransformDirectionToString(direction: TransformDirection) -> str: ... +def UnsetEnvVariable(name: str) -> None: ... diff --git a/tests/python/__init__.py b/src/bindings/python/stubs/PyOpenColorIO/py.typed similarity index 100% rename from tests/python/__init__.py rename to src/bindings/python/stubs/PyOpenColorIO/py.typed diff --git a/src/bindings/python/stubs/generate_stubs.py b/src/bindings/python/stubs/generate_stubs.py new file mode 100644 index 000000000..793367a76 --- /dev/null +++ b/src/bindings/python/stubs/generate_stubs.py @@ -0,0 +1,185 @@ +""" +Script to generate pyi stubs by patching and calling mypy's stubgen tool. + +There are two entry-points which are designed to call this script: + - `cmake --build . --target pystubs` is called during local development to generate the + stubs and copy them into the git repo to be committed and reviewed. + - in CI, the cibuildwheel action is used to validate that the stubs match what + has been committed to the repo. + +The depdendencies for the script are defined in pyproject.toml. +""" + +from __future__ import absolute_import, annotations, division, print_function + +import re + +from typing import Any + +import mypy.stubgen +import mypy.stubgenc +from mypy.stubgenc import DocstringSignatureGenerator, SignatureGenerator + +from stubgenlib.siggen import ( + AdvancedSignatureGenerator, + AdvancedSigMatcher, +) +from stubgenlib.utils import add_positional_only_args + + +class OCIOSignatureGenerator(AdvancedSignatureGenerator): + sig_matcher = AdvancedSigMatcher( + # Override entire function signature: + signature_overrides={ + # signatures for these special methods include many inaccurate overloads + "*.__ne__": "(self, other: object) -> bool", + "*.__eq__": "(self, other: object) -> bool", + }, + # Override argument types + # dict of (name_pattern, arg, type) to arg_type + # type can be str | re.Pattern + arg_type_overrides={ + ("*", "*", re.compile(r"list\[(.*)]")): r"Iterable[\1]", + }, + # Override result types + # dict of (name_pattern, type) to result_type + # e.g. ("*", "Buffer"): "numpy.ndarray" + result_type_overrides={}, + # Override property types + # dict of (name_pattern, type) to result_type + # e.g. ("*", "Buffer"): "numpy.ndarray" + property_type_overrides={}, + # Types that have implicit alternatives. + # dict of type_str to list of types that can be used instead + # e.g. "PySide2.QtGui.QKeySequence": ["str"], + # converts any matching argument to a union of the supported types + implicit_arg_types={}, + ) + + def process_sig( + self, ctx: mypy.stubgen.FunctionContext, sig: mypy.stubgen.FunctionSig + ) -> mypy.stubgen.FunctionSig: + # Analyze the signature and add a '/' argument if necessary to mark + # arguments which cannot be access by name. + return add_positional_only_args(ctx, super().process_sig(ctx, sig)) + + +class InspectionStubGenerator(mypy.stubgenc.InspectionStubGenerator): + def get_sig_generators(self) -> list[SignatureGenerator]: + return [ + OCIOSignatureGenerator( + fallback_sig_gen=DocstringSignatureGenerator(), + ) + ] + + def set_defined_names(self, defined_names: set[str]) -> None: + super().set_defined_names(defined_names) + for typ in ["Buffer"]: + self.add_name(f"typing_extensions.{typ}", require=False) + + def get_base_types(self, obj: type) -> list[str]: + bases = super().get_base_types(obj) + if obj.__name__ == "Exception": + return ["__builtins__.Exception"] + else: + return bases + + +mypy.stubgen.InspectionStubGenerator = InspectionStubGenerator # type: ignore[attr-defined,misc] +mypy.stubgenc.InspectionStubGenerator = InspectionStubGenerator # type: ignore[misc] + + +def get_colored_diff(old_text: str, new_text: str): + """ + Generates a colored diff between two strings. + + Returns: + A string containing the colored diff output. + """ + import difflib + + red = '\033[31m' + green = '\033[32m' + reset = '\033[0m' + + diff = difflib.unified_diff( + old_text.splitlines(keepends=True), + new_text.splitlines(keepends=True), + lineterm="", + ) + lines = [] + for line in diff: + if line.startswith('-'): + lines.append(f"{red}{line}{reset}") + elif line.startswith('+'): + lines.append(f"{green}{line}{reset}") + else: + lines.append(line) + return "".join(lines) + + +def main() -> None: + import argparse + import pathlib + import os + import sys + + parser = argparse.ArgumentParser() + parser.add_argument( + "--out-path", + help="Directory to write the stubs." + ) + parser.add_argument( + "--validate-path", + default=None, + help="If provided, compare the generated stub to this file. Exits with code 2 if the " + "contents differ." + ) + args = parser.parse_args() + if not args.out_path: + out_path = pathlib.Path(sys.modules[__name__].__file__).parent + else: + out_path = pathlib.Path(args.out_path) + print(f"Stub output directory: {out_path}") + + # perform import so we can see the traceback if it fails. + import PyOpenColorIO + + sys.argv[1:] = ["-p", "PyOpenColorIO", "-o", str(out_path)] + mypy.stubgen.main() + source_path = out_path.joinpath("PyOpenColorIO", "PyOpenColorIO.pyi") + if not source_path.exists(): + print("Stub generation failed") + sys.exit(1) + + dest_path = out_path.joinpath("PyOpenColorIO", "__init__.pyi") + print(f"Renaming to {dest_path}") + os.rename(source_path, dest_path) + + new_text = dest_path.read_text() + new_text = ( + "#\n# This file is auto-generated. DO NOT MODIFY!\n" + "# See docs/quick_start/installation.rst for more info\n#\n\n" + ) + new_text + dest_path.write_text(new_text) + + if args.validate_path and os.environ.get("GITHUB_ACTIONS", "false").lower() == "true": + # in CI, validate that what has been committed to the repo is what we expect. + validate_path = pathlib.Path(args.validate_path) + + print("Validating stubs against repository") + print(f"Comparing {dest_path} to {validate_path}") + + old_text = validate_path.read_text() + + if old_text != new_text: + print("Stub verification failed!") + print("Changes to the source code have resulted in a change to the stubs.") + print(get_colored_diff(old_text, new_text)) + print("Run `cmake /path/to/source; cmake --build . --target pystubs` locally and " + "commit the results for review.") + sys.exit(2) + + +if __name__ == "__main__": + main() diff --git a/src/bindings/python/stubs/generate_stubs_local.py b/src/bindings/python/stubs/generate_stubs_local.py new file mode 100644 index 000000000..72d1cfe95 --- /dev/null +++ b/src/bindings/python/stubs/generate_stubs_local.py @@ -0,0 +1,66 @@ +""" +Script that is called when buildling the stubs during local development, via +`make pystubs` or `cmake --target pystubs`. +""" + +import platform + +import argparse +import subprocess +import sys + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--repo-root") + parser.add_argument("--output-dir") + parser.add_argument("--python-version") + parser.add_argument("--cibuildwheel-version") + + args = parser.parse_args() + + version_major, version_minor = args.python_version.split(".") + + # detect the platform so that we can avoid running docker under emulation, which + # can result in the build process hanging. + if platform.system() == "Darwin": + # On Mac, `uname -m`, $CMAKE_HOST_SYSTEM_PROCESSOR, and platform.machine() returns + # x86_64 even on arm64 processors (i.e. Apple Silicon) if cmake or python is running under + # emulation (Rosetta). sysctl.proc_translated tells us if we're under emulation. + arch = subprocess.check_output(["uname", "-m"], text=True).strip() + if arch == "x86_64": + using_emulation = subprocess.check_output( + ["sysctl", "-in", "sysctl.proc_translated"], text=True + ).strip() + if using_emulation == "1": + arch = "arm64" + else: + arch = platform.machine() + if arch == "arm64": + arch = "aarch64" + python_build_id = f"cp{version_major}{version_minor}-manylinux_{arch}" + print(f"Building {python_build_id}") + + try: + subprocess.check_call( + [ + "uv", + "tool", + "run", + f"--python={sys.executable}", + f"cibuildwheel@{args.cibuildwheel_version}", + f"--output-dir={args.output_dir}", + f"--only={python_build_id}", + ".", + ], + cwd=args.repo_root, + ) + except FileNotFoundError: + print( + "\nERROR: You must install uv to build the stubs. See https://docs.astral.sh/uv/\n" + ) + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/tests/python/AllocationTransformTest.py b/tests/python/AllocationTransformTest.py index 5cb954fae..d05038624 100644 --- a/tests/python/AllocationTransformTest.py +++ b/tests/python/AllocationTransformTest.py @@ -13,7 +13,7 @@ class AllocationTransformTest(unittest.TestCase, TransformsBaseTest): TEST_DIRECTION = OCIO.TRANSFORM_DIR_INVERSE def setUp(self): - self.tr = OCIO.AllocationTransform() + self.tr: OCIO.AllocationTransform = OCIO.AllocationTransform() def test_transform_type(self): """ @@ -37,7 +37,7 @@ def test_allocation(self): # Wrong type tests. for invalid in (None, 1): with self.assertRaises(TypeError): - self.tr.setAllocation(invalid) + self.tr.setAllocation(invalid) # type: ignore def test_vars(self): """ @@ -64,7 +64,7 @@ def test_vars(self): # Wrong type tests. for invalid in (None, 'hello'): with self.assertRaises(TypeError): - self.tr.setVars(invalid) + self.tr.setVars(invalid) # type: ignore def test_constructor_with_keyword(self): """ @@ -112,4 +112,4 @@ def test_constructor_wrong_parameter_type(self): for invalid in (None, 1): with self.assertRaises(TypeError): - allo_tr = OCIO.AllocationTransform(invalid) + allo_tr = OCIO.AllocationTransform(invalid) # type: ignore diff --git a/tests/python/BuiltinConfigRegistryTest.py b/tests/python/BuiltinConfigRegistryTest.py index e715721ff..e2eddd7e2 100644 --- a/tests/python/BuiltinConfigRegistryTest.py +++ b/tests/python/BuiltinConfigRegistryTest.py @@ -15,7 +15,7 @@ class BuiltinConfigRegistryTest(unittest.TestCase): # BuiltinRegistry singleton. - REGISTRY = None + REGISTRY: OCIO.BuiltinConfigRegistry @classmethod def setUpClass(cls): diff --git a/tests/python/BuiltinTransformRegistryTest.py b/tests/python/BuiltinTransformRegistryTest.py index fbcd54345..123c91d5a 100644 --- a/tests/python/BuiltinTransformRegistryTest.py +++ b/tests/python/BuiltinTransformRegistryTest.py @@ -5,7 +5,7 @@ from collections.abc import Iterable except ImportError: # Python 2 - from collections import Iterable + from collections import Iterable # type: ignore import unittest @@ -15,7 +15,7 @@ class BuiltinTransformRegistryTest(unittest.TestCase): # BuiltinTransformRegistry singleton - REGISTRY = None + REGISTRY: OCIO.BuiltinTransformRegistry @classmethod def setUpClass(cls): diff --git a/tests/python/BuiltinTransformTest.py b/tests/python/BuiltinTransformTest.py index e086ade0e..1a361b315 100644 --- a/tests/python/BuiltinTransformTest.py +++ b/tests/python/BuiltinTransformTest.py @@ -9,7 +9,7 @@ class BuiltinTransformTest(unittest.TestCase, TransformsBaseTest): # BuiltinTransformRegistry singleton - REGISTRY = None + REGISTRY: OCIO.BuiltinTransformRegistry # Default values DEFAULT_STYLE = 'IDENTITY' @@ -27,7 +27,7 @@ def setUpClass(cls): cls.REGISTRY = OCIO.BuiltinTransformRegistry() def setUp(self): - self.tr = OCIO.BuiltinTransform() + self.tr: OCIO.BuiltinTransform = OCIO.BuiltinTransform() def test_transform_type(self): # TransformType is correct @@ -52,7 +52,7 @@ def test_style(self): # Safe invalid type handling for invalid in (None, 1, True): with self.assertRaises(TypeError): - self.tr.setStyle(invalid) + self.tr.setStyle(invalid) # type: ignore def test_constructor_keyword(self): # Keyword args in order diff --git a/tests/python/CDLTransformTest.py b/tests/python/CDLTransformTest.py index 8c03f333e..900e7f6b9 100644 --- a/tests/python/CDLTransformTest.py +++ b/tests/python/CDLTransformTest.py @@ -25,7 +25,7 @@ class CDLTransformTest(unittest.TestCase, TransformsBaseTest): TEST_CDL_SAT = 6 def setUp(self): - self.tr = OCIO.CDLTransform() + self.tr: OCIO.CDLTransform = OCIO.CDLTransform() def test_transform_type(self): """ diff --git a/tests/python/CPUProcessorTest.py b/tests/python/CPUProcessorTest.py index 4fc5e3c15..36047a341 100644 --- a/tests/python/CPUProcessorTest.py +++ b/tests/python/CPUProcessorTest.py @@ -1,6 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright Contributors to the OpenColorIO Project. +from __future__ import annotations + import logging import unittest @@ -22,6 +24,47 @@ class CPUProcessorTest(unittest.TestCase): FLOAT_DELTA = 1e+5 UINT_DELTA = 1 + default_cpu_proc_fwd: OCIO.CPUProcessor + default_cpu_proc_inv: OCIO.CPUProcessor + half_cpu_proc_fwd: OCIO.CPUProcessor + half_cpu_proc_inv: OCIO.CPUProcessor + uint16_cpu_proc_fwd: OCIO.CPUProcessor + uint16_cpu_proc_inv: OCIO.CPUProcessor + uint8_cpu_proc_fwd: OCIO.CPUProcessor + uint8_cpu_proc_inv: OCIO.CPUProcessor + config: OCIO.Config + proc_fwd: OCIO.Processor + proc_inv: OCIO.Processor + float_rgb_list: list[float] + float_rgba_list: list[float] + float_rgb_1d: np.ndarray + float_rgb_2d: np.ndarray + float_rgb_3d: np.ndarray + float_rgba_1d: np.ndarray + float_rgba_2d: np.ndarray + float_rgba_3d: np.ndarray + + half_rgb_1d: np.ndarray + half_rgb_2d: np.ndarray + half_rgb_3d: np.ndarray + half_rgba_1d: np.ndarray + half_rgba_2d: np.ndarray + half_rgba_3d: np.ndarray + + uint8_rgb_1d: np.ndarray + uint8_rgb_2d: np.ndarray + uint8_rgb_3d: np.ndarray + uint8_rgba_1d: np.ndarray + uint8_rgba_2d: np.ndarray + uint8_rgba_3d: np.ndarray + + uint16_rgb_1d: np.ndarray + uint16_rgb_2d: np.ndarray + uint16_rgb_3d: np.ndarray + uint16_rgba_1d: np.ndarray + uint16_rgba_2d: np.ndarray + uint16_rgba_3d: np.ndarray + @classmethod def setUpClass(cls): # --------------------------------------------------------------------- diff --git a/tests/python/ColorSpaceHelpersTest.py b/tests/python/ColorSpaceHelpersTest.py index 131a78421..e1982e434 100644 --- a/tests/python/ColorSpaceHelpersTest.py +++ b/tests/python/ColorSpaceHelpersTest.py @@ -80,7 +80,7 @@ def test_menu_creation_colorspaces(self): # Parameters are needed. with self.assertRaises(TypeError): - OCIO.ColorSpaceMenuHelper(None) + OCIO.ColorSpaceMenuHelper(None) # type: ignore # Create with sample config. diff --git a/tests/python/ColorSpaceTest.py b/tests/python/ColorSpaceTest.py index 0860e7a3f..a3b26c6d7 100644 --- a/tests/python/ColorSpaceTest.py +++ b/tests/python/ColorSpaceTest.py @@ -21,8 +21,8 @@ def setUp(self): self.log_tr = OCIO.LogTransform(10) def tearDown(self): - self.colorspace = None - self.log_tr = None + self.colorspace = None # type: ignore + self.log_tr = None # type: ignore def test_copy(self): """ @@ -77,7 +77,7 @@ def test_allocation(self): # Wrong type tests (set to None.) with self.assertRaises(TypeError): - self.colorspace.setAllocation(None) + self.colorspace.setAllocation(None) # type: ignore def test_allocation_vars(self): """ @@ -101,7 +101,7 @@ def test_allocation_vars(self): wrong_alloc_vars = [['test'], 'test', 0.1, 1] for wrong_alloc_var in wrong_alloc_vars: with self.assertRaises(TypeError): - self.colorspace.setAllocationVars(wrong_alloc_var) + self.colorspace.setAllocationVars(wrong_alloc_var) # type: ignore def test_bitdepth(self): """ @@ -120,7 +120,7 @@ def test_bitdepth(self): # Wrong type tests (set to None.) with self.assertRaises(TypeError): - self.colorspace.setBitDepth(None) + self.colorspace.setBitDepth(None) # type: ignore def test_category(self): """ @@ -295,7 +295,7 @@ def test_data(self): wrong_is_datas = [['test'], 'test'] for wrong_is_data in wrong_is_datas: with self.assertRaises(TypeError): - self.colorspace.setIsData(wrong_is_data) + self.colorspace.setIsData(wrong_is_data) # type: ignore def test_description(self): """ diff --git a/tests/python/ColorSpaceTransformTest.py b/tests/python/ColorSpaceTransformTest.py index 334acfeef..549ffd32a 100644 --- a/tests/python/ColorSpaceTransformTest.py +++ b/tests/python/ColorSpaceTransformTest.py @@ -14,7 +14,7 @@ class ColorSpaceTransformTest(unittest.TestCase, TransformsBaseTest): TEST_DST = 'bar' def setUp(self): - self.tr = OCIO.ColorSpaceTransform() + self.tr: OCIO.ColorSpaceTransform = OCIO.ColorSpaceTransform() def test_transform_type(self): """ @@ -38,7 +38,7 @@ def test_src(self): # Wrong type tests. for invalid in (None, 1): with self.assertRaises(TypeError): - self.tr.setSrc(invalid) + self.tr.setSrc(invalid) # type: ignore def test_dst(self): """ @@ -55,7 +55,7 @@ def test_dst(self): # Wrong type tests. for invalid in (None, 1): with self.assertRaises(TypeError): - self.tr.setDst(invalid) + self.tr.setDst(invalid) # type: ignore def test_constructor_with_keyword(self): """ @@ -100,4 +100,4 @@ def test_constructor_wrong_parameter_type(self): for invalid in (None, 1): with self.assertRaises(TypeError): - cs_tr = OCIO.ColorSpaceTransform(invalid) + cs_tr = OCIO.ColorSpaceTransform(invalid) # type: ignore diff --git a/tests/python/ConfigTest.py b/tests/python/ConfigTest.py index f63ad15af..8040716c8 100644 --- a/tests/python/ConfigTest.py +++ b/tests/python/ConfigTest.py @@ -1387,7 +1387,7 @@ def setUp(self): SIMPLE_CONFIG_VIRTUAL_DISPLAY_ACTIVE_DISPLAY) def tearDown(self): - self.cfg_active_display = None + self.cfg_active_display = None # type: ignore def test_virtual_display_with_active_displays(self): """ diff --git a/tests/python/DisplayViewHelpersTest.py b/tests/python/DisplayViewHelpersTest.py index e57d7e8f1..4f78aac7b 100644 --- a/tests/python/DisplayViewHelpersTest.py +++ b/tests/python/DisplayViewHelpersTest.py @@ -14,7 +14,7 @@ def setUp(self): self.cfg = OCIO.Config().CreateFromStream(SAMPLE_CONFIG) def tearDown(self): - self.cfg = None + self.cfg = None # type: ignore def test_get_processor(self): """ @@ -205,7 +205,7 @@ def test_add_display_view(self): OCIO.DisplayViewHelpers.AddDisplayView(config = self.cfg, colorSpaceName = 'view_51', displayName = 'DISP_1', transformFilePath = filePath, - connectionColorSpaceName = 'lut_input_1') + connectionColorSpaceName = 'lut_input_1') # type: ignore # Connection CS does not exist. with self.assertRaises(OCIO.Exception): diff --git a/tests/python/DisplayViewTransformTest.py b/tests/python/DisplayViewTransformTest.py index eff94ae0a..b9cf20968 100644 --- a/tests/python/DisplayViewTransformTest.py +++ b/tests/python/DisplayViewTransformTest.py @@ -15,7 +15,7 @@ class DisplayViewTransformTest(unittest.TestCase, TransformsBaseTest): TEST_VIEW = ['view1', 'view2', 'film'] def setUp(self): - self.tr = OCIO.DisplayViewTransform() + self.tr: OCIO.DisplayViewTransform = OCIO.DisplayViewTransform() def test_transform_type(self): """ diff --git a/tests/python/ExponentTransformTest.py b/tests/python/ExponentTransformTest.py index 9ae436576..3fb6161f6 100644 --- a/tests/python/ExponentTransformTest.py +++ b/tests/python/ExponentTransformTest.py @@ -14,7 +14,7 @@ class ExponentTransformTest(unittest.TestCase, TransformsBaseTest): TEST_DIRECTION = OCIO.TRANSFORM_DIR_INVERSE def setUp(self): - self.tr = OCIO.ExponentTransform() + self.tr: OCIO.ExponentTransform = OCIO.ExponentTransform() def test_transform_type(self): """ diff --git a/tests/python/ExponentWithLinearTransformTest.py b/tests/python/ExponentWithLinearTransformTest.py index d8b55929d..10b0d0eab 100644 --- a/tests/python/ExponentWithLinearTransformTest.py +++ b/tests/python/ExponentWithLinearTransformTest.py @@ -15,7 +15,7 @@ class ExponentWithLinearTransformTest(unittest.TestCase, TransformsBaseTest): TEST_DIRECTION = OCIO.TRANSFORM_DIR_INVERSE def setUp(self): - self.tr = OCIO.ExponentWithLinearTransform() + self.tr: OCIO.ExponentWithLinearTransform = OCIO.ExponentWithLinearTransform() def test_transform_type(self): """ diff --git a/tests/python/ExposureContrastTransformTest.py b/tests/python/ExposureContrastTransformTest.py index 8d28aaac3..db2acf86a 100644 --- a/tests/python/ExposureContrastTransformTest.py +++ b/tests/python/ExposureContrastTransformTest.py @@ -22,7 +22,7 @@ class ExposureContrastTransformTest(unittest.TestCase, TransformsBaseTest): TEST_INVALIDS = (None, 'hello', [1, 2, 3]) def setUp(self): - self.tr = OCIO.ExposureContrastTransform() + self.tr: OCIO.ExposureContrastTransform = OCIO.ExposureContrastTransform() def test_transform_type(self): """ @@ -58,7 +58,7 @@ def test_exposure(self): # Wrong type tests. for invalid in self.TEST_INVALIDS: with self.assertRaises(TypeError): - self.tr.setExposure(invalid) + self.tr.setExposure(invalid) # type: ignore def test_exposure_dynamic(self): """ @@ -86,7 +86,7 @@ def test_contrast(self): # Wrong type tests. for invalid in self.TEST_INVALIDS: with self.assertRaises(TypeError): - self.tr.setContrast(invalid) + self.tr.setContrast(invalid) # type: ignore def test_contrast_dynamic(self): """ @@ -114,7 +114,7 @@ def test_gamma(self): # Wrong type tests. for invalid in self.TEST_INVALIDS: with self.assertRaises(TypeError): - self.tr.setGamma(invalid) + self.tr.setGamma(invalid) # type: ignore def test_gamma_dynamic(self): """ @@ -142,7 +142,7 @@ def test_pivot(self): # Wrong type tests. for invalid in self.TEST_INVALIDS: with self.assertRaises(TypeError): - self.tr.setPivot(invalid) + self.tr.setPivot(invalid) # type: ignore def test_log_exposure_step(self): """ @@ -159,7 +159,7 @@ def test_log_exposure_step(self): # Wrong type tests. for invalid in self.TEST_INVALIDS: with self.assertRaises(TypeError): - self.tr.setLogExposureStep(invalid) + self.tr.setLogExposureStep(invalid) # type: ignore def test_log_mid_gray(self): """ @@ -176,7 +176,7 @@ def test_log_mid_gray(self): # Wrong type tests. for invalid in self.TEST_INVALIDS: with self.assertRaises(TypeError): - self.tr.setLogMidGray(invalid) + self.tr.setLogMidGray(invalid) # type: ignore def test_format_metadata(self): """ @@ -297,4 +297,4 @@ def test_constructor_wrong_parameter_type(self): for invalid in (None, 1, self.TEST_ID): with self.assertRaises(TypeError): - exp_tr = OCIO.ExponentWithLinearTransform(invalid) + exp_tr = OCIO.ExponentWithLinearTransform(invalid) # type: ignore diff --git a/tests/python/FileRulesTest.py b/tests/python/FileRulesTest.py index 4dc6b9c50..3e4c92ad9 100644 --- a/tests/python/FileRulesTest.py +++ b/tests/python/FileRulesTest.py @@ -56,7 +56,7 @@ def test_name(self): rules.getName(4) with self.assertRaises(TypeError): - rules.getName('test') + rules.getName('test') # type: ignore def test_pattern(self): """ @@ -86,12 +86,12 @@ def test_pattern(self): # Wrong strings. for invalid in (None, '', '[]', '[a-b'): with self.assertRaises(OCIO.Exception): - rules.setPattern(0, invalid) + rules.setPattern(0, invalid) # type: ignore # Wrong types. for invalid in (OCIO.TRANSFORM_DIR_INVERSE, 1): with self.assertRaises(TypeError): - rules.setPattern(0, invalid) + rules.setPattern(0, invalid) # type: ignore def test_extension(self): """ @@ -119,12 +119,12 @@ def test_extension(self): # Wrong strings. for invalid in (None, '', '[]', 'jp[gG'): with self.assertRaises(OCIO.Exception): - rules.setExtension(0, invalid) + rules.setExtension(0, invalid) # type: ignore # Wrong types. for invalid in (OCIO.TRANSFORM_DIR_INVERSE, 1): with self.assertRaises(TypeError): - rules.setExtension(0, invalid) + rules.setExtension(0, invalid) # type: ignore def test_regex(self): """ @@ -158,12 +158,12 @@ def test_regex(self): # Wrong strings. for invalid in (None, '', '(.*)(\bwhat'): with self.assertRaises(OCIO.Exception): - rules.setRegex(0, invalid) + rules.setRegex(0, invalid) # type: ignore # Wrong types. for invalid in (OCIO.TRANSFORM_DIR_INVERSE, 1): with self.assertRaises(TypeError): - rules.setRegex(0, invalid) + rules.setRegex(0, invalid) # type: ignore def test_color_space(self): """ @@ -188,12 +188,12 @@ def test_color_space(self): # Wrong strings. for invalid in (None, ''): with self.assertRaises(OCIO.Exception): - rules.setColorSpace(0, invalid) + rules.setColorSpace(0, invalid) # type: ignore # Wrong types. for invalid in (OCIO.TRANSFORM_DIR_INVERSE, 1): with self.assertRaises(TypeError): - rules.setColorSpace(0, invalid) + rules.setColorSpace(0, invalid) # type: ignore def test_custom_keys(self): """ diff --git a/tests/python/FileTransformTest.py b/tests/python/FileTransformTest.py index 31c51cdd0..d88c2978f 100644 --- a/tests/python/FileTransformTest.py +++ b/tests/python/FileTransformTest.py @@ -41,7 +41,7 @@ class FileTransformTest(unittest.TestCase, TransformsBaseTest): ('nukevf', 'vf')] def setUp(self): - self.tr = OCIO.FileTransform() + self.tr: OCIO.FileTransform = OCIO.FileTransform() def test_transform_type(self): """ @@ -65,7 +65,7 @@ def test_cccid(self): # Wrong type tests. for invalid in (None, 1): with self.assertRaises(TypeError): - self.tr.setCCCId(invalid) + self.tr.setCCCId(invalid) # type: ignore def test_cdlstyle(self): """ @@ -83,7 +83,7 @@ def test_cdlstyle(self): # Wrong type tests. for invalid in (None, 1): with self.assertRaises(TypeError): - self.tr.setCDLStyle(invalid) + self.tr.setCDLStyle(invalid) # type: ignore def test_is_format_extension_supported(self): """ @@ -128,7 +128,7 @@ def test_interpolation(self): # Wrong type tests. for invalid in (None, 1): with self.assertRaises(TypeError): - self.tr.setInterpolation(invalid) + self.tr.setInterpolation(invalid) # type: ignore def test_src(self): """ @@ -145,7 +145,7 @@ def test_src(self): # Wrong type tests. for invalid in (None, 1): with self.assertRaises(TypeError): - self.tr.setSrc(invalid) + self.tr.setSrc(invalid) # type: ignore def test_constructor_with_keyword(self): """ diff --git a/tests/python/FixedFunctionTransformTest.py b/tests/python/FixedFunctionTransformTest.py index ce4868ae7..4757fc751 100644 --- a/tests/python/FixedFunctionTransformTest.py +++ b/tests/python/FixedFunctionTransformTest.py @@ -13,7 +13,7 @@ class FixedFunctionTransformTest(unittest.TestCase, TransformsBaseTest): TEST_DIRECTION = OCIO.TRANSFORM_DIR_INVERSE def setUp(self): - self.tr = OCIO.FixedFunctionTransform( + self.tr: OCIO.FixedFunctionTransform = OCIO.FixedFunctionTransform( OCIO.FIXED_FUNCTION_ACES_RED_MOD_03) def test_transform_type(self): @@ -199,4 +199,4 @@ def test_constructor_wrong_parameter_type(self): for invalid in (None, 1): with self.assertRaises(TypeError): - fixed_func_tr = OCIO.FixedFunctionTransform(invalid) + fixed_func_tr = OCIO.FixedFunctionTransform(invalid) # type: ignore diff --git a/tests/python/FormatMetadataTest.py b/tests/python/FormatMetadataTest.py index 34bd5412e..b18229a1c 100644 --- a/tests/python/FormatMetadataTest.py +++ b/tests/python/FormatMetadataTest.py @@ -119,11 +119,11 @@ def test_children(self): # Test invalid cases. Name and value have to be strings. with self.assertRaises(TypeError): - child3.addChildElement('string', 42) + child3.addChildElement('string', 42) # type: ignore with self.assertRaises(TypeError): - child3.addChildElement(42, 'string') + child3.addChildElement(42, 'string') # type: ignore with self.assertRaises(TypeError): - child3.addChildElement('name', None) + child3.addChildElement('name', None) # type: ignore def test_attributes(self): """ diff --git a/tests/python/GradingDataTest.py b/tests/python/GradingDataTest.py index b015e5370..ad9a2e983 100644 --- a/tests/python/GradingDataTest.py +++ b/tests/python/GradingDataTest.py @@ -58,10 +58,10 @@ def test_rgbm(self): self.assertEqual(0, rgbm3.red) with self.assertRaises(TypeError): - OCIO.GradingRGBM(0) + OCIO.GradingRGBM(0) # type: ignore with self.assertRaises(TypeError): - OCIO.GradingRGBM(0, 0) + OCIO.GradingRGBM(0, 0) # type: ignore # Constructor with named parameters. rgbm3 = OCIO.GradingRGBM(blue=1, green=2, master=3, red=4) @@ -72,7 +72,7 @@ def test_rgbm(self): # Constructor with named parameters, some missing. with self.assertRaises(TypeError): - OCIO.GradingRGBM(master=.3, red=.4) + OCIO.GradingRGBM(master=.3, red=.4) # type: ignore # Check comparison operators rgbm1 = OCIO.GradingRGBM() @@ -116,13 +116,13 @@ def test_primary(self): assertEqualPrimary(self, primaryLog, primaryVideo) with self.assertRaises(TypeError): - OCIO.GradingPrimary() + OCIO.GradingPrimary() # type: ignore with self.assertRaises(AttributeError): OCIO.GradingPrimary(OCIO.TRANSFOR_DIRECTION_FORWARD) with self.assertRaises(TypeError): - OCIO.GradingPrimary(0) + OCIO.GradingPrimary(0) # type: ignore newGamma = OCIO.GradingRGBM(1.1, 1.2, 1.3, 1) primaryLog.gamma = newGamma @@ -160,7 +160,7 @@ def test_bspline(self): # Create a similar bspline curve with alternate constructor. bs2 = OCIO.GradingBSplineCurve([0, 0, 0.1, 0.5, 0.4, 0.6, 0.6, 0.7, 1, 1]) - cpts2 = bs2.getControlPoints() + cpts0 = bs2.getControlPoints() assertEqualBSpline(self, bs, bs2) @@ -322,10 +322,10 @@ def test_rgbmsw(self): self.assertEqual(3, rgbm4.width) with self.assertRaises(TypeError): - OCIO.GradingRGBMSW(0) + OCIO.GradingRGBMSW(0) # type: ignore with self.assertRaises(TypeError): - OCIO.GradingRGBMSW(0, 0, 0) + OCIO.GradingRGBMSW(0, 0, 0) # type: ignore # Constructor with named parameters. rgbm5 = OCIO.GradingRGBMSW(blue=1, master=2, green=3, start=4, width=5, red=6) @@ -347,7 +347,7 @@ def test_rgbmsw(self): # Constructor with named parameters, some missing. with self.assertRaises(TypeError): - OCIO.GradingRGBMSW(green=3, start=4) + OCIO.GradingRGBMSW(green=3, start=4) # type: ignore # Check comparison operators rgbm1 = OCIO.GradingRGBMSW(1, 2, 3, 4, 5, 6) @@ -379,7 +379,7 @@ def test_tone(self): OCIO.GradingTone(OCIO.TRANSFOR_DIRECTION_FORWARD) with self.assertRaises(TypeError): - OCIO.GradingTone(0) + OCIO.GradingTone(0) # type: ignore newMidtones = OCIO.GradingRGBMSW(1.1, 1.2, 1.3, 1, 0.2, 1.1) tone.midtones = newMidtones diff --git a/tests/python/GroupTransformTest.py b/tests/python/GroupTransformTest.py index 0b4e47da6..c5e6932aa 100644 --- a/tests/python/GroupTransformTest.py +++ b/tests/python/GroupTransformTest.py @@ -11,7 +11,7 @@ class GroupTransformTest(unittest.TestCase, TransformsBaseTest): TEST_DIRECTION = OCIO.TRANSFORM_DIR_INVERSE def setUp(self): - self.tr = OCIO.GroupTransform() + self.tr: OCIO.GroupTransform = OCIO.GroupTransform() def test_transform_type(self): """ @@ -129,7 +129,7 @@ def test_constructor_wrong_parameter_type(self): for invalid in (None, 1): with self.assertRaises(TypeError): - group_tr = OCIO.FixedFunctionTransform(invalid) + group_tr = OCIO.FixedFunctionTransform(invalid) # type: ignore def test_write_clf(self): """ diff --git a/tests/python/LegacyViewingPipelineTest.py b/tests/python/LegacyViewingPipelineTest.py index 8b4e3ea5e..d2fc27290 100644 --- a/tests/python/LegacyViewingPipelineTest.py +++ b/tests/python/LegacyViewingPipelineTest.py @@ -22,11 +22,11 @@ def test_looks_override(self): pipeline.setLooksOverrideEnabled(None) self.assertFalse(pipeline.getLooksOverrideEnabled()) with self.assertRaises(TypeError): - pipeline.setLooksOverrideEnabled() + pipeline.setLooksOverrideEnabled() # type: ignore with self.assertRaises(TypeError): - pipeline.setLooksOverrideEnabled(OCIO.TRANSFORM_DIR_FORWARD) + pipeline.setLooksOverrideEnabled(OCIO.TRANSFORM_DIR_FORWARD) # type: ignore with self.assertRaises(TypeError): - pipeline.setLooksOverrideEnabled('no') + pipeline.setLooksOverrideEnabled('no') # type: ignore self.assertEqual(pipeline.getLooksOverride(), '') pipeline.setLooksOverride('test') @@ -34,13 +34,13 @@ def test_looks_override(self): pipeline.setLooksOverride('') self.assertEqual(pipeline.getLooksOverride(), '') with self.assertRaises(TypeError): - pipeline.setLooksOverride(None) + pipeline.setLooksOverride(None) # type: ignore with self.assertRaises(TypeError): - pipeline.setLooksOverride() + pipeline.setLooksOverride() # type: ignore with self.assertRaises(TypeError): - pipeline.setLooksOverride(OCIO.TRANSFORM_DIR_FORWARD) + pipeline.setLooksOverride(OCIO.TRANSFORM_DIR_FORWARD) # type: ignore with self.assertRaises(TypeError): - pipeline.setLooksOverride(False) + pipeline.setLooksOverride(False) # type: ignore def test_display_view_transform(self): """ @@ -55,11 +55,11 @@ def test_display_view_transform(self): self.assertEqual(pipeline.getDisplayViewTransform(), None) with self.assertRaises(TypeError): - pipeline.setDisplayViewTransform() + pipeline.setDisplayViewTransform() # type: ignore with self.assertRaises(TypeError): - pipeline.setDisplayViewTransform(OCIO.TRANSFORM_DIR_FORWARD) + pipeline.setDisplayViewTransform(OCIO.TRANSFORM_DIR_FORWARD) # type: ignore with self.assertRaises(TypeError): - pipeline.setDisplayViewTransform(False) + pipeline.setDisplayViewTransform(False) # type: ignore def test_linear_cc(self): """ @@ -78,11 +78,11 @@ def test_linear_cc(self): self.assertEqual(pipeline.getLinearCC(), None) with self.assertRaises(TypeError): - pipeline.setLinearCC() + pipeline.setLinearCC() # type: ignore with self.assertRaises(TypeError): - pipeline.setLinearCC(OCIO.TRANSFORM_DIR_FORWARD) + pipeline.setLinearCC(OCIO.TRANSFORM_DIR_FORWARD) # type: ignore with self.assertRaises(TypeError): - pipeline.setLinearCC(False) + pipeline.setLinearCC(False) # type: ignore def test_color_timing_cc(self): """ @@ -101,11 +101,11 @@ def test_color_timing_cc(self): self.assertEqual(pipeline.getColorTimingCC(), None) with self.assertRaises(TypeError): - pipeline.setColorTimingCC() + pipeline.setColorTimingCC() # type: ignore with self.assertRaises(TypeError): - pipeline.setColorTimingCC(OCIO.TRANSFORM_DIR_FORWARD) + pipeline.setColorTimingCC(OCIO.TRANSFORM_DIR_FORWARD) # type: ignore with self.assertRaises(TypeError): - pipeline.setColorTimingCC(False) + pipeline.setColorTimingCC(False) # type: ignore def test_channel_view(self): """ @@ -121,11 +121,11 @@ def test_channel_view(self): self.assertEqual(pipeline.getChannelView(), None) with self.assertRaises(TypeError): - pipeline.setChannelView() + pipeline.setChannelView() # type: ignore with self.assertRaises(TypeError): - pipeline.setChannelView(OCIO.TRANSFORM_DIR_FORWARD) + pipeline.setChannelView(OCIO.TRANSFORM_DIR_FORWARD) # type: ignore with self.assertRaises(TypeError): - pipeline.setChannelView(False) + pipeline.setChannelView(False) # type: ignore def test_display_cc(self): """ @@ -144,11 +144,11 @@ def test_display_cc(self): self.assertEqual(pipeline.getDisplayCC(), None) with self.assertRaises(TypeError): - pipeline.setDisplayCC() + pipeline.setDisplayCC() # type: ignore with self.assertRaises(TypeError): - pipeline.setDisplayCC(OCIO.TRANSFORM_DIR_FORWARD) + pipeline.setDisplayCC(OCIO.TRANSFORM_DIR_FORWARD) # type: ignore with self.assertRaises(TypeError): - pipeline.setDisplayCC(False) + pipeline.setDisplayCC(False) # type: ignore def test_get_processor_errors(self): """ diff --git a/tests/python/LogCameraTransformTest.py b/tests/python/LogCameraTransformTest.py index 5ef890d06..358223000 100644 --- a/tests/python/LogCameraTransformTest.py +++ b/tests/python/LogCameraTransformTest.py @@ -18,7 +18,7 @@ def test_constructor(self): # Required parameter missing. with self.assertRaises(TypeError): - OCIO.LogCameraTransform() + OCIO.LogCameraTransform() # type: ignore LIN_SB = [0.1, 0.2, 0.3] lct = OCIO.LogCameraTransform(LIN_SB) @@ -169,7 +169,7 @@ def test_direction(self): # Wrong type tests. for invalid in (None, 1, 'test'): with self.assertRaises(TypeError): - lct.setDirection(invalid) + lct.setDirection(invalid) # type: ignore def test_format_metadata(self): """ @@ -205,7 +205,7 @@ def test_base(self): # Wrong type tests. for invalid in (None, 'test'): with self.assertRaises(TypeError): - lct.setBase(invalid) + lct.setBase(invalid) # type: ignore def test_logSideSlope(self): """ diff --git a/tests/python/LogTransformTest.py b/tests/python/LogTransformTest.py index ed521a68c..187d5db1c 100644 --- a/tests/python/LogTransformTest.py +++ b/tests/python/LogTransformTest.py @@ -14,7 +14,7 @@ class LogTransformTest(unittest.TestCase, TransformsBaseTest): TEST_DIRECTION = OCIO.TRANSFORM_DIR_INVERSE def setUp(self): - self.tr = OCIO.LogTransform() + self.tr: OCIO.LogTransform = OCIO.LogTransform() def test_transform_type(self): """ @@ -37,7 +37,7 @@ def test_base(self): # Wrong type tests. for invalid in (None, 'test'): with self.assertRaises(TypeError): - self.tr.setBase(invalid) + self.tr.setBase(invalid) # type: ignore def test_format_metadata(self): """ @@ -111,4 +111,4 @@ def test_constructor_wrong_parameter_type(self): for invalid in (None, 'test'): with self.assertRaises(TypeError): - log_tr = OCIO.LogTransform(invalid) + log_tr = OCIO.LogTransform(invalid) # type: ignore diff --git a/tests/python/LookTest.py b/tests/python/LookTest.py index 16f6e3248..5cfaebc2c 100644 --- a/tests/python/LookTest.py +++ b/tests/python/LookTest.py @@ -18,7 +18,7 @@ def setUp(self): self.look = OCIO.Look() def tearDown(self): - self.look = None + self.look = None # type: ignore def test_copy(self): """ @@ -55,7 +55,7 @@ def test_name(self): # Wrong type tests. for invalid in (None, 1): with self.assertRaises(TypeError): - self.look.setName(invalid) + self.look.setName(invalid) # type: ignore def test_process_space(self): """ @@ -72,7 +72,7 @@ def test_process_space(self): # Wrong type tests. for invalid in (None, 1): with self.assertRaises(TypeError): - self.look.setProcessSpace(invalid) + self.look.setProcessSpace(invalid) # type: ignore def test_description(self): """ @@ -89,7 +89,7 @@ def test_description(self): # Wrong type tests. for invalid in (None, 1): with self.assertRaises(TypeError): - self.look.setDescription(invalid) + self.look.setDescription(invalid) # type: ignore def test_transform(self): """ @@ -108,7 +108,7 @@ def test_transform(self): # Wrong type tests. for invalid in (OCIO.ALLOCATION_UNIFORM, 1): with self.assertRaises(TypeError): - self.look.setTransform(invalid) + self.look.setTransform(invalid) # type: ignore def test_inverse_transform(self): """ @@ -128,7 +128,7 @@ def test_inverse_transform(self): # Wrong type tests. for invalid in (OCIO.ALLOCATION_UNIFORM, 1): with self.assertRaises(TypeError): - self.look.setInverseTransform(invalid) + self.look.setInverseTransform(invalid) # type: ignore def test_constructor_with_keyword(self): """ @@ -191,4 +191,4 @@ def test_constructor_wrong_parameter_type(self): for invalid in (None, 1): with self.assertRaises(TypeError): - look = OCIO.Look(invalid) + look = OCIO.Look(invalid) # type: ignore diff --git a/tests/python/LookTransformTest.py b/tests/python/LookTransformTest.py index 9a9d43666..9111a9e1e 100644 --- a/tests/python/LookTransformTest.py +++ b/tests/python/LookTransformTest.py @@ -10,7 +10,7 @@ class LookTransformTest(unittest.TestCase, TransformsBaseTest): def setUp(self): - self.tr = OCIO.LookTransform('src', 'dst') + self.tr: OCIO.LookTransform = OCIO.LookTransform('src', 'dst') def test_constructor(self): """ @@ -37,9 +37,9 @@ def test_constructor(self): self.assertEqual(lt.getDirection(), OCIO.TRANSFORM_DIR_INVERSE) with self.assertRaises(TypeError): - OCIO.LookTransform(src='src') + OCIO.LookTransform(src='src') # type: ignore with self.assertRaises(TypeError): - OCIO.LookTransform(dst='dst') + OCIO.LookTransform(dst='dst') # type: ignore with self.assertRaises(OCIO.Exception): OCIO.LookTransform(src='', dst='dst') with self.assertRaises(OCIO.Exception): @@ -55,7 +55,7 @@ def test_src(self): for invalid in (None, 1, [0, 0], [0, 0, 0, 0]): with self.assertRaises(TypeError): - self.tr.setSrc(invalid) + self.tr.setSrc(invalid) # type: ignore def test_dst(self): """ @@ -67,7 +67,7 @@ def test_dst(self): for invalid in (None, 1, [0, 0], [0, 0, 0, 0]): with self.assertRaises(TypeError): - self.tr.setDst(invalid) + self.tr.setDst(invalid) # type: ignore def test_looks(self): """ @@ -79,7 +79,7 @@ def test_looks(self): for invalid in (None, 1, [0, 0], [0, 0, 0, 0]): with self.assertRaises(TypeError): - self.tr.setLooks(invalid) + self.tr.setLooks(invalid) # type: ignore def test_skip_conversion(self): """ diff --git a/tests/python/Lut1DTransformTest.py b/tests/python/Lut1DTransformTest.py index 60f926c32..61cc1198e 100644 --- a/tests/python/Lut1DTransformTest.py +++ b/tests/python/Lut1DTransformTest.py @@ -22,7 +22,7 @@ class Lut1DTransformTest(unittest.TestCase, TransformsBaseTest): def setUp(self): - self.tr = OCIO.Lut1DTransform() + self.tr: OCIO.Lut1DTransform = OCIO.Lut1DTransform() def test_default_constructor(self): """ diff --git a/tests/python/Lut3DTransformTest.py b/tests/python/Lut3DTransformTest.py index 249ea6fcc..4203ab71c 100644 --- a/tests/python/Lut3DTransformTest.py +++ b/tests/python/Lut3DTransformTest.py @@ -22,7 +22,7 @@ class Lut3DTransformTest(unittest.TestCase, TransformsBaseTest): def setUp(self): - self.tr = OCIO.Lut3DTransform() + self.tr: OCIO.Lut3DTransform = OCIO.Lut3DTransform() def test_default_constructor(self): """ diff --git a/tests/python/MatrixTransformTest.py b/tests/python/MatrixTransformTest.py index e500b71c2..1ca090562 100644 --- a/tests/python/MatrixTransformTest.py +++ b/tests/python/MatrixTransformTest.py @@ -93,5 +93,5 @@ def test_direction(self): # Wrong type tests. for invalid in (None, 1, 'test'): with self.assertRaises(TypeError): - mt.setDirection(invalid) + mt.setDirection(invalid) # type: ignore diff --git a/tests/python/MixingHelpersTest.py b/tests/python/MixingHelpersTest.py index 7eda05d61..5b98f68bd 100644 --- a/tests/python/MixingHelpersTest.py +++ b/tests/python/MixingHelpersTest.py @@ -18,7 +18,7 @@ def setUp(self): self.cfg = OCIO.Config().CreateFromStream(SAMPLE_CONFIG) def tearDown(self): - self.cfg = None + self.cfg = None # type: ignore def test_encoding(self): """ @@ -42,11 +42,11 @@ def test_encoding(self): for param in [None, 1, OCIO.TRANSFORM_DIR_FORWARD]: with self.assertRaises(TypeError): - mix.setSelectedMixingEncoding(param) + mix.setSelectedMixingEncoding(param) # type: ignore for param in [None, 'test']: with self.assertRaises(TypeError): - mix.setSelectedMixingEncodingIdx(param) + mix.setSelectedMixingEncodingIdx(param) # type: ignore # Print the MixingColorSpaceManager. self.assertEqual(str(mix), @@ -78,11 +78,11 @@ def test_mixing_space(self): for param in [None, 1, OCIO.TRANSFORM_DIR_FORWARD]: with self.assertRaises(TypeError): - mix.setSelectedMixingSpace(param) + mix.setSelectedMixingSpace(param) # type: ignore for param in [None, 'test']: with self.assertRaises(TypeError): - mix.setSelectedMixingSpaceIdx(param) + mix.setSelectedMixingSpaceIdx(param) # type: ignore mix = None @@ -154,24 +154,24 @@ def test_get_processor(self): self.assertEqual(t.getStyle(), OCIO.FIXED_FUNCTION_RGB_TO_HSV) with self.assertRaises(TypeError): - proc = mix.getProcessor('lin_1', None, 'VIEW_1') + proc = mix.getProcessor('lin_1', None, 'VIEW_1') # type: ignore with self.assertRaises(TypeError): - proc = mix.getProcessor(workingSpaceName = 'lin_1', displayName = 666, viewName = 'VIEW_1') + proc = mix.getProcessor(workingSpaceName = 'lin_1', displayName = 666, viewName = 'VIEW_1') # type: ignore with self.assertRaises(TypeError): proc = mix.getProcessor(workingSpaceName = 'lin_1', displayName = 'DISP_1', - viewName = OCIO.TRANSFORM_TYPE_LOG) + viewName = OCIO.TRANSFORM_TYPE_LOG) # type: ignore with self.assertRaises(TypeError): - proc = mix.getProcessor(workingSpaceName = 'lin_1', displayName = 'DISP_1') + proc = mix.getProcessor(workingSpaceName = 'lin_1', displayName = 'DISP_1') # type: ignore with self.assertRaises(TypeError): - proc = mix.getProcessor(workingSpaceName = 'lin_1', displayName = 'DISP_1', + proc = mix.getProcessor(workingSpaceName = 'lin_1', displayName = 'DISP_1', # type: ignore errorName = 'VIEW_1') with self.assertRaises(TypeError): - proc = mix.getProcessor(workingSpaceName = 'lin_1', displayName = 'DISP_1', + proc = mix.getProcessor(workingSpaceName = 'lin_1', displayName = 'DISP_1', # type: ignore viewName = 'VIEW_1', tooMany = True) with self.assertRaises(OCIO.Exception): diff --git a/tests/python/NamedTransformTest.py b/tests/python/NamedTransformTest.py index abeb57796..c9e894ded 100644 --- a/tests/python/NamedTransformTest.py +++ b/tests/python/NamedTransformTest.py @@ -106,7 +106,7 @@ def test_name(self): # Wrong type tests. for invalid in self.TEST_INVALIDS: with self.assertRaises(TypeError): - self.named_tr.setName(invalid) + self.named_tr.setName(invalid) # type: ignore def test_family(self): """ @@ -122,7 +122,7 @@ def test_family(self): # Wrong type tests. for invalid in self.TEST_INVALIDS: with self.assertRaises(TypeError): - self.named_tr.setFamily(invalid) + self.named_tr.setFamily(invalid) # type: ignore def test_description(self): """ @@ -138,7 +138,7 @@ def test_description(self): # Wrong type tests. for invalid in self.TEST_INVALIDS: with self.assertRaises(TypeError): - self.named_tr.setDescription(invalid) + self.named_tr.setDescription(invalid) # type: ignore def test_transform(self): """ @@ -161,7 +161,7 @@ def test_transform(self): # Wrong type tests. for invalid in self.TEST_INVALIDS: with self.assertRaises(TypeError): - self.named_tr.setTransform(invalid, OCIO.TRANSFORM_DIR_FORWARD) + self.named_tr.setTransform(invalid, OCIO.TRANSFORM_DIR_FORWARD) # type: ignore def test_constructor_with_keywords(self): @@ -254,7 +254,7 @@ def test_constructor_wrong_parameter_type(self): for invalid in self.TEST_INVALIDS: with self.assertRaises(TypeError): - named_tr = OCIO.NamedTransform(invalid) + named_tr = OCIO.NamedTransform(invalid) # type: ignore def test_static_get_transform(self): """ diff --git a/tests/python/OCIOZArchiveTest.py b/tests/python/OCIOZArchiveTest.py index b649badc9..8a38d8cb5 100644 --- a/tests/python/OCIOZArchiveTest.py +++ b/tests/python/OCIOZArchiveTest.py @@ -29,7 +29,7 @@ def setUp(self): self.CONFIG.validate() def tearDown(self): - self.CONFIG = None + self.CONFIG = None # type: ignore def test_is_archivable(self): """ @@ -192,8 +192,8 @@ def setUp(self): self.CONTEXT = ctx def tearDown(self): - self.CONFIG = None - self.CONTEXT = None + self.CONFIG = None # type: ignore + self.CONTEXT = None # type: ignore def test_search_paths(self): """ diff --git a/tests/python/UnitTestUtils.py b/tests/python/UnitTestUtils.py index dd4158654..3c3d69031 100644 --- a/tests/python/UnitTestUtils.py +++ b/tests/python/UnitTestUtils.py @@ -84,12 +84,12 @@ def __exit__(self, exc_type, exc_val, exc_tb): if sys.version_info.major >= 3: STRING_TYPES = str else: # Python 2 - STRING_TYPES = basestring + STRING_TYPES = basestring # type: ignore # ----------------------------------------------------------------------------- # Test data # ----------------------------------------------------------------------------- -TEST_DATAFILES_DIR = os.getenv('TEST_DATAFILES_DIR') +TEST_DATAFILES_DIR: str = os.getenv('TEST_DATAFILES_DIR') # type: ignore TEST_NAMES = ['default_name', 'HelloWorld', 'Simple Colourspace', 'a1b2c3d4', 'RGBA.1&2*3#']