@@ -53,18 +53,13 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t
53
53
//| When brightness is less than 1.0, a second buffer will be used to store the color values
54
54
//| before they are adjusted for brightness.
55
55
//|
56
- //| When ``P`` (pwm duration) is present as the 4th character of the byteorder
56
+ //| When ``P`` (PWM duration) is present as the 4th character of the byteorder
57
57
//| string, the 4th value in the tuple/list for a pixel is the individual pixel
58
- //| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte in the
59
- //| output buffer (``buf``).
60
- //|
61
- //| When ``P`` (pwm duration) is present as the first character of the byteorder
62
- //| string, the 4th value in the tuple/list for a pixel is the individual pixel
63
- //| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte in the
64
- //| output buffer (``buf``).
58
+ //| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte for each
59
+ //| pixel.
65
60
//|
66
61
//| :param ~int size: Number of pixels
67
- //| :param ~str byteorder: Byte order string (such as "BGR " or "PBGR")
62
+ //| :param ~str byteorder: Byte order string (such as "RGB", "RGBW " or "PBGR")
68
63
//| :param ~float brightness: Brightness (0 to 1.0, default 1.0)
69
64
//| :param ~bool auto_write: Whether to automatically write pixels (Default False)
70
65
//| :param bytes header: Sequence of bytes to always send before pixel values.
@@ -276,13 +271,16 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(pixelbuf_pixelbuf_fill_obj, pixelbuf_pixelbuf_f
276
271
277
272
//| def __getitem__(self, index: Any) -> Any:
278
273
//| """Returns the pixel value at the given index as a tuple of (Red, Green, Blue[, White]) values
279
- //| between 0 and 255."""
274
+ //| between 0 and 255. When in PWM (DotStar) mode, the 4th tuple value is a float of the pixel
275
+ //| intensity from 0-1.0."""
280
276
//| ...
281
277
//|
282
278
//| def __setitem__(self, index: Any, value: Any) -> Any:
283
- //| """Sets the pixel value at the given index. Value can either be a tuple of (Red, Green, Blue
284
- //| [, White]) values between 0 and 255 or an integer where the red, green and blue values are
285
- //| packed into the lower three bytes (0xRRGGBB)."""
279
+ //| """Sets the pixel value at the given index. Value can either be a tuple or integer. Tuples are
280
+ //| The individual (Red, Green, Blue[, White]) values between 0 and 255. If given an integer, the
281
+ //| red, green and blue values are packed into the lower three bytes (0xRRGGBB).
282
+ //| For RGBW byteorders, if given only RGB values either as an int or as a tuple, the white value
283
+ //| is used instead when the red, green, and blue values are the same."""
286
284
//| ...
287
285
//|
288
286
STATIC mp_obj_t pixelbuf_pixelbuf_subscr (mp_obj_t self_in , mp_obj_t index_in , mp_obj_t value ) {
0 commit comments