Skip to content

Commit a367e84

Browse files
committed
update docstrings
1 parent 227ac67 commit a367e84

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

shared-bindings/bitmaptools/__init__.c

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -361,21 +361,20 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_draw_line_obj, 0, bitmaptools_obj_draw_li
361361
//| def arrayblit(bitmap: display.Bitmap, data: ReadableBuffer, x1: int=0, y1: int=0, x2: Optional[int]=None, y2: Optional[int]=None, skip_index:Optional[int]=None) -> None:
362362
//| """Inserts pixels from ``data`` into the rectangle of width×height pixels with the upper left corner at ``(x,y)``
363363
//|
364-
//| The values from ``data`` are taken modulo the number of color values
365-
//| avalable in the destintaion bitmap.
364+
//| The values from ``data`` are taken modulo the number of color values
365+
//| avalable in the destintaion bitmap.
366366
//|
367-
//| If x1 or y1 are not specified, they are taken as 0. If x2 or y2
368-
//| are not specified, or are given as -1, they are taken as the width
369-
//| and height of the image.
367+
//| If x1 or y1 are not specified, they are taken as 0. If x2 or y2
368+
//| are not specified, or are given as -1, they are taken as the width
369+
//| and height of the image.
370370
//|
371-
//| The coordinates affected by the blit are ``x1 <= x < x2`` and ``y1 <
372-
//| y < y2``.
371+
//| The coordinates affected by the blit are ``x1 <= x < x2`` and ``y1 <= y < y2``.
373372
//|
374-
//| ``data`` must contain at least as many elements as required. If it
375-
//| contains excess elements, they are ignored.
373+
//| ``data`` must contain at least as many elements as required. If it
374+
//| contains excess elements, they are ignored.
376375
//|
377-
//| The blit takes place by rows, so the first elements of ``data`` go
378-
//| to the first row, the next elements to the next row, and so on.
376+
//| The blit takes place by rows, so the first elements of ``data`` go
377+
//| to the first row, the next elements to the next row, and so on.
379378
//|
380379
//| :param displayio.Bitmap bitmap: A writable bitmap
381380
//| :param ReadableBuffer data: Buffer containing the source pixel values
@@ -385,7 +384,6 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_draw_line_obj, 0, bitmaptools_obj_draw_li
385384
//| :param int y2: The bottom corner of the area to blit into (exclusive)
386385
//| :param int skip_index: Bitmap palette index in the source that will not be copied,
387386
//| set to None to copy all pixels"""
388-
//| """
389387
//| ...
390388
//|
391389
STATIC mp_obj_t bitmaptools_arrayblit(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
@@ -438,20 +436,21 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_arrayblit_obj, 0, bitmaptools_arrayblit);
438436

439437

440438
//| def readinto(bitmap: displayio.Bitmap, file: typing.BinaryIO, bits_per_pixel: int, element_size: int = 1, reverse_pixels_in_element: bool = False, swap_bytes_in_element: bool = False) -> None:
441-
//| """Read from a binary file into a bitmap
442-
//| The file must be positioned so that it consists of ``bitmap.height`` rows of pixel data, where each row is the smallest multiple of ``element_size`` bytes that can hold ``bitmap.width`` pixels.
439+
//| """Reads from a binary file into a bitmap.
443440
//|
444-
//| The bytes in an element can be optionally swapped, and the pixels in an element can be reversed.
441+
//| The file must be positioned so that it consists of ``bitmap.height`` rows of pixel data, where each row is the smallest multiple of ``element_size`` bytes that can hold ``bitmap.width`` pixels.
445442
//|
446-
//| This function doesn't parse image headers, but is useful to speed up loading of uncompressed image formats such as PCF glyph data.
443+
//| The bytes in an element can be optionally swapped, and the pixels in an element can be reversed.
444+
//|
445+
//| This function doesn't parse image headers, but is useful to speed up loading of uncompressed image formats such as PCF glyph data.
447446
//|
448447
//| :param displayio.Bitmap bitmap: A writable bitmap
449448
//| :param typing.BinaryIO file: A file opened in binary mode
450449
//| :param int bits_per_pixel: Number of bits per pixel. Values 1, 2, 4, 8, 16, 24, and 32 are supported;
451450
//| :param int element_size: Number of bytes per element. Values of 1, 2, and 4 are supported, except that 24 ``bits_per_pixel`` requires 1 byte per element.
452451
//| :param bool reverse_pixels_in_element: If set, the first pixel in a word is taken from the Most Signficant Bits; otherwise, it is taken from the Least Significant Bits.
453452
//| :param bool swap_bytes_in_element: If the ``element_size`` is not 1, then reverse the byte order of each element read.
454-
//| """
453+
//| :param bool reverse_rows: Reverse the direction of the row loading."""
455454
//| ...
456455
//|
457456

0 commit comments

Comments
 (0)