Hardware
- class ledsign.LEDSignHardware
Read-only representation of a
LEDSigndevice’s hardware, returned byLEDSign.get_hardware().- get_raw() bytes
Returns the raw, 8-byte hardware configuration sequence returned by the device.
- get_string() str
Returns a pretty-printed version of the raw device hardware configuration returned by
get_raw().
- get_user_string() str
Returns a user-friendly string identifying the device’s hardware configuration.
- class ledsign.LEDSignSelector
This static class contains several common pattern generators, to be used within a
LEDSignProgramBuildercontext.Every method accepts an optional
hardwareargument, which when omitted will default to the one used by the currentLEDSignProgramBuilderinstance (if a program builder is currently active).- static get_bounding_box(mask: int = -1, hardware: LEDSignHardware | None = None) tuple[float, float, float, float]
Returns the bounding box
(sx, sy, ex, ey)of all pixels selected bymask. If no mask is given, the bounding box of all pixels is computed.
- static get_center(mask: int = -1, weighted: bool = False, hardware: LEDSignHardware | None = None) tuple[float, float]
Returns the center
(cx, cy)of all pixels selected bymask. If no mask is given, the bounding box of all pixels is computed.If the
weightedflag is set, the center is weighted across all pixels locations. Otherwise, the center of the bounding box returned byget_bounding_box()is calculated.
- static get_circle_mask(cx: int | float, cy: int | float, r: int | float, mask: int = -1, hardware: LEDSignHardware | None = None) int
Returns a mask selecting all pixels within the circle centered at
(cx, cy)with radiusr, selected by the providedmask. If no mask is given, the all pixels are processed.
- static get_led_depth(hardware: LEDSignHardware | None = None) int
Returns the longest LED chain present in the current hardware configuration.
- static get_letter_count(hardware: LEDSignHardware | None = None) int
Returns the number of letters in the current hardware configuration.
- static get_letter_mask(index: int, hardware: LEDSignHardware | None = None) int
Returns the pixel mask corresponding to the letter selected by
index. Raises anIndexErrorif the index is out of bounds.
- static get_letter_masks(hardware: LEDSignHardware | None = None) Iterator[tuple[int, str, int]]
Returns all letter
(index, character, mask)tuples of the current hardware configuration.
- static get_mask(hardware: LEDSignHardware | None = None) int
Returns a mask selecting all pixels.
- static get_pixels(mask: int = -1, letter: int | None = None, hardware: LEDSignHardware | None = None) Iterator[tuple[float, float, int]]
Returns all pixel
(x, y, mask)tuples selected bymask. If no mask is given, the bounding box of all pixels is computed.If the
letterindex is given, only pixels from the given letter are processed.