Skip to content

Commit 2ed31b6

Browse files
committed
bitmapfilter: Doc improvements.
1 parent ce5c108 commit 2ed31b6

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

shared-bindings/bitmapfilter/__init__.c

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -293,22 +293,29 @@ static const mp_obj_namedtuple_type_t bitmapfilter_channel_mixer_offset_type = {
293293
//| ) -> displayio.Bitmap:
294294
//| """Perform a channel mixing operation on the bitmap
295295
//|
296+
//| This is similar to the "channel mixer" tool in popular photo editing software.
297+
//|
296298
//| The ``bitmap``, which must be in RGB565_SWAPPED format, is modified
297299
//| according to the ``weights``.
298300
//|
299-
//| If ``weights`` is a list of length 3, then each channel is scaled independently:
300-
//| The numbers are the red, green, and blue channel scales.
301+
//| If ``weights`` is a list of length 3 (or a `ChannelScale`
302+
//| object), then each channel is scaled independently: The
303+
//| numbers are the red, green, and blue channel scales.
301304
//|
302-
//| If ``weights`` is a list of length 6, then each channel is scaled and
303-
//| offset independently: The first two numbers are applied to the red channel:
304-
//| scale and offset. The second two number are applied to the green
305-
//| channel, and the last two numbers to the blue channel.
305+
//| If ``weights`` is a list of length 6 (or a `ChannelScaleOffset`
306+
//| object), then each channel is scaled and offset independently:
307+
//| The first two numbers are applied to the red channel: scale and
308+
//| offset. The second two number are applied to the green channel,
309+
//| and the last two numbers to the blue channel.
306310
//|
307-
//| If ``weights`` is a list of length 9, then channels are mixed. The first three
308-
//| numbers are the fraction of red, green and blue input channels mixed into the
309-
//| red output channel. The next 3 numbers are for green, and the final 3 are for blue.
311+
//| If ``weights`` is a list of length 9 (or a `ChannelMixer`
312+
//| object), then channels are mixed. The first three
313+
//| numbers are the fraction of red, green and blue input channels
314+
//| mixed into the red output channel. The next 3 numbers are for
315+
//| green, and the final 3 are for blue.
310316
//|
311-
//| If ``weights`` is a list of length 12, then channels are mixed with an offset.
317+
//| If ``weights`` is a list of length 12 (or a `ChannelMixerOffest`
318+
//| object), then channels are mixed with an offset.
312319
//| Every fourth value is the offset value.
313320
//|
314321
//| ``mask`` is another image to use as a pixel level mask for the operation.
@@ -319,10 +326,10 @@ static const mp_obj_namedtuple_type_t bitmapfilter_channel_mixer_offset_type = {
319326
//|
320327
//| .. code-block:: python
321328
//|
322-
//| sepia_weights = [
329+
//| sepia_weights = bitmapfilter.ChannelMixer(
323330
//| .393, .769, .189,
324331
//| .349, .686, .168,
325-
//| .272, .534, .131]
332+
//| .272, .534, .131)
326333
//|
327334
//| def sepia(bitmap):
328335
//| \"""Convert the bitmap to sepia\"""

0 commit comments

Comments
 (0)