-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathslide.py
36 lines (28 loc) · 1.1 KB
/
slide.py
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
class Slide(object):
@classmethod
async def create(cls, filepath):
self = cls()
self.filepath = filepath
await self.open(filepath)
return self
async def open(self, filepath):
raise NotImplementedError
async def close(self):
raise NotImplementedError
async def get_info(self):
raise NotImplementedError
async def get_thumbnail(self, max_x, max_y):
# allowed to return pil image or numpy array
raise NotImplementedError
async def get_label(self):
# allowed to return pil image or numpy array
raise NotImplementedError
async def get_macro(self):
# allowed to return pil image or numpy array
raise NotImplementedError
async def get_region(self, level, start_x, start_y, size_x, size_y, padding_color=None, z=0):
# allowed to return pil image or numpy array
raise NotImplementedError
async def get_tile(self, level, tile_x, tile_y, padding_color=None, z=0):
# allowed to return pil image or numpy array or bytes object
raise NotImplementedError