aboutsummaryrefslogtreecommitdiffstats
path: root/bsie/reader/image/__init__.py
blob: b7587e75d60ebbcd472298d38a91fec9d8da908d (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
35
36
37
"""

Part of the bsie module.
A copy of the license is provided with the project.
Author: Matthias Baumgartner, 2022
"""
# standard imports
import typing

# external imports
import PIL.Image

# inner-module imports
from .. import chain

# constants
_FILE_FORMAT_READERS: typing.Sequence[str] = (
    __package__ + '._raw.RawImage',
    __package__ + '._pillow.PillowImage',
    )

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


## code ##

# FIXME: Check if PIL.Image or PIL.Image.Image, or if version-dependent
class Image(chain.ReaderChain[PIL.Image.Image]): # pylint: disable=too-few-public-methods
    """Read an image file."""

    def __init__(self, cfg):
        super().__init__(_FILE_FORMAT_READERS, cfg)

## EOF ##