Added type hints to displayio
This commit is contained in:
parent
9b4ffc0571
commit
783cc4de39
@ -73,7 +73,7 @@ STATIC mp_obj_t displayio_bitmap_make_new(const mp_obj_type_t *type, size_t n_ar
|
||||
|
||||
return MP_OBJ_FROM_PTR(self);
|
||||
}
|
||||
//| width: Any = ...
|
||||
//| width: int = ...
|
||||
//| """Width of the bitmap. (read only)"""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_bitmap_obj_get_width(mp_obj_t self_in) {
|
||||
@ -91,7 +91,7 @@ const mp_obj_property_t displayio_bitmap_width_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| height: Any = ...
|
||||
//| height: int = ...
|
||||
//| """Height of the bitmap. (read only)"""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_bitmap_obj_get_height(mp_obj_t self_in) {
|
||||
@ -109,7 +109,7 @@ const mp_obj_property_t displayio_bitmap_height_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| def __getitem__(self, index: Any) -> Any:
|
||||
//| def __getitem__(self, index: Union[Tuple[int, int], int]) -> int:
|
||||
//| """Returns the value at the given index. The index can either be an x,y tuple or an int equal
|
||||
//| to ``y * width + x``.
|
||||
//|
|
||||
@ -118,7 +118,7 @@ const mp_obj_property_t displayio_bitmap_height_obj = {
|
||||
//| print(bitmap[0,1])"""
|
||||
//| ...
|
||||
//|
|
||||
//| def __setitem__(self, index: Any, value: Any) -> Any:
|
||||
//| def __setitem__(self, index: Union[Tuple[int, int], int], value: int) -> None:
|
||||
//| """Sets the value at the given index. The index can either be an x,y tuple or an int equal
|
||||
//| to ``y * width + x``.
|
||||
//|
|
||||
@ -172,7 +172,7 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val
|
||||
return mp_const_none;
|
||||
}
|
||||
|
||||
//| def fill(self, value: Any) -> Any:
|
||||
//| def fill(self, value: int) -> None:
|
||||
//| """Fills the bitmap with the supplied palette index value."""
|
||||
//| ...
|
||||
//|
|
||||
|
@ -65,7 +65,7 @@ STATIC mp_obj_t displayio_colorconverter_make_new(const mp_obj_type_t *type, siz
|
||||
return MP_OBJ_FROM_PTR(self);
|
||||
}
|
||||
|
||||
//| def convert(self, color: Any) -> Any:
|
||||
//| def convert(self, color: int) -> int:
|
||||
//| """Converts the given RGB888 color to RGB565"""
|
||||
//| ...
|
||||
//|
|
||||
@ -84,7 +84,7 @@ STATIC mp_obj_t displayio_colorconverter_obj_convert(mp_obj_t self_in, mp_obj_t
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_convert_obj, displayio_colorconverter_obj_convert);
|
||||
|
||||
//| dither: Any = ...
|
||||
//| dither: bool = ...
|
||||
//| """When true the color converter dithers the output by adding random noise when
|
||||
//| truncating to display bitdepth"""
|
||||
//|
|
||||
|
@ -49,7 +49,7 @@
|
||||
//| Most people should not use this class directly. Use a specific display driver instead that will
|
||||
//| contain the initialization sequence at minimum."""
|
||||
//|
|
||||
//| def __init__(self, display_bus: Any, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: microcontroller.Pin = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60):
|
||||
//| def __init__(self, display_bus: displayio, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: microcontroller.Pin = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60):
|
||||
//| r"""Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`).
|
||||
//|
|
||||
//| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a
|
||||
@ -188,7 +188,7 @@ static displayio_display_obj_t* native_display(mp_obj_t display_obj) {
|
||||
return MP_OBJ_TO_PTR(native_display);
|
||||
}
|
||||
|
||||
//| def show(self, group: Group) -> Any:
|
||||
//| def show(self, group: Group) -> None:
|
||||
//| """Switches to displaying the given group of layers. When group is None, the default
|
||||
//| CircuitPython terminal will be shown.
|
||||
//|
|
||||
@ -210,7 +210,7 @@ STATIC mp_obj_t displayio_display_obj_show(mp_obj_t self_in, mp_obj_t group_in)
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show);
|
||||
|
||||
//| def refresh(self, *, target_frames_per_second: int = 60, minimum_frames_per_second: int = 1) -> Any:
|
||||
//| def refresh(self, *, target_frames_per_second: int = 60, minimum_frames_per_second: int = 1) -> bool:
|
||||
//| """When auto refresh is off, waits for the target frame rate and then refreshes the display,
|
||||
//| returning True. If the call has taken too long since the last refresh call for the given
|
||||
//| target frame rate, then the refresh returns False immediately without updating the screen to
|
||||
@ -245,7 +245,7 @@ STATIC mp_obj_t displayio_display_obj_refresh(size_t n_args, const mp_obj_t *pos
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(displayio_display_refresh_obj, 1, displayio_display_obj_refresh);
|
||||
|
||||
//| auto_refresh: Any = ...
|
||||
//| auto_refresh: None = ...
|
||||
//| """True when the display is refreshed automatically."""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_display_obj_get_auto_refresh(mp_obj_t self_in) {
|
||||
@ -270,7 +270,7 @@ const mp_obj_property_t displayio_display_auto_refresh_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| brightness: Any = ...
|
||||
//| brightness: float = ...
|
||||
//| """The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When
|
||||
//| `auto_brightness` is True, the value of `brightness` will change automatically.
|
||||
//| If `brightness` is set, `auto_brightness` will be disabled and will be set to False."""
|
||||
@ -307,7 +307,7 @@ const mp_obj_property_t displayio_display_brightness_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| auto_brightness: Any = ...
|
||||
//| auto_brightness: Optional[bool] = ...
|
||||
//| """True when the display brightness is adjusted automatically, based on an ambient
|
||||
//| light sensor or other method. Note that some displays may have this set to True by default,
|
||||
//| but not actually implement automatic brightness adjustment. `auto_brightness` is set to False
|
||||
@ -338,7 +338,7 @@ const mp_obj_property_t displayio_display_auto_brightness_obj = {
|
||||
|
||||
|
||||
|
||||
//| width: Any = ...
|
||||
//| width: int = ...
|
||||
//| Gets the width of the board
|
||||
//|
|
||||
//|
|
||||
@ -355,7 +355,7 @@ const mp_obj_property_t displayio_display_width_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| height: Any = ...
|
||||
//| height: int = ...
|
||||
//| """Gets the height of the board"""
|
||||
//|
|
||||
//|
|
||||
@ -372,7 +372,7 @@ const mp_obj_property_t displayio_display_height_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| rotation: Any = ...
|
||||
//| rotation: Optional[int] = ...
|
||||
//| """The rotation of the display as an int in degrees."""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_display_obj_get_rotation(mp_obj_t self_in) {
|
||||
@ -395,7 +395,7 @@ const mp_obj_property_t displayio_display_rotation_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| bus: Any = ...
|
||||
//| bus: displayio = ...
|
||||
//| """The bus being used by the display"""
|
||||
//|
|
||||
//|
|
||||
@ -413,7 +413,7 @@ const mp_obj_property_t displayio_display_bus_obj = {
|
||||
};
|
||||
|
||||
|
||||
//| def fill_row(self, y: int, buffer: bytearray) -> Any:
|
||||
//| def fill_row(self, y: int, buffer: WriteableBuffer) -> bytearray:
|
||||
//| """Extract the pixels from a single row
|
||||
//|
|
||||
//| :param int y: The top edge of the area
|
||||
|
@ -49,7 +49,7 @@
|
||||
//| Most people should not use this class directly. Use a specific display driver instead that will
|
||||
//| contain the startup and shutdown sequences at minimum."""
|
||||
//|
|
||||
//| def __init__(self, display_bus: Any, start_sequence: buffer, stop_sequence: buffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: int = None, set_row_window_command: int = None, single_byte_bounds: Any = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: int = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: microcontroller.Pin = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False):
|
||||
//| def __init__(self, display_bus: displayio, start_sequence: buffer, stop_sequence: buffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: int = None, set_row_window_command: int = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: int = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: microcontroller.Pin = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False):
|
||||
//| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`).
|
||||
//|
|
||||
//| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every
|
||||
@ -168,7 +168,7 @@ static displayio_epaperdisplay_obj_t* native_display(mp_obj_t display_obj) {
|
||||
return MP_OBJ_TO_PTR(native_display);
|
||||
}
|
||||
|
||||
//| def show(self, group: Group) -> Any:
|
||||
//| def show(self, group: Group) -> None:
|
||||
//| """Switches to displaying the given group of layers. When group is None, the default
|
||||
//| CircuitPython terminal will be shown.
|
||||
//|
|
||||
@ -190,7 +190,7 @@ STATIC mp_obj_t displayio_epaperdisplay_obj_show(mp_obj_t self_in, mp_obj_t grou
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_2(displayio_epaperdisplay_show_obj, displayio_epaperdisplay_obj_show);
|
||||
|
||||
//| def refresh(self) -> Any:
|
||||
//| def refresh(self) -> None:
|
||||
//| """Refreshes the display immediately or raises an exception if too soon. Use
|
||||
//| ``time.sleep(display.time_to_refresh)`` to sleep until a refresh can occur."""
|
||||
//| ...
|
||||
@ -205,7 +205,7 @@ STATIC mp_obj_t displayio_epaperdisplay_obj_refresh(mp_obj_t self_in) {
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_refresh_obj, displayio_epaperdisplay_obj_refresh);
|
||||
|
||||
//| time_to_refresh: Any = ...
|
||||
//| time_to_refresh: float = ...
|
||||
//| """Time, in fractional seconds, until the ePaper display can be refreshed."""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_epaperdisplay_obj_get_time_to_refresh(mp_obj_t self_in) {
|
||||
@ -221,7 +221,7 @@ const mp_obj_property_t displayio_epaperdisplay_time_to_refresh_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| width: Any = ...
|
||||
//| width: int = ...
|
||||
//| """Gets the width of the display in pixels"""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_epaperdisplay_obj_get_width(mp_obj_t self_in) {
|
||||
@ -237,7 +237,7 @@ const mp_obj_property_t displayio_epaperdisplay_width_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| height: Any = ...
|
||||
//| height: int = ...
|
||||
//| """Gets the height of the display in pixels"""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_epaperdisplay_obj_get_height(mp_obj_t self_in) {
|
||||
@ -253,7 +253,7 @@ const mp_obj_property_t displayio_epaperdisplay_height_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| bus: Any = ...
|
||||
//| bus: displayio = ...
|
||||
//| """The bus being used by the display"""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_epaperdisplay_obj_get_bus(mp_obj_t self_in) {
|
||||
|
@ -96,7 +96,7 @@ STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_
|
||||
return self;
|
||||
}
|
||||
|
||||
//| def reset(self) -> Any:
|
||||
//| def reset(self) -> None:
|
||||
//| """Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin
|
||||
//| is available."""
|
||||
//| ...
|
||||
@ -111,7 +111,7 @@ STATIC mp_obj_t displayio_fourwire_obj_reset(mp_obj_t self_in) {
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(displayio_fourwire_reset_obj, displayio_fourwire_obj_reset);
|
||||
|
||||
//| def send(self, command: Any, data: Any, *, toggle_every_byte: Any = False) -> Any:
|
||||
//| def send(self, command: int, data: FourWire, *, toggle_every_byte: bool = False) -> None:
|
||||
//| """Sends the given command value followed by the full set of data. Display state, such as
|
||||
//| vertical scroll, set via ``send`` may or may not be reset once the code is done."""
|
||||
//| ...
|
||||
|
@ -86,7 +86,7 @@ displayio_group_t* native_group(mp_obj_t group_obj) {
|
||||
return MP_OBJ_TO_PTR(native_group);
|
||||
}
|
||||
|
||||
//| hidden: Any = ...
|
||||
//| hidden: Optional[bool] = ...
|
||||
//| """True when the Group and all of it's layers are not visible. When False, the Group's layers
|
||||
//| are visible if they haven't been hidden."""
|
||||
//|
|
||||
@ -111,7 +111,7 @@ const mp_obj_property_t displayio_group_hidden_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| scale: Any = ...
|
||||
//| scale: Optional[int] = ...
|
||||
//| """Scales each pixel within the Group in both directions. For example, when scale=2 each pixel
|
||||
//| will be represented by 2x2 pixels."""
|
||||
//|
|
||||
@ -140,7 +140,7 @@ const mp_obj_property_t displayio_group_scale_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| x: Any = ...
|
||||
//| x: Optional[int] = ...
|
||||
//| """X position of the Group in the parent."""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_group_obj_get_x(mp_obj_t self_in) {
|
||||
@ -165,7 +165,7 @@ const mp_obj_property_t displayio_group_x_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| y: Any = ...
|
||||
//| y: Optional[int] = ...
|
||||
//| """Y position of the Group in the parent."""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_group_obj_get_y(mp_obj_t self_in) {
|
||||
@ -190,7 +190,7 @@ const mp_obj_property_t displayio_group_y_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| def append(self, layer: Any) -> Any:
|
||||
//| def append(self, layer: layer) -> None:
|
||||
//| """Append a layer to the group. It will be drawn above other layers."""
|
||||
//| ...
|
||||
//|
|
||||
@ -201,7 +201,7 @@ STATIC mp_obj_t displayio_group_obj_append(mp_obj_t self_in, mp_obj_t layer) {
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_append_obj, displayio_group_obj_append);
|
||||
|
||||
//| def insert(self, index: Any, layer: Any) -> Any:
|
||||
//| def insert(self, index: int, layer: layer) -> None:
|
||||
//| """Insert a layer into the group."""
|
||||
//| ...
|
||||
//|
|
||||
@ -214,7 +214,7 @@ STATIC mp_obj_t displayio_group_obj_insert(mp_obj_t self_in, mp_obj_t index_obj,
|
||||
MP_DEFINE_CONST_FUN_OBJ_3(displayio_group_insert_obj, displayio_group_obj_insert);
|
||||
|
||||
|
||||
//| def index(self, layer: Any) -> Any:
|
||||
//| def index(self, layer: layer) -> int:
|
||||
//| """Returns the index of the first copy of layer. Raises ValueError if not found."""
|
||||
//| ...
|
||||
//|
|
||||
@ -228,7 +228,7 @@ STATIC mp_obj_t displayio_group_obj_index(mp_obj_t self_in, mp_obj_t layer) {
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_index_obj, displayio_group_obj_index);
|
||||
|
||||
//| def pop(self, i: Any = -1) -> Any:
|
||||
//| def pop(self, i: int = -1) -> group:
|
||||
//| """Remove the ith item and return it."""
|
||||
//| ...
|
||||
//|
|
||||
@ -251,7 +251,7 @@ STATIC mp_obj_t displayio_group_obj_pop(size_t n_args, const mp_obj_t *pos_args,
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(displayio_group_pop_obj, 1, displayio_group_obj_pop);
|
||||
|
||||
|
||||
//| def remove(self, layer: Any) -> Any:
|
||||
//| def remove(self, layer: layer) -> None:
|
||||
//| """Remove the first copy of layer. Raises ValueError if it is not present."""
|
||||
//| ...
|
||||
//|
|
||||
@ -264,7 +264,7 @@ STATIC mp_obj_t displayio_group_obj_remove(mp_obj_t self_in, mp_obj_t layer) {
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_remove_obj, displayio_group_obj_remove);
|
||||
|
||||
//| def __len__(self) -> Any:
|
||||
//| def __len__(self) -> Union[bool, int, None]:
|
||||
//| """Returns the number of layers in a Group"""
|
||||
//| ...
|
||||
//|
|
||||
@ -278,7 +278,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
|
||||
}
|
||||
}
|
||||
|
||||
//| def __getitem__(self, index: Any) -> Any:
|
||||
//| def __getitem__(self, index: int) -> group:
|
||||
//| """Returns the value at the given index.
|
||||
//|
|
||||
//| This allows you to::
|
||||
@ -286,7 +286,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
|
||||
//| print(group[0])"""
|
||||
//| ...
|
||||
//|
|
||||
//| def __setitem__(self, index: Any, value: Any) -> Any:
|
||||
//| def __setitem__(self, index: int, value: group) -> None:
|
||||
//| """Sets the value at the given index.
|
||||
//|
|
||||
//| This allows you to::
|
||||
@ -294,7 +294,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
|
||||
//| group[0] = sprite"""
|
||||
//| ...
|
||||
//|
|
||||
//| def __delitem__(self, index: Any) -> Any:
|
||||
//| def __delitem__(self, index: int) -> group:
|
||||
//| """Deletes the value at the given index.
|
||||
//|
|
||||
//| This allows you to::
|
||||
|
@ -76,7 +76,7 @@ STATIC mp_obj_t displayio_i2cdisplay_make_new(const mp_obj_type_t *type, size_t
|
||||
return self;
|
||||
}
|
||||
|
||||
//| def reset(self) -> Any:
|
||||
//| def reset(self) -> None:
|
||||
//| """Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin
|
||||
//| is available."""
|
||||
//| ...
|
||||
@ -91,7 +91,7 @@ STATIC mp_obj_t displayio_i2cdisplay_obj_reset(mp_obj_t self_in) {
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(displayio_i2cdisplay_reset_obj, displayio_i2cdisplay_obj_reset);
|
||||
|
||||
//| def send(self, command: Any, data: Any) -> Any:
|
||||
//| def send(self, command: int, data: displayio) -> None:
|
||||
//| """Sends the given command value followed by the full set of data. Display state, such as
|
||||
//| vertical scroll, set via ``send`` may or may not be reset once the code is done."""
|
||||
//| ...
|
||||
|
@ -89,7 +89,7 @@ STATIC mp_obj_t displayio_ondiskbitmap_make_new(const mp_obj_type_t *type, size_
|
||||
return MP_OBJ_FROM_PTR(self);
|
||||
}
|
||||
|
||||
//| width: Any = ...
|
||||
//| width: int = ...
|
||||
//| """Width of the bitmap. (read only)"""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_ondiskbitmap_obj_get_width(mp_obj_t self_in) {
|
||||
@ -108,7 +108,7 @@ const mp_obj_property_t displayio_ondiskbitmap_width_obj = {
|
||||
|
||||
};
|
||||
|
||||
//| height: Any = ...
|
||||
//| height: int = ...
|
||||
//| """Height of the bitmap. (read only)"""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_ondiskbitmap_obj_get_height(mp_obj_t self_in) {
|
||||
|
@ -70,7 +70,7 @@ STATIC mp_obj_t displayio_palette_make_new(const mp_obj_type_t *type, size_t n_a
|
||||
return MP_OBJ_FROM_PTR(self);
|
||||
}
|
||||
|
||||
//| def __len__(self) -> Any:
|
||||
//| def __len__(self) -> Union[bool, int, None]:
|
||||
//| """Returns the number of colors in a Palette"""
|
||||
//| ...
|
||||
//|
|
||||
@ -84,7 +84,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
|
||||
}
|
||||
}
|
||||
|
||||
//| def __setitem__(self, index: Any, value: Any) -> Any:
|
||||
//| def __setitem__(self, index: int, value: Union[int, ReadableBuffer]) -> Optional[int]:
|
||||
//| r"""Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1.
|
||||
//|
|
||||
//| The value argument represents a color, and can be from 0x000000 to 0xFFFFFF (to represent an RGB value).
|
||||
@ -147,7 +147,7 @@ STATIC mp_obj_t palette_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t val
|
||||
return mp_const_none;
|
||||
}
|
||||
|
||||
//| def make_transparent(self, palette_index: Any) -> Any: ...
|
||||
//| def make_transparent(self, palette_index: int) -> None: ...
|
||||
//|
|
||||
STATIC mp_obj_t displayio_palette_obj_make_transparent(mp_obj_t self_in, mp_obj_t palette_index_obj) {
|
||||
displayio_palette_t *self = MP_OBJ_TO_PTR(self_in);
|
||||
@ -161,7 +161,7 @@ STATIC mp_obj_t displayio_palette_obj_make_transparent(mp_obj_t self_in, mp_obj_
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_2(displayio_palette_make_transparent_obj, displayio_palette_obj_make_transparent);
|
||||
|
||||
//| def make_opaque(self, palette_index: Any) -> Any: ...
|
||||
//| def make_opaque(self, palette_index: int) -> None: ...
|
||||
//|
|
||||
STATIC mp_obj_t displayio_palette_obj_make_opaque(mp_obj_t self_in, mp_obj_t palette_index_obj) {
|
||||
displayio_palette_t *self = MP_OBJ_TO_PTR(self_in);
|
||||
|
@ -86,7 +86,7 @@ STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t
|
||||
return self;
|
||||
}
|
||||
|
||||
//| def reset(self) -> Any:
|
||||
//| def reset(self) -> None:
|
||||
//| """Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin
|
||||
//| is available."""
|
||||
//| ...
|
||||
@ -102,7 +102,7 @@ STATIC mp_obj_t displayio_parallelbus_obj_reset(mp_obj_t self_in) {
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(displayio_parallelbus_reset_obj, displayio_parallelbus_obj_reset);
|
||||
|
||||
//| def send(self, command: Any, data: Any) -> Any:
|
||||
//| def send(self, command: int, data: displayio) -> None:
|
||||
//| """Sends the given command value followed by the full set of data. Display state, such as
|
||||
//| vertical scroll, set via ``send`` may or may not be reset once the code is done."""
|
||||
//| ...
|
||||
|
@ -79,7 +79,7 @@ STATIC mp_obj_t displayio_shape_make_new(const mp_obj_type_t *type, size_t n_arg
|
||||
}
|
||||
|
||||
|
||||
//| def set_boundary(self, y: Any, start_x: Any, end_x: Any) -> Any:
|
||||
//| def set_boundary(self, y: int, start_x: int, end_x: int) -> None:
|
||||
//| """Loads pre-packed data into the given row."""
|
||||
//| ...
|
||||
//|
|
||||
|
@ -141,7 +141,7 @@ static displayio_tilegrid_t* native_tilegrid(mp_obj_t tilegrid_obj) {
|
||||
mp_obj_assert_native_inited(native_tilegrid);
|
||||
return MP_OBJ_TO_PTR(native_tilegrid);
|
||||
}
|
||||
//| hidden: Any = ...
|
||||
//| hidden: Optional[bool] = ...
|
||||
//| """True when the TileGrid is hidden. This may be False even when a part of a hidden Group."""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_tilegrid_obj_get_hidden(mp_obj_t self_in) {
|
||||
@ -165,7 +165,7 @@ const mp_obj_property_t displayio_tilegrid_hidden_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| x: Any = ...
|
||||
//| x: Optional[int] = ...
|
||||
//| """X position of the left edge in the parent."""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_tilegrid_obj_get_x(mp_obj_t self_in) {
|
||||
@ -190,7 +190,7 @@ const mp_obj_property_t displayio_tilegrid_x_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| y: Any = ...
|
||||
//| y: Optional[int] = ...
|
||||
//| """Y position of the top edge in the parent."""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_tilegrid_obj_get_y(mp_obj_t self_in) {
|
||||
@ -215,7 +215,7 @@ const mp_obj_property_t displayio_tilegrid_y_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| flip_x: Any = ...
|
||||
//| flip_x: Optional[bool] = ...
|
||||
//| """If true, the left edge rendered will be the right edge of the right-most tile."""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_tilegrid_obj_get_flip_x(mp_obj_t self_in) {
|
||||
@ -239,7 +239,7 @@ const mp_obj_property_t displayio_tilegrid_flip_x_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| flip_y: Any = ...
|
||||
//| flip_y: Optional[bool] = ...
|
||||
//| """If true, the top edge rendered will be the bottom edge of the bottom-most tile."""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_tilegrid_obj_get_flip_y(mp_obj_t self_in) {
|
||||
@ -264,7 +264,7 @@ const mp_obj_property_t displayio_tilegrid_flip_y_obj = {
|
||||
};
|
||||
|
||||
|
||||
//| transpose_xy: Any = ...
|
||||
//| transpose_xy: Optional[bool] = ...
|
||||
//| """If true, the TileGrid's axis will be swapped. When combined with mirroring, any 90 degree
|
||||
//| rotation can be achieved along with the corresponding mirrored version."""
|
||||
//|
|
||||
@ -289,7 +289,7 @@ const mp_obj_property_t displayio_tilegrid_transpose_xy_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| pixel_shader: Any = ...
|
||||
//| pixel_shader: pixel_shader = ...
|
||||
//| """The pixel shader of the tilegrid."""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_tilegrid_obj_get_pixel_shader(mp_obj_t self_in) {
|
||||
@ -317,7 +317,7 @@ const mp_obj_property_t displayio_tilegrid_pixel_shader_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| def __getitem__(self, index: Any) -> Any:
|
||||
//| def __getitem__(self, index: Union[Tuple[int, int], int]) -> int:
|
||||
//| """Returns the tile index at the given index. The index can either be an x,y tuple or an int equal
|
||||
//| to ``y * width + x``.
|
||||
//|
|
||||
@ -326,7 +326,7 @@ const mp_obj_property_t displayio_tilegrid_pixel_shader_obj = {
|
||||
//| print(grid[0])"""
|
||||
//| ...
|
||||
//|
|
||||
//| def __setitem__(self, index: Any, tile_index: Any) -> Any:
|
||||
//| def __setitem__(self, index: Union[Tuple[int, int], int], tile_index: int) -> None:
|
||||
//| """Sets the tile index at the given index. The index can either be an x,y tuple or an int equal
|
||||
//| to ``y * width + x``.
|
||||
//|
|
||||
|
Loading…
x
Reference in New Issue
Block a user