valetudo-map-parser 0.1.9b11__py3-none-any.whl → 0.1.9b12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- valetudo_map_parser/config/utils.py +3 -4
- valetudo_map_parser/hypfer_handler.py +7 -2
- valetudo_map_parser/rand25_handler.py +9 -3
- {valetudo_map_parser-0.1.9b11.dist-info → valetudo_map_parser-0.1.9b12.dist-info}/METADATA +1 -1
- {valetudo_map_parser-0.1.9b11.dist-info → valetudo_map_parser-0.1.9b12.dist-info}/RECORD +8 -8
- {valetudo_map_parser-0.1.9b11.dist-info → valetudo_map_parser-0.1.9b12.dist-info}/LICENSE +0 -0
- {valetudo_map_parser-0.1.9b11.dist-info → valetudo_map_parser-0.1.9b12.dist-info}/NOTICE.txt +0 -0
- {valetudo_map_parser-0.1.9b11.dist-info → valetudo_map_parser-0.1.9b12.dist-info}/WHEEL +0 -0
@@ -43,6 +43,7 @@ class BaseHandler:
|
|
43
43
|
|
44
44
|
def __init__(self):
|
45
45
|
self.file_name = None
|
46
|
+
self.shared = None
|
46
47
|
self.img_size = None
|
47
48
|
self.json_data = None
|
48
49
|
self.json_id = None
|
@@ -57,15 +58,13 @@ class BaseHandler:
|
|
57
58
|
self.crop_img_size = [0, 0]
|
58
59
|
self.offset_x = 0
|
59
60
|
self.offset_y = 0
|
60
|
-
self.shared:CameraShared = None
|
61
61
|
self.crop_area = [0, 0, 0, 0]
|
62
62
|
self.zooming = False
|
63
|
-
self.
|
63
|
+
self.async_resize_images = partial(
|
64
64
|
async_resize_image,
|
65
|
-
width=self.shared.image_ref_width,
|
66
|
-
height=self.shared.image_ref_height,
|
67
65
|
crop_size=self.crop_img_size,
|
68
66
|
offset_func=self.async_map_coordinates_offset,
|
67
|
+
rand256=False,
|
69
68
|
)
|
70
69
|
|
71
70
|
def get_frame_number(self) -> int:
|
@@ -29,8 +29,8 @@ class HypferMapImageHandler(BaseHandler):
|
|
29
29
|
|
30
30
|
def __init__(self, shared_data: CameraShared):
|
31
31
|
"""Initialize the Map Image Handler."""
|
32
|
-
super().__init__()
|
33
32
|
self.shared = shared_data # camera shared data
|
33
|
+
super().__init__()
|
34
34
|
self.auto_crop = None # auto crop data to be calculate once.
|
35
35
|
self.calibration_data = None # camera shared data.
|
36
36
|
self.crop_area = None # module shared for calibration data.
|
@@ -247,8 +247,13 @@ class HypferMapImageHandler(BaseHandler):
|
|
247
247
|
del img_np_array
|
248
248
|
# reduce the image size if the zoomed image is bigger then the original.
|
249
249
|
if self.check_zoom_and_aspect_ratio():
|
250
|
+
width = self._shared.image_ref_width
|
251
|
+
height = self._shared.image_ref_height
|
250
252
|
resized_image = await self.async_resize_image(
|
251
|
-
pil_img,
|
253
|
+
pil_img=pil_img,
|
254
|
+
width=width,
|
255
|
+
height=height,
|
256
|
+
aspect_ratio=self.shared.image_aspect_ratio,
|
252
257
|
)
|
253
258
|
return resized_image
|
254
259
|
_LOGGER.debug("%s: Frame Completed.", self.file_name)
|
@@ -38,7 +38,6 @@ class ReImageHandler(BaseHandler):
|
|
38
38
|
"""
|
39
39
|
|
40
40
|
def __init__(self, camera_shared):
|
41
|
-
super().__init__()
|
42
41
|
self.auto_crop = None # Auto crop flag
|
43
42
|
self.segment_data = None # Segment data
|
44
43
|
self.outlines = None # Outlines data
|
@@ -62,6 +61,7 @@ class ReImageHandler(BaseHandler):
|
|
62
61
|
self.offset_right = self.shared.offset_right # offset right
|
63
62
|
self.imd = ImageDraw(self) # Image Draw
|
64
63
|
self.crop = AutoCrop(self)
|
64
|
+
super().__init__()
|
65
65
|
|
66
66
|
async def extract_room_properties(
|
67
67
|
self, json_data: JsonType, destinations: JsonType
|
@@ -257,8 +257,14 @@ class ReImageHandler(BaseHandler):
|
|
257
257
|
|
258
258
|
async def _finalize_image(self, pil_img):
|
259
259
|
if self.check_zoom_and_aspect_ratio():
|
260
|
-
|
261
|
-
|
260
|
+
width = self.shared.image_ref_width
|
261
|
+
height = self.shared.image_ref_height
|
262
|
+
pil_img = await self.async_resize_images(
|
263
|
+
pil_img=pil_img,
|
264
|
+
width=width,
|
265
|
+
height=height,
|
266
|
+
aspect_ratio=self.shared.image_aspect_ratio,
|
267
|
+
Rand256=True,
|
262
268
|
)
|
263
269
|
_LOGGER.debug("%s: Frame Completed.", self.file_name)
|
264
270
|
return pil_img
|
@@ -6,15 +6,15 @@ valetudo_map_parser/config/drawable.py,sha256=hsrEJCMVOrjs5sJfr26SeqJD0VNlYWwxcV
|
|
6
6
|
valetudo_map_parser/config/rand25_parser.py,sha256=fehyF18hRWRWbXbojocQCIaIch21Lbh1wtl2XdKRSl0,16447
|
7
7
|
valetudo_map_parser/config/shared.py,sha256=LQV5K8tbVhEKUkby9ssjEmh_T4Ai-Euzsbag_HWYVRc,9448
|
8
8
|
valetudo_map_parser/config/types.py,sha256=sdjqhcxpRSxNFLVHIyCg-RDL9JIjtQHoR2C2WpocWBc,16107
|
9
|
-
valetudo_map_parser/config/utils.py,sha256=
|
9
|
+
valetudo_map_parser/config/utils.py,sha256=q2iSFIiUA3bxIpYuXrUT16JqjvOuCTNsVjMhbCvBYzM,18444
|
10
10
|
valetudo_map_parser/hypfer_draw.py,sha256=s58ak9IBYLjJyoddfDC99PfQ12HTjkSfJYXqCi4vZKs,14931
|
11
|
-
valetudo_map_parser/hypfer_handler.py,sha256=
|
11
|
+
valetudo_map_parser/hypfer_handler.py,sha256=MnBkUv8KoJ0oEY4DXaT1UQou4YAuRrVsaO_itCnN9hM,13689
|
12
12
|
valetudo_map_parser/map_data.py,sha256=6FbQfgxFB6E4kcOWokReJOVSekVaE1kStyhTQhAhiOg,19469
|
13
13
|
valetudo_map_parser/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
|
-
valetudo_map_parser/rand25_handler.py,sha256=
|
14
|
+
valetudo_map_parser/rand25_handler.py,sha256=fv1iOokGiwxvLmqg2Hjis3uUbF9nUomx3nOuCA59lpA,15497
|
15
15
|
valetudo_map_parser/reimg_draw.py,sha256=dtdbYKKxmQnbOaHBHayWEF07OdSnTKo2CPSOW0qpgH0,12506
|
16
|
-
valetudo_map_parser-0.1.
|
17
|
-
valetudo_map_parser-0.1.
|
18
|
-
valetudo_map_parser-0.1.
|
19
|
-
valetudo_map_parser-0.1.
|
20
|
-
valetudo_map_parser-0.1.
|
16
|
+
valetudo_map_parser-0.1.9b12.dist-info/LICENSE,sha256=Lh-qBbuRV0-jiCIBhfV7NgdwFxQFOXH3BKOzK865hRs,10480
|
17
|
+
valetudo_map_parser-0.1.9b12.dist-info/METADATA,sha256=AAWAwJiXcwJj_IX9idFGxwuVzfzDDLrzKSztN5G9Rhk,1029
|
18
|
+
valetudo_map_parser-0.1.9b12.dist-info/NOTICE.txt,sha256=5lTOuWiU9aiEnJ2go8sc7lTJ7ntMBx0g0GFnNrswCY4,2533
|
19
|
+
valetudo_map_parser-0.1.9b12.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
20
|
+
valetudo_map_parser-0.1.9b12.dist-info/RECORD,,
|
File without changes
|
{valetudo_map_parser-0.1.9b11.dist-info → valetudo_map_parser-0.1.9b12.dist-info}/NOTICE.txt
RENAMED
File without changes
|
File without changes
|