-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy path_tile.pyi
More file actions
62 lines (52 loc) · 2.08 KB
/
Copy path_tile.pyi
File metadata and controls
62 lines (52 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from collections.abc import Buffer
from ._array import Array
from ._decoder import DecoderRegistry
from ._thread_pool import ThreadPool
from .enums import Compression
class Tile:
"""A representation of a TIFF image tile."""
@property
def x(self) -> int:
"""The column index this tile represents."""
@property
def y(self) -> int:
"""The row index this tile represents."""
@property
def compressed_bytes(self) -> Buffer | list[Buffer]:
"""The compressed bytes underlying this tile.
This will be a single buffer for pixel-interleaved (chunky) data, or a list of
buffers for band-interleaved (planar) data.
"""
@property
def compression_method(self) -> Compression | int:
"""The compression method used by this tile."""
def decode_sync(
self,
*,
decoder_registry: DecoderRegistry | None = None,
) -> Array:
"""Decode this tile's data.
**Note**: This is a blocking function and will perform the tile decompression on
the current thread. Prefer using the asynchronous `decode` method, which will
offload decompression to a thread pool.
Keyword Args:
decoder_registry: the decoders to use for decompression. Defaults to None, in which case a default decoder registry is used.
Returns:
Decoded tile data as an Array instance.
"""
async def decode(
self,
*,
decoder_registry: DecoderRegistry | None = None,
pool: ThreadPool | None = None,
) -> Array:
"""Decode this tile's data.
This is an asynchronous function that will offload the tile decompression to a
thread pool.
Keyword Args:
decoder_registry: the decoders to use for decompression. Defaults to None, in which case a default decoder registry is used.
pool: the thread pool on which to run decompression. Defaults to None, in
which case, a default thread pool is used.
Returns:
Decoded tile data as an Array instance.
"""