Skip to content

Commit b25d313

Browse files
committed
Update doc string
1 parent 549bbdc commit b25d313

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

shared-bindings/bitmaptools/__init__.c

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,27 @@ STATIC void validate_clip_region(displayio_bitmap_t *bitmap, mp_obj_t clip0_tupl
126126

127127
}
128128

129+
MAKE_ENUM_VALUE(bitmaptools_blendmode_type, bitmaptools_blendmode, NORMAL, BITMAPTOOLS_BLENDMODE_NORMAL);
130+
MAKE_ENUM_VALUE(bitmaptools_blendmode_type, bitmaptools_blendmode, SCREEN, BITMAPTOOLS_BLENDMODE_SCREEN);
131+
132+
//| class BlendMode:
133+
//| """The blend mode for `alphablend` to operate use"""
134+
//|
135+
//| NORMAL: Blendmode
136+
//| """Blend with equal parts of the two source bitmaps"""
137+
//|
138+
//| SCREEN: Blendmode
139+
//| """Blend based on the value in each color channel. The result keeps the lighter colors and discards darker colors."""
140+
//|
141+
MAKE_ENUM_MAP(bitmaptools_blendmode) {
142+
MAKE_ENUM_MAP_ENTRY(bitmaptools_blendmode, NORMAL),
143+
MAKE_ENUM_MAP_ENTRY(bitmaptools_blendmode, SCREEN),
144+
};
145+
STATIC MP_DEFINE_CONST_DICT(bitmaptools_blendmode_locals_dict, bitmaptools_blendmode_locals_table);
146+
147+
MAKE_PRINTER(bitmaptools, bitmaptools_blendmode);
148+
MAKE_ENUM_TYPE(bitmaptools, BlendMode, bitmaptools_blendmode);
149+
129150
//| def rotozoom(
130151
//| dest_bitmap: displayio.Bitmap,
131152
//| source_bitmap: displayio.Bitmap,
@@ -274,27 +295,6 @@ STATIC mp_obj_t bitmaptools_obj_rotozoom(size_t n_args, const mp_obj_t *pos_args
274295

275296
MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_rotozoom_obj, 0, bitmaptools_obj_rotozoom);
276297

277-
MAKE_ENUM_VALUE(bitmaptools_blendmode_type, bitmaptools_blendmode, NORMAL, BITMAPTOOLS_BLENDMODE_NORMAL);
278-
MAKE_ENUM_VALUE(bitmaptools_blendmode_type, bitmaptools_blendmode, SCREEN, BITMAPTOOLS_BLENDMODE_SCREEN);
279-
280-
//| class BlendMode:
281-
//| """The blend mode for `alphablend` to operate use"""
282-
//|
283-
//| NORMAL: Blendmode
284-
//| """Blend with equal parts of the two source bitmaps"""
285-
//|
286-
//| SCREEN: Blendmode
287-
//| """Blend based on the value in each color channel. The result keeps the lighter colors and discards darker colors."""
288-
//|
289-
MAKE_ENUM_MAP(bitmaptools_blendmode) {
290-
MAKE_ENUM_MAP_ENTRY(bitmaptools_blendmode, NORMAL),
291-
MAKE_ENUM_MAP_ENTRY(bitmaptools_blendmode, SCREEN),
292-
};
293-
STATIC MP_DEFINE_CONST_DICT(bitmaptools_blendmode_locals_dict, bitmaptools_blendmode_locals_table);
294-
295-
MAKE_PRINTER(bitmaptools, bitmaptools_blendmode);
296-
MAKE_ENUM_TYPE(bitmaptools, BlendMode, bitmaptools_blendmode);
297-
298298
// requires at least 2 arguments (destination bitmap and source bitmap)
299299

300300
//| def alphablend(
@@ -320,10 +320,8 @@ MAKE_ENUM_TYPE(bitmaptools, BlendMode, bitmaptools_blendmode);
320320
//| :param float factor2: The proportion of bitmap 2 to mix in. If specified as `None`, ``1-factor1`` is used. Usually the proportions should sum to 1.
321321
//| :param displayio.Colorspace colorspace: The colorspace of the bitmaps. They must all have the same colorspace. Only the following colorspaces are permitted: ``L8``, ``RGB565``, ``RGB565_SWAPPED``, ``BGR565`` and ``BGR565_SWAPPED``.
322322
//| :param bitmaptools.BlendMode blendmode: The blend mode to use. Default is NORMAL.
323-
//| :param int skip_source1_index: bitmap palette index in the source that will not be blended,
324-
//| set to None to blended all pixels
325-
//| :param int skip_source2_index: bitmap palette index in the source that will not be blended,
326-
//| set to None to blended all pixels
323+
//| :param int skip_source1_index: bitmap palette index in source_bitmap_1 that will not be blended, set to None to blend all pixels
324+
//| :param int skip_source2_index: bitmap palette index in source_bitmap_2 that will not be blended, set to None to blend all pixels
327325
//|
328326
//| For the L8 colorspace, the bitmaps must have a bits-per-value of 8.
329327
//| For the RGB colorspaces, they must have a bits-per-value of 16."""

0 commit comments

Comments
 (0)