ImageMask(width=-1, height=-1, polygons=[], url=None, style=None)
Example
from mirmod.controls import ImageMask
import json
style = json.dumps({
"point_color": "#f01010",
"line_color": "#e21010",
"surface_color": "#ff000033"
})
@wob.receiver("value", "mask", control=ImageMask(style=style), hidden=True, connectable=False)
def receive_mask(self, value):
self.mask_data = value
Parameters
| Name | Type | Description |
|---|---|---|
| width | int | Display width in pixels. Use -1 for automatic sizing. Default: -1. |
| height | int | Display height in pixels. Use -1 for automatic sizing. Default: -1. |
| polygons | list | Initial polygon data. Each polygon is an object with polygons (list of {x, y} points in normalized 0-1 coordinates) and labels (list of strings). |
| url | string | URL of the image to annotate. |
| style | string | JSON string defining annotation colors: point_color, line_color, and surface_color. |