valetudo-map-parser 0.1.9b11__py3-none-any.whl → 0.1.9b13__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.
@@ -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.async_resize_image = partial(
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,7 +29,7 @@ class HypferMapImageHandler(BaseHandler):
29
29
 
30
30
  def __init__(self, shared_data: CameraShared):
31
31
  """Initialize the Map Image Handler."""
32
- super().__init__()
32
+ BaseHandler.__init__()
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,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, self.shared.image_aspect_ratio
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,7 @@ class ReImageHandler(BaseHandler):
38
38
  """
39
39
 
40
40
  def __init__(self, camera_shared):
41
- super().__init__()
41
+ BaseHandler.__init__()
42
42
  self.auto_crop = None # Auto crop flag
43
43
  self.segment_data = None # Segment data
44
44
  self.outlines = None # Outlines data
@@ -63,6 +63,7 @@ class ReImageHandler(BaseHandler):
63
63
  self.imd = ImageDraw(self) # Image Draw
64
64
  self.crop = AutoCrop(self)
65
65
 
66
+
66
67
  async def extract_room_properties(
67
68
  self, json_data: JsonType, destinations: JsonType
68
69
  ) -> RoomsProperties:
@@ -257,8 +258,14 @@ class ReImageHandler(BaseHandler):
257
258
 
258
259
  async def _finalize_image(self, pil_img):
259
260
  if self.check_zoom_and_aspect_ratio():
260
- pil_img = await self.async_resize_image(
261
- pil_img, self.shared.image_aspect_ratio, True
261
+ width = self.shared.image_ref_width
262
+ height = self.shared.image_ref_height
263
+ pil_img = await self.async_resize_images(
264
+ pil_img=pil_img,
265
+ width=width,
266
+ height=height,
267
+ aspect_ratio=self.shared.image_aspect_ratio,
268
+ Rand256=True,
262
269
  )
263
270
  _LOGGER.debug("%s: Frame Completed.", self.file_name)
264
271
  return pil_img
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: valetudo-map-parser
3
- Version: 0.1.9b11
3
+ Version: 0.1.9b13
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
@@ -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=ieBsNcjzYzhXZzM6JdQQHRUGpuk3dSzBpp3NdDRywyA,18525
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=lA9rC4gO0cNas4ValRikw4X6Uc0sqo2-Roj7EQi1MBA,13471
11
+ valetudo_map_parser/hypfer_handler.py,sha256=wOPoIwpHFaM__Ss2Er6Kwdj4AF5NRv-1WCNkViHbqNs,13693
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=u3N-_qjpYQM3WO4cnhqHIPa7TMquJ9XYqhoUYFKoc8I,15276
14
+ valetudo_map_parser/rand25_handler.py,sha256=6uTa4uaE4NoVk0-xkPvhincQTz17yf8XNr0RusuYdj8,15502
15
15
  valetudo_map_parser/reimg_draw.py,sha256=dtdbYKKxmQnbOaHBHayWEF07OdSnTKo2CPSOW0qpgH0,12506
16
- valetudo_map_parser-0.1.9b11.dist-info/LICENSE,sha256=Lh-qBbuRV0-jiCIBhfV7NgdwFxQFOXH3BKOzK865hRs,10480
17
- valetudo_map_parser-0.1.9b11.dist-info/METADATA,sha256=kxebR1Ww4xKkgoEhMOXAgL80TfyXlb0oeL1z24QU7qQ,1029
18
- valetudo_map_parser-0.1.9b11.dist-info/NOTICE.txt,sha256=5lTOuWiU9aiEnJ2go8sc7lTJ7ntMBx0g0GFnNrswCY4,2533
19
- valetudo_map_parser-0.1.9b11.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
20
- valetudo_map_parser-0.1.9b11.dist-info/RECORD,,
16
+ valetudo_map_parser-0.1.9b13.dist-info/LICENSE,sha256=Lh-qBbuRV0-jiCIBhfV7NgdwFxQFOXH3BKOzK865hRs,10480
17
+ valetudo_map_parser-0.1.9b13.dist-info/METADATA,sha256=eD3X4jADIk1sWeh-2hhtrNrWzxQSdpbEVV16egZuoxk,1029
18
+ valetudo_map_parser-0.1.9b13.dist-info/NOTICE.txt,sha256=5lTOuWiU9aiEnJ2go8sc7lTJ7ntMBx0g0GFnNrswCY4,2533
19
+ valetudo_map_parser-0.1.9b13.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
20
+ valetudo_map_parser-0.1.9b13.dist-info/RECORD,,