valetudo-map-parser 0.1.9b17__py3-none-any.whl → 0.1.9b18__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.
@@ -16,7 +16,7 @@ from .config.auto_crop import AutoCrop
16
16
  from .config.drawable import Drawable
17
17
  from .config.shared import CameraShared
18
18
  from .config.types import COLORS, CalibrationPoints, Colors, RoomsProperties
19
- from .config.utils import BaseHandler
19
+ from .config.utils import BaseHandler, ResizeParams
20
20
  from .hypfer_draw import ImageDraw as ImDraw
21
21
  from .map_data import ImageData
22
22
 
@@ -247,15 +247,16 @@ 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
252
- resized_image = await self.async_resize_images(
250
+ resize_params = ResizeParams(
253
251
  pil_img=pil_img,
254
- width=width,
255
- height=height,
252
+ width=self.shared.image_ref_width,
253
+ height=self.shared.image_ref_height,
256
254
  aspect_ratio=self.shared.image_aspect_ratio,
257
255
  crop_size=self.crop_img_size,
258
- offset_func=self.async_map_coordinates_offset,
256
+ offset_func=self.async_map_coordinates_offset
257
+ )
258
+ resized_image = await self.async_resize_images(
259
+ resize_params
259
260
  )
260
261
  return resized_image
261
262
  _LOGGER.debug("%s: Frame Completed.", self.file_name)
@@ -24,7 +24,7 @@ from .config.types import (
24
24
  RobotPosition,
25
25
  RoomsProperties,
26
26
  )
27
- from .config.utils import BaseHandler
27
+ from .config.utils import BaseHandler, ResizeParams
28
28
  from .map_data import RandImageData
29
29
  from .reimg_draw import ImageDraw
30
30
 
@@ -258,17 +258,18 @@ class ReImageHandler(BaseHandler):
258
258
 
259
259
  async def _finalize_image(self, pil_img):
260
260
  if self.check_zoom_and_aspect_ratio():
261
- width = self.shared.image_ref_width
262
- height = self.shared.image_ref_height
263
- pil_img = await self.async_resize_images(
261
+ resize_params = ResizeParams(
264
262
  pil_img=pil_img,
265
- width=width,
266
- height=height,
263
+ width=self.shared.image_ref_width,
264
+ height=self.shared.image_ref_height,
267
265
  aspect_ratio=self.shared.image_aspect_ratio,
268
266
  crop_size=self.crop_img_size,
269
267
  offset_func=self.async_map_coordinates_offset,
270
268
  Rand256=True,
271
269
  )
270
+ pil_img = await self.async_resize_images(
271
+ resize_params
272
+ )
272
273
  _LOGGER.debug("%s: Frame Completed.", self.file_name)
273
274
  return pil_img
274
275
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: valetudo-map-parser
3
- Version: 0.1.9b17
3
+ Version: 0.1.9b18
4
4
  Summary: A Python library to parse Valetudo map data returning a PIL Image object.
5
5
  License: Apache-2.0
6
6
  Author: Sandro Cantarella
@@ -8,13 +8,13 @@ valetudo_map_parser/config/shared.py,sha256=LQV5K8tbVhEKUkby9ssjEmh_T4Ai-Euzsbag
8
8
  valetudo_map_parser/config/types.py,sha256=sdjqhcxpRSxNFLVHIyCg-RDL9JIjtQHoR2C2WpocWBc,16107
9
9
  valetudo_map_parser/config/utils.py,sha256=Vm2gkD_t_7qRtnC_LP9sNiTkwLDLcxTU6MhiE6lBuE8,18221
10
10
  valetudo_map_parser/hypfer_draw.py,sha256=s58ak9IBYLjJyoddfDC99PfQ12HTjkSfJYXqCi4vZKs,14931
11
- valetudo_map_parser/hypfer_handler.py,sha256=fEc_gMZLA88kgn73nF2wmfjWdbwLl-ip8rvkXBXFoNo,13813
11
+ valetudo_map_parser/hypfer_handler.py,sha256=k5c4hDO09zMX42laVzwGE9YjWKUYc1BBZt0eL-2XLGE,13862
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=fOOkMdV7HkTdXKiqxrPrxOZYkLQgFOy4urpvpQL5AEk,15615
14
+ valetudo_map_parser/rand25_handler.py,sha256=V1wTvREsDX7h66XxYlmkz8w15OM83lp79FNYDEduqh0,15661
15
15
  valetudo_map_parser/reimg_draw.py,sha256=dtdbYKKxmQnbOaHBHayWEF07OdSnTKo2CPSOW0qpgH0,12506
16
- valetudo_map_parser-0.1.9b17.dist-info/LICENSE,sha256=Lh-qBbuRV0-jiCIBhfV7NgdwFxQFOXH3BKOzK865hRs,10480
17
- valetudo_map_parser-0.1.9b17.dist-info/METADATA,sha256=EBdtfZiI-T0DHQCMk4Kob_RRYResYLpaiIMoFzU1g6c,1029
18
- valetudo_map_parser-0.1.9b17.dist-info/NOTICE.txt,sha256=5lTOuWiU9aiEnJ2go8sc7lTJ7ntMBx0g0GFnNrswCY4,2533
19
- valetudo_map_parser-0.1.9b17.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
20
- valetudo_map_parser-0.1.9b17.dist-info/RECORD,,
16
+ valetudo_map_parser-0.1.9b18.dist-info/LICENSE,sha256=Lh-qBbuRV0-jiCIBhfV7NgdwFxQFOXH3BKOzK865hRs,10480
17
+ valetudo_map_parser-0.1.9b18.dist-info/METADATA,sha256=f55dx0c9Qeu0cFJA5mg9odjuQUDvB_NGrOGUf3qDGB4,1029
18
+ valetudo_map_parser-0.1.9b18.dist-info/NOTICE.txt,sha256=5lTOuWiU9aiEnJ2go8sc7lTJ7ntMBx0g0GFnNrswCY4,2533
19
+ valetudo_map_parser-0.1.9b18.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
20
+ valetudo_map_parser-0.1.9b18.dist-info/RECORD,,