Get the image type.
(self, kind, transform=None)
| 82 | return self._img |
| 83 | |
| 84 | def check_kind(self, kind, transform=None): |
| 85 | """ |
| 86 | Get the image type. |
| 87 | """ |
| 88 | if kind is None: |
| 89 | kind = self.kind |
| 90 | allowed = not self.allowed_kinds or kind in self.allowed_kinds |
| 91 | if transform: |
| 92 | kind = transform(kind) |
| 93 | if not allowed: |
| 94 | allowed = kind in self.allowed_kinds |
| 95 | if not allowed: |
| 96 | raise ValueError(f"Cannot set {type(self).__name__} type to {kind}") |
| 97 | return kind |
| 98 | |
| 99 | def is_eye(self, row: int, col: int): |
| 100 | """ |