@@ -293,22 +293,29 @@ static const mp_obj_namedtuple_type_t bitmapfilter_channel_mixer_offset_type = {
293
293
//| ) -> displayio.Bitmap:
294
294
//| """Perform a channel mixing operation on the bitmap
295
295
//|
296
+ //| This is similar to the "channel mixer" tool in popular photo editing software.
297
+ //|
296
298
//| The ``bitmap``, which must be in RGB565_SWAPPED format, is modified
297
299
//| according to the ``weights``.
298
300
//|
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.
301
304
//|
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.
306
310
//|
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.
310
316
//|
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.
312
319
//| Every fourth value is the offset value.
313
320
//|
314
321
//| ``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 = {
319
326
//|
320
327
//| .. code-block:: python
321
328
//|
322
- //| sepia_weights = [
329
+ //| sepia_weights = bitmapfilter.ChannelMixer(
323
330
//| .393, .769, .189,
324
331
//| .349, .686, .168,
325
- //| .272, .534, .131]
332
+ //| .272, .534, .131)
326
333
//|
327
334
//| def sepia(bitmap):
328
335
//| \"""Convert the bitmap to sepia\"""
0 commit comments