aboutsummaryrefslogtreecommitdiffstats
path: root/bsie/reader/preview/__init__.py
blob: 791a133c2963590da34aaa1887a1c89b5619564c (plain)
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

# imports
import typing

# external imports
import PIL.Image

# inner-module imports
from .. import chain

# constants
_FILE_FORMAT_READERS: typing.Sequence[str] = (
    # native image formats
    __package__ + '._pillow.PillowPreviewReader',
    __package__ + '._rawpy.RawpyPreviewReader',
    # multiformat readers
    __package__ + '._pg.PreviewGeneratorReader',
    )

# exports
__all__: typing.Sequence[str] = (
    'Preview',
    )


## code ##

class Preview(chain.ReaderChain[typing.Callable[[int], PIL.Image.Image]]): # pylint: disable=too-few-public-methods
    """Create a preview from a file."""

    def __init__(self, cfg: typing.Optional[typing.Any] = None):
        super().__init__(_FILE_FORMAT_READERS, cfg)

## EOF ##