valetudo-map-parser 0.1.9b13__py3-none-any.whl → 0.1.9b15__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 +1 -8
- valetudo_map_parser/hypfer_handler.py +5 -3
- valetudo_map_parser/rand25_handler.py +3 -1
- {valetudo_map_parser-0.1.9b13.dist-info → valetudo_map_parser-0.1.9b15.dist-info}/METADATA +1 -1
- {valetudo_map_parser-0.1.9b13.dist-info → valetudo_map_parser-0.1.9b15.dist-info}/RECORD +8 -8
- {valetudo_map_parser-0.1.9b13.dist-info → valetudo_map_parser-0.1.9b15.dist-info}/LICENSE +0 -0
- {valetudo_map_parser-0.1.9b13.dist-info → valetudo_map_parser-0.1.9b15.dist-info}/NOTICE.txt +0 -0
- {valetudo_map_parser-0.1.9b13.dist-info → valetudo_map_parser-0.1.9b15.dist-info}/WHEEL +0 -0
@@ -1,7 +1,6 @@
|
|
1
1
|
"""Utility code for the valetudo map parser."""
|
2
2
|
|
3
3
|
from dataclasses import dataclass
|
4
|
-
from functools import partial
|
5
4
|
import hashlib
|
6
5
|
import json
|
7
6
|
from logging import getLogger
|
@@ -9,7 +8,6 @@ from logging import getLogger
|
|
9
8
|
from PIL import ImageOps, Image
|
10
9
|
|
11
10
|
from .types import ChargerPosition, ImageSize, NumpyArray, RobotPosition
|
12
|
-
from .shared import CameraShared
|
13
11
|
|
14
12
|
_LOGGER = getLogger(__name__)
|
15
13
|
|
@@ -60,12 +58,7 @@ class BaseHandler:
|
|
60
58
|
self.offset_y = 0
|
61
59
|
self.crop_area = [0, 0, 0, 0]
|
62
60
|
self.zooming = False
|
63
|
-
self.async_resize_images =
|
64
|
-
async_resize_image,
|
65
|
-
crop_size=self.crop_img_size,
|
66
|
-
offset_func=self.async_map_coordinates_offset,
|
67
|
-
rand256=False,
|
68
|
-
)
|
61
|
+
self.async_resize_images = async_resize_image()
|
69
62
|
|
70
63
|
def get_frame_number(self) -> int:
|
71
64
|
"""Return the frame number of the image."""
|
@@ -29,7 +29,7 @@ class HypferMapImageHandler(BaseHandler):
|
|
29
29
|
|
30
30
|
def __init__(self, shared_data: CameraShared):
|
31
31
|
"""Initialize the Map Image Handler."""
|
32
|
-
BaseHandler.__init__()
|
32
|
+
BaseHandler.__init__(self)
|
33
33
|
self.shared = shared_data # camera shared data
|
34
34
|
self.auto_crop = None # auto crop data to be calculate once.
|
35
35
|
self.calibration_data = None # camera shared data.
|
@@ -247,13 +247,15 @@ 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.
|
251
|
-
height = self.
|
250
|
+
width = self.shared.image_ref_width
|
251
|
+
height = self.shared.image_ref_height
|
252
252
|
resized_image = await self.async_resize_image(
|
253
253
|
pil_img=pil_img,
|
254
254
|
width=width,
|
255
255
|
height=height,
|
256
256
|
aspect_ratio=self.shared.image_aspect_ratio,
|
257
|
+
crop_size=self.crop_img_size,
|
258
|
+
offset_func=self.async_map_coordinates_offset(),
|
257
259
|
)
|
258
260
|
return resized_image
|
259
261
|
_LOGGER.debug("%s: Frame Completed.", self.file_name)
|
@@ -38,7 +38,7 @@ class ReImageHandler(BaseHandler):
|
|
38
38
|
"""
|
39
39
|
|
40
40
|
def __init__(self, camera_shared):
|
41
|
-
BaseHandler.__init__()
|
41
|
+
BaseHandler.__init__(self)
|
42
42
|
self.auto_crop = None # Auto crop flag
|
43
43
|
self.segment_data = None # Segment data
|
44
44
|
self.outlines = None # Outlines data
|
@@ -265,6 +265,8 @@ class ReImageHandler(BaseHandler):
|
|
265
265
|
width=width,
|
266
266
|
height=height,
|
267
267
|
aspect_ratio=self.shared.image_aspect_ratio,
|
268
|
+
crop_size=self.crop_img_size,
|
269
|
+
offset_func=self.async_map_coordinates_offset(),
|
268
270
|
Rand256=True,
|
269
271
|
)
|
270
272
|
_LOGGER.debug("%s: Frame Completed.", self.file_name)
|
@@ -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=OuyKWq1l1ZhZLwBzXj8uVl7MROBD0V8NFBMN5QfQIfk,18223
|
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=PCU_IMCV8qFMqcKD7zM_c0uWaS9lJVY5xU-JyN4Fpfg,13814
|
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=0XtZNn4OfGRtx-WtcfMnGai_7tKh6XXtjY1Ha1v7yLI,15617
|
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.9b15.dist-info/LICENSE,sha256=Lh-qBbuRV0-jiCIBhfV7NgdwFxQFOXH3BKOzK865hRs,10480
|
17
|
+
valetudo_map_parser-0.1.9b15.dist-info/METADATA,sha256=dXIg_2z_EARPmzbXDTRAGbntvPlU96V6DhfueYqQ8nY,1029
|
18
|
+
valetudo_map_parser-0.1.9b15.dist-info/NOTICE.txt,sha256=5lTOuWiU9aiEnJ2go8sc7lTJ7ntMBx0g0GFnNrswCY4,2533
|
19
|
+
valetudo_map_parser-0.1.9b15.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
20
|
+
valetudo_map_parser-0.1.9b15.dist-info/RECORD,,
|
File without changes
|
{valetudo_map_parser-0.1.9b13.dist-info → valetudo_map_parser-0.1.9b15.dist-info}/NOTICE.txt
RENAMED
File without changes
|
File without changes
|