_imagingcms.pyi 4.2 KB

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