_imagingcms.pyi 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. import datetime
  2. import sys
  3. from typing import Literal, SupportsFloat, TypedDict
  4. from ._typing import CapsuleType
  5. littlecms_version: str | None
  6. _Tuple3f = tuple[float, float, float]
  7. _Tuple2x3f = tuple[_Tuple3f, _Tuple3f]
  8. _Tuple3x3f = tuple[_Tuple3f, _Tuple3f, _Tuple3f]
  9. class _IccMeasurementCondition(TypedDict):
  10. observer: int
  11. backing: _Tuple3f
  12. geo: str
  13. flare: float
  14. illuminant_type: str
  15. class _IccViewingCondition(TypedDict):
  16. illuminant: _Tuple3f
  17. surround: _Tuple3f
  18. illuminant_type: str
  19. class CmsProfile:
  20. @property
  21. def rendering_intent(self) -> int: ...
  22. @property
  23. def creation_date(self) -> datetime.datetime | None: ...
  24. @property
  25. def copyright(self) -> str | None: ...
  26. @property
  27. def target(self) -> str | None: ...
  28. @property
  29. def manufacturer(self) -> str | None: ...
  30. @property
  31. def model(self) -> str | None: ...
  32. @property
  33. def profile_description(self) -> str | None: ...
  34. @property
  35. def screening_description(self) -> str | None: ...
  36. @property
  37. def viewing_condition(self) -> str | None: ...
  38. @property
  39. def version(self) -> float: ...
  40. @property
  41. def icc_version(self) -> int: ...
  42. @property
  43. def attributes(self) -> int: ...
  44. @property
  45. def header_flags(self) -> int: ...
  46. @property
  47. def header_manufacturer(self) -> str: ...
  48. @property
  49. def header_model(self) -> str: ...
  50. @property
  51. def device_class(self) -> str: ...
  52. @property
  53. def connection_space(self) -> str: ...
  54. @property
  55. def xcolor_space(self) -> str: ...
  56. @property
  57. def profile_id(self) -> bytes: ...
  58. @property
  59. def is_matrix_shaper(self) -> bool: ...
  60. @property
  61. def technology(self) -> str | None: ...
  62. @property
  63. def colorimetric_intent(self) -> str | None: ...
  64. @property
  65. def perceptual_rendering_intent_gamut(self) -> str | None: ...
  66. @property
  67. def saturation_rendering_intent_gamut(self) -> str | None: ...
  68. @property
  69. def red_colorant(self) -> _Tuple2x3f | None: ...
  70. @property
  71. def green_colorant(self) -> _Tuple2x3f | None: ...
  72. @property
  73. def blue_colorant(self) -> _Tuple2x3f | None: ...
  74. @property
  75. def red_primary(self) -> _Tuple2x3f | None: ...
  76. @property
  77. def green_primary(self) -> _Tuple2x3f | None: ...
  78. @property
  79. def blue_primary(self) -> _Tuple2x3f | None: ...
  80. @property
  81. def media_white_point_temperature(self) -> float | None: ...
  82. @property
  83. def media_white_point(self) -> _Tuple2x3f | None: ...
  84. @property
  85. def media_black_point(self) -> _Tuple2x3f | None: ...
  86. @property
  87. def luminance(self) -> _Tuple2x3f | None: ...
  88. @property
  89. def chromatic_adaptation(self) -> tuple[_Tuple3x3f, _Tuple3x3f] | None: ...
  90. @property
  91. def chromaticity(self) -> _Tuple3x3f | None: ...
  92. @property
  93. def colorant_table(self) -> list[str] | None: ...
  94. @property
  95. def colorant_table_out(self) -> list[str] | None: ...
  96. @property
  97. def intent_supported(self) -> dict[int, tuple[bool, bool, bool]] | None: ...
  98. @property
  99. def clut(self) -> dict[int, tuple[bool, bool, bool]] | None: ...
  100. @property
  101. def icc_measurement_condition(self) -> _IccMeasurementCondition | None: ...
  102. @property
  103. def icc_viewing_condition(self) -> _IccViewingCondition | None: ...
  104. def is_intent_supported(self, intent: int, direction: int, /) -> int: ...
  105. class CmsTransform:
  106. def apply(self, id_in: CapsuleType, id_out: CapsuleType) -> int: ...
  107. def profile_open(profile: str, /) -> CmsProfile: ...
  108. def profile_frombytes(profile: bytes, /) -> CmsProfile: ...
  109. def profile_tobytes(profile: CmsProfile, /) -> bytes: ...
  110. def buildTransform(
  111. input_profile: CmsProfile,
  112. output_profile: CmsProfile,
  113. in_mode: str,
  114. out_mode: str,
  115. rendering_intent: int = 0,
  116. cms_flags: int = 0,
  117. /,
  118. ) -> CmsTransform: ...
  119. def buildProofTransform(
  120. input_profile: CmsProfile,
  121. output_profile: CmsProfile,
  122. proof_profile: CmsProfile,
  123. in_mode: str,
  124. out_mode: str,
  125. rendering_intent: int = 0,
  126. proof_intent: int = 0,
  127. cms_flags: int = 0,
  128. /,
  129. ) -> CmsTransform: ...
  130. def createProfile(
  131. color_space: Literal["LAB", "XYZ", "sRGB"], color_temp: SupportsFloat = 0.0, /
  132. ) -> CmsProfile: ...
  133. if sys.platform == "win32":
  134. def get_display_profile_win32(handle: int = 0, is_dc: int = 0, /) -> str | None: ...