valetudo-map-parser 0.1.9b43__py3-none-any.whl → 0.1.9b45__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/colors.py +88 -8
- valetudo_map_parser/config/drawable.py +83 -5
- valetudo_map_parser/config/drawable_elements.py +591 -16
- valetudo_map_parser/config/enhanced_drawable.py +4 -9
- valetudo_map_parser/config/optimized_element_map.py +363 -0
- valetudo_map_parser/config/room_outline.py +148 -0
- valetudo_map_parser/config/shared.py +1 -0
- valetudo_map_parser/config/utils.py +82 -65
- valetudo_map_parser/hypfer_draw.py +30 -32
- valetudo_map_parser/hypfer_handler.py +88 -100
- valetudo_map_parser/map_data.py +0 -9
- valetudo_map_parser/rand25_handler.py +173 -132
- valetudo_map_parser/utils/__init__.py +5 -0
- valetudo_map_parser/utils/color_utils.py +62 -0
- {valetudo_map_parser-0.1.9b43.dist-info → valetudo_map_parser-0.1.9b45.dist-info}/METADATA +2 -1
- valetudo_map_parser-0.1.9b45.dist-info/RECORD +27 -0
- valetudo_map_parser-0.1.9b43.dist-info/RECORD +0 -23
- {valetudo_map_parser-0.1.9b43.dist-info → valetudo_map_parser-0.1.9b45.dist-info}/LICENSE +0 -0
- {valetudo_map_parser-0.1.9b43.dist-info → valetudo_map_parser-0.1.9b45.dist-info}/NOTICE.txt +0 -0
- {valetudo_map_parser-0.1.9b43.dist-info → valetudo_map_parser-0.1.9b45.dist-info}/WHEEL +0 -0
@@ -15,9 +15,7 @@ import numpy as np
|
|
15
15
|
from PIL import Image
|
16
16
|
|
17
17
|
from .config.auto_crop import AutoCrop
|
18
|
-
from .config.
|
19
|
-
from .config.drawable_elements import DrawableElement, DrawingConfig
|
20
|
-
from .config.enhanced_drawable import EnhancedDrawable
|
18
|
+
from .config.drawable_elements import DrawableElement
|
21
19
|
from .config.types import (
|
22
20
|
COLORS,
|
23
21
|
DEFAULT_IMAGE_SIZE,
|
@@ -29,7 +27,17 @@ from .config.types import (
|
|
29
27
|
RoomsProperties,
|
30
28
|
RoomStore,
|
31
29
|
)
|
32
|
-
from .config.utils import
|
30
|
+
from .config.utils import (
|
31
|
+
BaseHandler,
|
32
|
+
get_element_at_position,
|
33
|
+
get_room_at_position,
|
34
|
+
handle_room_outline_error,
|
35
|
+
initialize_drawing_config,
|
36
|
+
manage_drawable_elements,
|
37
|
+
prepare_resize_params,
|
38
|
+
async_extract_room_outline,
|
39
|
+
update_element_map_with_robot,
|
40
|
+
)
|
33
41
|
from .map_data import RandImageData
|
34
42
|
from .reimg_draw import ImageDraw
|
35
43
|
|
@@ -54,8 +62,9 @@ class ReImageHandler(BaseHandler, AutoCrop):
|
|
54
62
|
self.data = RandImageData # Image Data
|
55
63
|
|
56
64
|
# Initialize drawing configuration using the shared utility function
|
57
|
-
|
58
|
-
|
65
|
+
self.drawing_config, self.draw, self.enhanced_draw = initialize_drawing_config(
|
66
|
+
self
|
67
|
+
)
|
59
68
|
self.element_map = None # Map of element codes
|
60
69
|
self.go_to = None # Go to position data
|
61
70
|
self.img_base_layer = None # Base image layer
|
@@ -109,18 +118,19 @@ class ReImageHandler(BaseHandler, AutoCrop):
|
|
109
118
|
num_room_pixels = np.sum(room_mask)
|
110
119
|
_LOGGER.debug(
|
111
120
|
"%s: Room %s mask has %d pixels",
|
112
|
-
self.file_name,
|
121
|
+
self.file_name,
|
122
|
+
str(room_id_int),
|
123
|
+
int(num_room_pixels),
|
113
124
|
)
|
114
125
|
|
115
126
|
# Use the shared utility function to extract the room outline
|
116
|
-
from .config.utils import async_extract_room_outline
|
117
127
|
return await async_extract_room_outline(
|
118
|
-
room_mask, min_x, min_y, max_x, max_y, self.file_name, room_id_int
|
128
|
+
room_mask, min_x, min_y, max_x, max_y, self.file_name, room_id_int
|
119
129
|
)
|
120
130
|
|
121
131
|
async def extract_room_properties(
|
122
132
|
self, json_data: JsonType, destinations: JsonType
|
123
|
-
) -> RoomsProperties:
|
133
|
+
) -> tuple[RoomsProperties, Any, Any]:
|
124
134
|
"""Extract the room properties."""
|
125
135
|
unsorted_id = RandImageData.get_rrm_segments_ids(json_data)
|
126
136
|
size_x, size_y = RandImageData.get_rrm_image_size(json_data)
|
@@ -140,79 +150,88 @@ class ReImageHandler(BaseHandler, AutoCrop):
|
|
140
150
|
room_id_to_data = {room["id"]: room for room in room_data}
|
141
151
|
self.rooms_pos = []
|
142
152
|
room_properties = {}
|
143
|
-
if self.outlines:
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
len(outline),
|
168
|
-
)
|
169
|
-
except (ValueError, IndexError, TypeError, ArithmeticError) as e:
|
170
|
-
from .config.utils import handle_room_outline_error
|
171
|
-
handle_room_outline_error(self.file_name, room_id, e, _LOGGER)
|
172
|
-
outline = corners
|
173
|
-
|
174
|
-
# rand256 vacuums accept int(room_id) or str(name)
|
175
|
-
# the card will soon support int(room_id) but the camera will send name
|
176
|
-
# this avoids the manual change of the values in the card.
|
177
|
-
self.rooms_pos.append(
|
178
|
-
{
|
179
|
-
"name": name,
|
180
|
-
"corners": corners,
|
181
|
-
}
|
153
|
+
if not self.outlines:
|
154
|
+
# Return empty data if no outlines are available
|
155
|
+
_LOGGER.debug("%s: No outlines available", self.file_name)
|
156
|
+
return None, None, None # Return empty data for all three return values
|
157
|
+
|
158
|
+
# If we have outlines, proceed with processing
|
159
|
+
for id_x, room_id in enumerate(unsorted_id):
|
160
|
+
if room_id in room_id_to_data:
|
161
|
+
room_info = room_id_to_data[room_id]
|
162
|
+
name = room_info.get("name")
|
163
|
+
# Calculate x and y min/max from outlines
|
164
|
+
x_min = self.outlines[id_x][0][0]
|
165
|
+
x_max = self.outlines[id_x][1][0]
|
166
|
+
y_min = self.outlines[id_x][0][1]
|
167
|
+
y_max = self.outlines[id_x][1][1]
|
168
|
+
|
169
|
+
# Get rectangular corners as a fallback
|
170
|
+
corners = self.get_corners(x_max, x_min, y_max, y_min)
|
171
|
+
|
172
|
+
# Try to extract a more accurate room outline from the element map
|
173
|
+
try:
|
174
|
+
# Extract the room outline using the element map
|
175
|
+
outline = await self.extract_room_outline_from_map(
|
176
|
+
room_id, self.segment_data[id_x]
|
182
177
|
)
|
183
|
-
|
184
|
-
"
|
185
|
-
|
178
|
+
_LOGGER.debug(
|
179
|
+
"%s: Traced outline for room %s with %d points",
|
180
|
+
self.file_name,
|
181
|
+
room_id,
|
182
|
+
len(outline),
|
183
|
+
)
|
184
|
+
except (
|
185
|
+
ValueError,
|
186
|
+
IndexError,
|
187
|
+
TypeError,
|
188
|
+
ArithmeticError,
|
189
|
+
) as e:
|
190
|
+
handle_room_outline_error(self.file_name, room_id, e)
|
191
|
+
outline = corners
|
192
|
+
|
193
|
+
# rand256 vacuums accept int(room_id) or str(name)
|
194
|
+
# the card will soon support int(room_id) but the camera will send name
|
195
|
+
# this avoids the manual change of the values in the card.
|
196
|
+
self.rooms_pos.append(
|
197
|
+
{
|
186
198
|
"name": name,
|
187
|
-
"
|
188
|
-
"y": (y_min + y_max) // 2,
|
199
|
+
"corners": corners,
|
189
200
|
}
|
190
|
-
# get the zones and points data
|
191
|
-
zone_properties = await self.async_zone_propriety(zones_data)
|
192
|
-
# get the points data
|
193
|
-
point_properties = await self.async_points_propriety(points_data)
|
194
|
-
if room_properties or zone_properties:
|
195
|
-
extracted_data = [
|
196
|
-
f"{len(room_properties)} Rooms" if room_properties else None,
|
197
|
-
f"{len(zone_properties)} Zones" if zone_properties else None,
|
198
|
-
]
|
199
|
-
extracted_data = ", ".join(filter(None, extracted_data))
|
200
|
-
_LOGGER.debug("Extracted data: %s", extracted_data)
|
201
|
-
else:
|
202
|
-
self.rooms_pos = None
|
203
|
-
_LOGGER.debug(
|
204
|
-
"%s: Rooms and Zones data not available!", self.file_name
|
205
201
|
)
|
206
|
-
|
207
|
-
|
208
|
-
|
202
|
+
room_properties[int(room_id)] = {
|
203
|
+
"number": int(room_id),
|
204
|
+
"outline": outline,
|
205
|
+
"name": name,
|
206
|
+
"x": (x_min + x_max) // 2,
|
207
|
+
"y": (y_min + y_max) // 2,
|
208
|
+
}
|
209
|
+
# get the zones and points data
|
210
|
+
zone_properties = await self.async_zone_propriety(zones_data)
|
211
|
+
# get the points data
|
212
|
+
point_properties = await self.async_points_propriety(points_data)
|
213
|
+
if room_properties or zone_properties:
|
214
|
+
extracted_data = [
|
215
|
+
f"{len(room_properties)} Rooms" if room_properties else None,
|
216
|
+
f"{len(zone_properties)} Zones" if zone_properties else None,
|
217
|
+
]
|
218
|
+
extracted_data = ", ".join(filter(None, extracted_data))
|
219
|
+
_LOGGER.debug("Extracted data: %s", extracted_data)
|
220
|
+
else:
|
221
|
+
self.rooms_pos = None
|
222
|
+
_LOGGER.debug(
|
223
|
+
"%s: Rooms and Zones data not available!", self.file_name
|
224
|
+
)
|
225
|
+
rooms = RoomStore(self.file_name, room_properties)
|
226
|
+
_LOGGER.debug("Rooms Data: %s", rooms.get_rooms())
|
227
|
+
return room_properties, zone_properties, point_properties
|
209
228
|
except (RuntimeError, ValueError) as e:
|
210
229
|
_LOGGER.debug(
|
211
230
|
"No rooms Data or Error in extract_room_properties: %s",
|
212
231
|
e,
|
213
232
|
exc_info=True,
|
214
233
|
)
|
215
|
-
return None, None, None
|
234
|
+
return None, None, None # Return empty data in case of error
|
216
235
|
|
217
236
|
async def get_image_from_rrm(
|
218
237
|
self,
|
@@ -271,6 +290,9 @@ class ReImageHandler(BaseHandler, AutoCrop):
|
|
271
290
|
)
|
272
291
|
return None
|
273
292
|
|
293
|
+
# If we reach here without returning, return None
|
294
|
+
return None
|
295
|
+
|
274
296
|
async def _setup_robot_and_image(
|
275
297
|
self, m_json, size_x, size_y, colors, destinations
|
276
298
|
):
|
@@ -340,20 +362,7 @@ class ReImageHandler(BaseHandler, AutoCrop):
|
|
340
362
|
img_np_array, m_json, colors["charger"]
|
341
363
|
)
|
342
364
|
# Update element map for charger position
|
343
|
-
|
344
|
-
charger_radius = 15
|
345
|
-
for dy in range(-charger_radius, charger_radius + 1):
|
346
|
-
for dx in range(-charger_radius, charger_radius + 1):
|
347
|
-
if dx * dx + dy * dy <= charger_radius * charger_radius:
|
348
|
-
cx, cy = (
|
349
|
-
int(self.charger_pos[0] + dx),
|
350
|
-
int(self.charger_pos[1] + dy),
|
351
|
-
)
|
352
|
-
if (
|
353
|
-
0 <= cy < self.element_map.shape[0]
|
354
|
-
and 0 <= cx < self.element_map.shape[1]
|
355
|
-
):
|
356
|
-
self.element_map[cy, cx] = DrawableElement.CHARGER
|
365
|
+
self._update_element_map_for_charger()
|
357
366
|
|
358
367
|
# Draw zones if enabled
|
359
368
|
if self.drawing_config.is_enabled(DrawableElement.RESTRICTED_AREA):
|
@@ -391,8 +400,9 @@ class ReImageHandler(BaseHandler, AutoCrop):
|
|
391
400
|
)
|
392
401
|
|
393
402
|
# Update element map for robot position
|
394
|
-
|
395
|
-
|
403
|
+
update_element_map_with_robot(
|
404
|
+
self.element_map, robot_position, DrawableElement.ROBOT
|
405
|
+
)
|
396
406
|
img_np_array = await self.async_auto_trim_and_zoom_image(
|
397
407
|
img_np_array,
|
398
408
|
detect_colour=colors["background"],
|
@@ -417,7 +427,7 @@ class ReImageHandler(BaseHandler, AutoCrop):
|
|
417
427
|
|
418
428
|
async def get_rooms_attributes(
|
419
429
|
self, destinations: JsonType = None
|
420
|
-
) -> RoomsProperties:
|
430
|
+
) -> tuple[RoomsProperties, Any, Any]:
|
421
431
|
"""Return the rooms attributes."""
|
422
432
|
if self.room_propriety:
|
423
433
|
return self.room_propriety
|
@@ -461,46 +471,57 @@ class ReImageHandler(BaseHandler, AutoCrop):
|
|
461
471
|
_LOGGER.debug("%s Changed room.. searching..", self.file_name)
|
462
472
|
room_count = -1
|
463
473
|
last_room = None
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
room_count += 1
|
470
|
-
self.robot_in_room = {
|
471
|
-
"id": room_count,
|
472
|
-
"left": corners[0][0],
|
473
|
-
"right": corners[2][0],
|
474
|
-
"up": corners[0][1],
|
475
|
-
"down": corners[2][1],
|
476
|
-
"room": room["name"],
|
477
|
-
}
|
478
|
-
# Check if the robot coordinates are inside the room's corners
|
479
|
-
if _check_robot_position(robot_x, robot_y):
|
480
|
-
temp = {
|
481
|
-
"x": robot_x,
|
482
|
-
"y": robot_y,
|
483
|
-
"angle": angle,
|
484
|
-
"in_room": self.robot_in_room["room"],
|
485
|
-
}
|
486
|
-
_LOGGER.debug(
|
487
|
-
"%s is in %s", self.file_name, self.robot_in_room["room"]
|
488
|
-
)
|
489
|
-
del room, corners, robot_x, robot_y # free memory.
|
490
|
-
return temp
|
491
|
-
del room, corners # free memory.
|
492
|
-
_LOGGER.debug(
|
493
|
-
"%s: Not located within Camera Rooms coordinates.", self.file_name
|
494
|
-
)
|
495
|
-
self.zooming = False
|
496
|
-
self.robot_in_room = last_room
|
497
|
-
temp = {
|
474
|
+
|
475
|
+
# If no rooms data is available, return a default position
|
476
|
+
if not self.rooms_pos:
|
477
|
+
_LOGGER.debug("%s: No rooms data available", self.file_name)
|
478
|
+
return {
|
498
479
|
"x": robot_x,
|
499
480
|
"y": robot_y,
|
500
481
|
"angle": angle,
|
501
|
-
"in_room":
|
482
|
+
"in_room": "unknown"
|
502
483
|
}
|
503
|
-
|
484
|
+
|
485
|
+
# If rooms data is available, search for the room
|
486
|
+
if self.robot_in_room:
|
487
|
+
last_room = self.robot_in_room
|
488
|
+
for room in self.rooms_pos:
|
489
|
+
corners = room["corners"]
|
490
|
+
room_count += 1
|
491
|
+
self.robot_in_room = {
|
492
|
+
"id": room_count,
|
493
|
+
"left": corners[0][0],
|
494
|
+
"right": corners[2][0],
|
495
|
+
"up": corners[0][1],
|
496
|
+
"down": corners[2][1],
|
497
|
+
"room": room["name"],
|
498
|
+
}
|
499
|
+
# Check if the robot coordinates are inside the room's corners
|
500
|
+
if _check_robot_position(robot_x, robot_y):
|
501
|
+
temp = {
|
502
|
+
"x": robot_x,
|
503
|
+
"y": robot_y,
|
504
|
+
"angle": angle,
|
505
|
+
"in_room": self.robot_in_room["room"],
|
506
|
+
}
|
507
|
+
_LOGGER.debug(
|
508
|
+
"%s is in %s", self.file_name, self.robot_in_room["room"]
|
509
|
+
)
|
510
|
+
del room, corners, robot_x, robot_y # free memory.
|
511
|
+
return temp
|
512
|
+
# After checking all rooms and not finding a match
|
513
|
+
_LOGGER.debug(
|
514
|
+
"%s: Not located within Camera Rooms coordinates.", self.file_name
|
515
|
+
)
|
516
|
+
self.zooming = False
|
517
|
+
self.robot_in_room = last_room
|
518
|
+
temp = {
|
519
|
+
"x": robot_x,
|
520
|
+
"y": robot_y,
|
521
|
+
"angle": angle,
|
522
|
+
"in_room": self.robot_in_room["room"] if self.robot_in_room else "unknown",
|
523
|
+
}
|
524
|
+
return temp
|
504
525
|
|
505
526
|
def get_calibration_data(self, rotation_angle: int = 0) -> Any:
|
506
527
|
"""Return the map calibration data."""
|
@@ -532,27 +553,47 @@ class ReImageHandler(BaseHandler, AutoCrop):
|
|
532
553
|
|
533
554
|
def disable_element(self, element_code: DrawableElement) -> None:
|
534
555
|
"""Disable drawing of a specific element."""
|
535
|
-
from .config.utils import manage_drawable_elements
|
536
556
|
manage_drawable_elements(self, "disable", element_code=element_code)
|
537
557
|
|
538
558
|
def set_elements(self, element_codes: list[DrawableElement]) -> None:
|
539
559
|
"""Enable only the specified elements, disable all others."""
|
540
|
-
from .config.utils import manage_drawable_elements
|
541
560
|
manage_drawable_elements(self, "set_elements", element_codes=element_codes)
|
542
561
|
|
543
562
|
def set_element_property(
|
544
563
|
self, element_code: DrawableElement, property_name: str, value
|
545
564
|
) -> None:
|
546
565
|
"""Set a drawing property for an element."""
|
547
|
-
|
548
|
-
|
566
|
+
manage_drawable_elements(
|
567
|
+
self,
|
568
|
+
"set_property",
|
569
|
+
element_code=element_code,
|
570
|
+
property_name=property_name,
|
571
|
+
value=value,
|
572
|
+
)
|
549
573
|
|
550
574
|
def get_element_at_position(self, x: int, y: int) -> DrawableElement:
|
551
575
|
"""Get the element code at a specific position."""
|
552
|
-
from .config.utils import get_element_at_position
|
553
576
|
return get_element_at_position(self.element_map, x, y)
|
554
577
|
|
555
578
|
def get_room_at_position(self, x: int, y: int) -> int:
|
556
579
|
"""Get the room ID at a specific position, or None if not a room."""
|
557
|
-
from .config.utils import get_room_at_position
|
558
580
|
return get_room_at_position(self.element_map, x, y, DrawableElement.ROOM_1)
|
581
|
+
|
582
|
+
def _update_element_map_for_charger(self):
|
583
|
+
"""Helper method to update the element map for the charger position."""
|
584
|
+
if not self.charger_pos or self.element_map is None:
|
585
|
+
return
|
586
|
+
|
587
|
+
charger_radius = 15
|
588
|
+
# Handle both dictionary format {'x': x, 'y': y} and list format [x, y]
|
589
|
+
charger_x = self.charger_pos.get('x') if isinstance(self.charger_pos, dict) else self.charger_pos[0]
|
590
|
+
charger_y = self.charger_pos.get('y') if isinstance(self.charger_pos, dict) else self.charger_pos[1]
|
591
|
+
|
592
|
+
for dy in range(-charger_radius, charger_radius + 1):
|
593
|
+
for dx in range(-charger_radius, charger_radius + 1):
|
594
|
+
# Check if the point is within the circular charger area
|
595
|
+
if dx * dx + dy * dy <= charger_radius * charger_radius:
|
596
|
+
cx, cy = int(charger_x + dx), int(charger_y + dy)
|
597
|
+
# Check if the coordinates are within the element map bounds
|
598
|
+
if (0 <= cy < self.element_map.shape[0] and 0 <= cx < self.element_map.shape[1]):
|
599
|
+
self.element_map[cy, cx] = DrawableElement.CHARGER
|
@@ -0,0 +1,62 @@
|
|
1
|
+
"""Utility functions for color operations in the map parser."""
|
2
|
+
|
3
|
+
from typing import Tuple, Optional
|
4
|
+
|
5
|
+
from ..config.colors import ColorsManagment
|
6
|
+
from ..config.drawable_elements import ElementMapGenerator, DrawableElement
|
7
|
+
|
8
|
+
|
9
|
+
def get_blended_color(
|
10
|
+
element_map_generator: ElementMapGenerator,
|
11
|
+
colors_manager: ColorsManagment,
|
12
|
+
x: int,
|
13
|
+
y: int,
|
14
|
+
new_element: DrawableElement,
|
15
|
+
new_color: Tuple[int, int, int, int]
|
16
|
+
) -> Tuple[int, int, int, int]:
|
17
|
+
"""
|
18
|
+
Get a blended color for a pixel based on the current element map and the new element to draw.
|
19
|
+
|
20
|
+
This function:
|
21
|
+
1. Gets the current element at position (x,y) from the element map
|
22
|
+
2. Gets the color for that element from the colors manager
|
23
|
+
3. Blends the new color with the existing color based on alpha values
|
24
|
+
|
25
|
+
Args:
|
26
|
+
element_map_generator: The element map generator containing the current element map
|
27
|
+
colors_manager: The colors manager to get colors for elements
|
28
|
+
x: X coordinate in the element map
|
29
|
+
y: Y coordinate in the element map
|
30
|
+
new_element: The new element to draw at this position
|
31
|
+
new_color: The RGBA color of the new element
|
32
|
+
|
33
|
+
Returns:
|
34
|
+
Blended RGBA color to use for drawing
|
35
|
+
"""
|
36
|
+
# Get current element at this position
|
37
|
+
current_element = element_map_generator.get_element_at_position(x, y)
|
38
|
+
|
39
|
+
# If no current element or it's the same as the new element, just return the new color
|
40
|
+
if current_element is None or current_element == new_element:
|
41
|
+
return new_color
|
42
|
+
|
43
|
+
# Get color for the current element
|
44
|
+
current_color = None
|
45
|
+
|
46
|
+
# Handle different element types
|
47
|
+
if current_element == DrawableElement.FLOOR:
|
48
|
+
# Floor is the background color
|
49
|
+
current_color = colors_manager.get_colour("color_background")
|
50
|
+
elif current_element == DrawableElement.WALL:
|
51
|
+
# Wall color
|
52
|
+
current_color = colors_manager.get_colour("color_wall")
|
53
|
+
elif DrawableElement.ROOM_1 <= current_element <= DrawableElement.ROOM_15:
|
54
|
+
# Room colors (ROOM_1 = 16, ROOM_2 = 17, etc.)
|
55
|
+
room_index = current_element - DrawableElement.ROOM_1
|
56
|
+
current_color = colors_manager.get_colour(f"color_room_{room_index}")
|
57
|
+
else:
|
58
|
+
# Default for unknown elements
|
59
|
+
current_color = (100, 100, 100, 255)
|
60
|
+
|
61
|
+
# Blend the colors
|
62
|
+
return colors_manager.blend_colors(current_color, new_color)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: valetudo-map-parser
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.9b45
|
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
|
@@ -12,6 +12,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.13
|
13
13
|
Requires-Dist: Pillow (>=10.3.0)
|
14
14
|
Requires-Dist: numpy (>=1.26.4)
|
15
|
+
Requires-Dist: scipy (>=1.12.0)
|
15
16
|
Project-URL: Bug Tracker, https://github.com/sca075/Python-package-valetudo-map-parser/issues
|
16
17
|
Project-URL: Changelog, https://github.com/sca075/Python-package-valetudo-map-parser/releases
|
17
18
|
Project-URL: Homepage, https://github.com/sca075/Python-package-valetudo-map-parser
|
@@ -0,0 +1,27 @@
|
|
1
|
+
valetudo_map_parser/__init__.py,sha256=INujZn4exaXUjqMN8nZkGJIziDWlW59t65fJ34HJX44,956
|
2
|
+
valetudo_map_parser/config/__init__.py,sha256=DQ9plV3ZF_K25Dp5ZQHPDoG-40dQoJNdNi-dfNeR3Zc,48
|
3
|
+
valetudo_map_parser/config/auto_crop.py,sha256=6OvRsWzXMXBaSEvgwpaaisNdozDKiDyTmPjknFxoUMc,12624
|
4
|
+
valetudo_map_parser/config/colors.py,sha256=ARSijOKRY5M_o_Pm1gHODJn2WOj7QL8C2cUNR-0EKc0,9566
|
5
|
+
valetudo_map_parser/config/colors_man.py,sha256=9b5c6XmpMzhEiunwfIjVkOk1lDyV-UFoasACdkGXfbo,7833
|
6
|
+
valetudo_map_parser/config/drawable.py,sha256=gKh9hSHMxqAb4phoehR_X4lembbRrTfiMuQ0wWq_AsI,21800
|
7
|
+
valetudo_map_parser/config/drawable_elements.py,sha256=oBhmhkx1SpzTtbnpZBB2Hd5U2mOIbo7908J8oM38XiY,40841
|
8
|
+
valetudo_map_parser/config/enhanced_drawable.py,sha256=xNgFUNccstP245VgLFEA9gjB3-VvlSAJSjRgSZ3YFL0,16641
|
9
|
+
valetudo_map_parser/config/optimized_element_map.py,sha256=XV1xi-oa8uNTrzFUxHWF8MFP2X-jKJw3SV7HU10lWE4,15514
|
10
|
+
valetudo_map_parser/config/rand25_parser.py,sha256=kIayyqVZBfQfAMkiArzqrrj9vqZB3pkgT0Y5ufrQmGA,16448
|
11
|
+
valetudo_map_parser/config/room_outline.py,sha256=nGpRs1f1vE_63XL1i6DdHtfwJmnC3WayIjVsFgzfOj8,4928
|
12
|
+
valetudo_map_parser/config/shared.py,sha256=WSl5rYSiTqE6YGAiwi9RILMZIQdFZRzVS8DwqzTZBbw,11309
|
13
|
+
valetudo_map_parser/config/types.py,sha256=uEJY-yYHHJWW3EZjg7hERSFrC2XuKzzRGT3C0z31Aw0,18359
|
14
|
+
valetudo_map_parser/config/utils.py,sha256=MP5_s9VFSdDERymujvDuGB8nYCXVuJcqg5tR5H9HCgY,33167
|
15
|
+
valetudo_map_parser/hypfer_draw.py,sha256=oL_RbX0LEcPvOlMrfBA38qpJkMqqVwR-oAEbZeHqLWM,19898
|
16
|
+
valetudo_map_parser/hypfer_handler.py,sha256=H4-vzv9cTJctq4RXin5V6L1uXy2rZYIQkd8gO4265NU,27260
|
17
|
+
valetudo_map_parser/map_data.py,sha256=2NfZ0OO20OQPNrzditxaQV-8zSEEJclbD_CtH84HEA0,19121
|
18
|
+
valetudo_map_parser/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
|
+
valetudo_map_parser/rand25_handler.py,sha256=d5NXK4TH4mlkZ5dNmhqWHgL4FauEUmDFz2L8XeHsKhk,24656
|
20
|
+
valetudo_map_parser/reimg_draw.py,sha256=1q8LkNTPHEA9Tsapc_JnVw51kpPYNhaBU-KmHkefCQY,12507
|
21
|
+
valetudo_map_parser/utils/__init__.py,sha256=r-GKKSPqBkMDd2K-vWe7kAix8OBrGN5HXC1RS2tbDwo,130
|
22
|
+
valetudo_map_parser/utils/color_utils.py,sha256=7t-o4oHddE5U0A9ahYBqBKmT0B2VFe_GlQ7cnLs41Us,2425
|
23
|
+
valetudo_map_parser-0.1.9b45.dist-info/LICENSE,sha256=Lh-qBbuRV0-jiCIBhfV7NgdwFxQFOXH3BKOzK865hRs,10480
|
24
|
+
valetudo_map_parser-0.1.9b45.dist-info/METADATA,sha256=9jDQzZXjZiha6PUbwpH9AUthH4SuY9PPXOm6mIGwSOY,3321
|
25
|
+
valetudo_map_parser-0.1.9b45.dist-info/NOTICE.txt,sha256=5lTOuWiU9aiEnJ2go8sc7lTJ7ntMBx0g0GFnNrswCY4,2533
|
26
|
+
valetudo_map_parser-0.1.9b45.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
27
|
+
valetudo_map_parser-0.1.9b45.dist-info/RECORD,,
|
@@ -1,23 +0,0 @@
|
|
1
|
-
valetudo_map_parser/__init__.py,sha256=INujZn4exaXUjqMN8nZkGJIziDWlW59t65fJ34HJX44,956
|
2
|
-
valetudo_map_parser/config/__init__.py,sha256=DQ9plV3ZF_K25Dp5ZQHPDoG-40dQoJNdNi-dfNeR3Zc,48
|
3
|
-
valetudo_map_parser/config/auto_crop.py,sha256=6OvRsWzXMXBaSEvgwpaaisNdozDKiDyTmPjknFxoUMc,12624
|
4
|
-
valetudo_map_parser/config/colors.py,sha256=IzTT9JvF12YGGJxaTiEJRuwUdCCsFCLzsR9seCDfYWs,6515
|
5
|
-
valetudo_map_parser/config/colors_man.py,sha256=9b5c6XmpMzhEiunwfIjVkOk1lDyV-UFoasACdkGXfbo,7833
|
6
|
-
valetudo_map_parser/config/drawable.py,sha256=kTqAC6MKvUe5KbncuHpqnILxtkdxkpU_vESPdbAVXVs,18419
|
7
|
-
valetudo_map_parser/config/drawable_elements.py,sha256=KzXKxJjsNf06e-cUVatSX5uwsn9OkGEIlOq7Li3n9aA,12119
|
8
|
-
valetudo_map_parser/config/enhanced_drawable.py,sha256=ehn0mXdpzHLQEamHE2rBdRv_xXWwfd9gvM5ndgDnoMQ,16825
|
9
|
-
valetudo_map_parser/config/rand25_parser.py,sha256=kIayyqVZBfQfAMkiArzqrrj9vqZB3pkgT0Y5ufrQmGA,16448
|
10
|
-
valetudo_map_parser/config/shared.py,sha256=GIEMF-M6BVA6SFBrql7chV7TciWNMLJ8geqwHB0NrW8,11253
|
11
|
-
valetudo_map_parser/config/types.py,sha256=uEJY-yYHHJWW3EZjg7hERSFrC2XuKzzRGT3C0z31Aw0,18359
|
12
|
-
valetudo_map_parser/config/utils.py,sha256=RJ5GI4sSyMJN8JVi1mafDZ3DX2IUBuR2bKjLpH_bNp4,33368
|
13
|
-
valetudo_map_parser/hypfer_draw.py,sha256=HymZVqRrvoIUt5MVWYp4jzY5KD9U_U5F8f82SWXoO58,20042
|
14
|
-
valetudo_map_parser/hypfer_handler.py,sha256=M-rIoXMcqYYsWw0iGulEeXGDi-a9K8KLUa8IMBxdZ9M,28164
|
15
|
-
valetudo_map_parser/map_data.py,sha256=zRKa5r_mV67m_APWBN6VAtdi8D5aBwFthEgKeoFBa9w,19473
|
16
|
-
valetudo_map_parser/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
|
-
valetudo_map_parser/rand25_handler.py,sha256=ia-cwVHUwkV8OMm36mvFJRBa7bsKFM9T7NrcpmILhYM,23968
|
18
|
-
valetudo_map_parser/reimg_draw.py,sha256=1q8LkNTPHEA9Tsapc_JnVw51kpPYNhaBU-KmHkefCQY,12507
|
19
|
-
valetudo_map_parser-0.1.9b43.dist-info/LICENSE,sha256=Lh-qBbuRV0-jiCIBhfV7NgdwFxQFOXH3BKOzK865hRs,10480
|
20
|
-
valetudo_map_parser-0.1.9b43.dist-info/METADATA,sha256=laAJsOpHGG3LppeMizLNoljVOfAnHXzbCdaXjr0NQYc,3289
|
21
|
-
valetudo_map_parser-0.1.9b43.dist-info/NOTICE.txt,sha256=5lTOuWiU9aiEnJ2go8sc7lTJ7ntMBx0g0GFnNrswCY4,2533
|
22
|
-
valetudo_map_parser-0.1.9b43.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
23
|
-
valetudo_map_parser-0.1.9b43.dist-info/RECORD,,
|
File without changes
|
{valetudo_map_parser-0.1.9b43.dist-info → valetudo_map_parser-0.1.9b45.dist-info}/NOTICE.txt
RENAMED
File without changes
|
File without changes
|