內部模組

_binary 模組

二進位輸入/輸出支援常式。

PIL._binary.i16be(c: bytes, o: int = 0) int[原始碼]
PIL._binary.i16le(c: bytes, o: int = 0) int[原始碼]

將 2 位元組 (16 位元) 字串轉換為無符號整數。

參數:
  • c – 包含要轉換的位元組的字串

  • o – 字串中要轉換的位元組的偏移量

PIL._binary.i32be(c: bytes, o: int = 0) int[原始碼]
PIL._binary.i32le(c: bytes, o: int = 0) int[原始碼]

將 4 位元組 (32 位元) 字串轉換為無符號整數。

參數:
  • c – 包含要轉換的位元組的字串

  • o – 字串中要轉換的位元組的偏移量

PIL._binary.i8(c: bytes) int[原始碼]
PIL._binary.o16be(i: int) bytes[原始碼]
PIL._binary.o16le(i: int) bytes[原始碼]
PIL._binary.o32be(i: int) bytes[原始碼]
PIL._binary.o32le(i: int) bytes[原始碼]
PIL._binary.o8(i: int) bytes[原始碼]
PIL._binary.si16be(c: bytes, o: int = 0) int[原始碼]

將一個 2 位元組(16 位元)的字串轉換為有號整數,採用大端位元組順序。

參數:
  • c – 包含要轉換的位元組的字串

  • o – 字串中要轉換的位元組的偏移量

PIL._binary.si16le(c: bytes, o: int = 0) int[原始碼]

將一個 2 位元組(16 位元)的字串轉換為有號整數。

參數:
  • c – 包含要轉換的位元組的字串

  • o – 字串中要轉換的位元組的偏移量

PIL._binary.si32be(c: bytes, o: int = 0) int[原始碼]

將一個 4 位元組(32 位元)的字串轉換為有號整數,採用大端位元組順序。

參數:
  • c – 包含要轉換的位元組的字串

  • o – 字串中要轉換的位元組的偏移量

PIL._binary.si32le(c: bytes, o: int = 0) int[原始碼]

將一個 4 位元組(32 位元)的字串轉換為有號整數。

參數:
  • c – 包含要轉換的位元組的字串

  • o – 字串中要轉換的位元組的偏移量

_deprecate 模組

PIL._deprecate.deprecate(deprecated: str, when: int | None, replacement: str | None = None, *, action: str | None = None, plural: bool = False) None[原始碼]

棄用輔助函數。

參數:
  • deprecated – 要棄用的事物名稱。

  • when – Pillow 主要版本,將在其中移除。

  • replacement – 替代物的名稱。

  • action – 不使用「替代」,而是提供自訂的行動呼籲,例如「升級到新事物」。

  • plural – 如果棄用的事物是複數,需要使用「are」而不是「is」。

通常格式如下

「[deprecated] 已棄用,將在 Pillow [when] (yyyy-mm-dd) 中移除。請改用 [replacement]。」

您可以省略替代語句

「[deprecated] 已棄用,將在 Pillow [when] (yyyy-mm-dd) 中移除」

或使用其他行動呼籲

「[deprecated] 已棄用,將在 Pillow [when] (yyyy-mm-dd) 中移除。[action]。」

_tkinter_finder 模組

尋找連結到 Tcl / Tk 函式庫的編譯模組

_typing 模組

提供一種方便的方式來導入某些 Python 版本上不可用的型別提示。

class PIL._typing.Buffer

型別別名。

class PIL._typing.IntegralLike

型別別名。

class PIL._typing.NumpyArray

型別別名。

class PIL._typing.StrOrBytesPath

型別別名。

class PIL._typing.SupportsRead[原始碼]

一個支援 read 方法的物件。

PIL._typing.TypeGuard = typing.TypeGuard[原始碼]

請參閱 typing.TypeGuard

_util 模組

class PIL._util.DeferredError(ex: BaseException)[原始碼]

基底類別:object

static new(ex: BaseException) Any[原始碼]

建立一個物件,當使用時會拋出被包裹的例外 ex,並將其轉換為 Any 類型。

PIL._util.is_path(f: Any) TypeGuard[str | bytes | PathLike[str] | PathLike[bytes]][來源]

_version 模組

PIL._version.__version__: str

這是 Pillow 的主要版本號,所有其他使用都參考此模組。

PIL.Image.core 模組

一個內部介面模組,先前稱為 _imaging,在 _imaging.c 中實作。

class PIL.Image.core.ImagingCore

影像資料的表示法。