bibliopixel.layout.layout module

class bibliopixel.layout.layout.Layout(drivers, threadedUpdate=False, brightness=255, maker=<bibliopixel.project.data_maker.Maker object>, color_list=None, **kwds)[source]

Bases: object

Base Layer class. Use Strip, Matrix, Cube, or Circle instead!

Parameters:
  • drivers – A list of drivers
  • threadedUpdate – If True, updates to this layout are done in a separate thread
  • brightness – An initial brightness value from 0 to 255
  • maker – A data maker to make color_lists. TODO: Link to what a maker is.
  • color_list – If non-Null, the layout uses this color_list instead of creating its own
Variables:

numLEDs (int) – Total number of pixels held by this layout instance

CLONE_ATTRS = ('maker', 'brightness')
all_off()[source]

Set all pixels off

cleanup()[source]
cleanup_drivers()[source]
clone()[source]

Return an independent copy of this layout with a completely separate color_list and no drivers.

color_list
classmethod construct(project, **desc)[source]

Construct a layout. SHOULD BE PRIVATE

dimensions
fill(color, start=0, end=-1)[source]

Fill the entire strip with RGB color tuple

fillHSV(hsv, start=0, end=-1)[source]

Fill the entire strip with HSV color tuple

fillRGB(r, g, b, start=0, end=-1)[source]

Fill entire strip by giving individual RGB values instead of tuple

get_pixel_positions()[source]
join(timeout=None)[source]
pre_recursion()
push_to_driver()[source]

Push the current pixel state to the driver Do not call this method from user code!

setHSV(pixel, hsv)[source]

Set single pixel to HSV tuple

setOff(pixel)[source]

Set single pixel off

setRGB(pixel, r, g, b)[source]

Set single pixel using individual RGB values instead of tuple

set_brightness(brightness)[source]
set_color_list(color_list, offset=0)[source]

Set the internal colors starting at an optional offset.

If color_list is a list or other 1-dimensional array, it is reshaped into an N x 3 list.

If color_list too long it is truncated; if it is too short then only the initial colors are set.

set_pixel_positions(pixel_positions)[source]

SHOULD BE PRIVATE

shape

Return a tuple indicating the dimensions of the layout - (x,) for a strip, (x, y) for an array, (x, y, z) for a cube, and (ring_count, ring_steps) for a circle.

start()[source]
stop()[source]
update()[source]

DEPRECATED: Use push_to_driver() instead Do not call this method from user code!

class bibliopixel.layout.layout.MultiLayout(*args, gen_coord_map=None, coord_map=None, **kwds)[source]

Bases: bibliopixel.layout.layout.Layout

CLONE_ATTRS = ('maker', 'brightness', 'gen_coord_map', 'coord_map')
gen_multi(*args, **kwds)[source]
setBuffer(buf)[source]
set_colors(buf)[source]

DEPRECATED: use self.color_list

Use with extreme caution! Directly sets the internal buffer and bypasses all brightness and rotation control buf must also be in the exact format required by the display type.