Commit graph

31 commits

Author SHA1 Message Date
Dan Halbert
3f4d9310ff CircuitPython files: replace STATIC with static 2024-05-20 11:02:17 -04:00
Dan Halbert
747b7619ea update headers of most CircuitPython-only files 2024-05-17 14:56:28 -04:00
43c036aa48 fix stub documentation 2024-01-30 12:11:26 -06:00
8c85fe2348 fix type annotations 2024-01-29 16:06:24 -06:00
f5bf485426 use handy macro instead 2024-01-29 11:15:56 -06:00
943825f8be Add bitmapfilter.blend
This can perform arbitrary channel mixing between two images.
Alpha blend & maximum functions are demonstrated in the test.
However, it should make most of the usual photo editing blends
possible. (for dissolve, fill a mask bitmap with random values,
which may be expensive to do from circuitpython code; we can
specifically accelerate it if we need to)
2024-01-29 11:15:35 -06:00
152890b8a8
improve documentation again 2024-01-18 17:40:47 -06:00
961a63b3ee
Require use of the ChannelMixer / ChannelScaler types in mix()
.. and update the test accordingly, fixing a bug discovered in the
process.
2024-01-18 17:16:44 -06:00
ff3947a74a
bitmapfilter: improve documentation 2024-01-18 13:25:13 -06:00
2ed31b687a
bitmapfilter: Doc improvements. 2024-01-18 11:24:55 -06:00
ce5c108642
bitmapfilter: Doc improvements. 2024-01-18 10:22:30 -06:00
1ff6e1a025
Add namedtuple objects for mix() operation variants 2024-01-18 09:29:46 -06:00
c8bb1f527e
Doc improvements 2024-01-18 09:29:19 -06:00
db7ade2609
Update __init__.c 2024-01-17 21:22:07 -06:00
0e1908ffa5
Update shared-bindings/bitmapfilter/__init__.c
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2024-01-17 21:19:42 -06:00
0c36c1558e
Remove morph9, we're tight on flash space as it is
.. and no specific use case for morph9 is known that can't be done
with mix+morph.

Saves ~1800 bytes on Memento
2024-01-15 14:08:13 -06:00
6dc33a8efb
optimize morph9
This reduces the time from about 133ms to about 122ms on my test
image on the memento pycamera

a similar change to morph did not produce a performance improvement,
so I didn't include it.
2024-01-14 11:17:55 -06:00
26fe085763
the correct type is int, which doesn't have any comparison problems 2024-01-12 19:51:10 -06:00
6e553e763c
Add, test morph9
morph9 is a form of morph which performs 9 different convolutions,
like a version of mix where each coefficient is a (2n+1)x(2n+1) matrix.

Most use cases are covered by morph-then-mix, but some advanced operations
may be more efficient to implement via morph9.
2024-01-12 17:32:45 -06:00
902a36d03f
didn't actually add Sequence[int] support to false_color 2024-01-12 12:44:06 -06:00
4a09827796
Review & update bitmapfilter documentation 2024-01-12 10:55:26 -06:00
6d30ff527a
Add false_color 2024-01-12 10:48:26 -06:00
e3a5e48ba5
Lookup table argument is required in bitmapfilter.lookup 2024-01-12 10:19:25 -06:00
ff22baa37f
Add lookup table (LUT) 2024-01-11 14:40:01 -06:00
1365a06321
bitmapfilter: return bitmap from the functions. add 6-number mix() 2024-01-11 11:58:49 -06:00
4cb193d9c9
bitmapfilter: Add solarize, add comments 2024-01-10 15:32:59 -06:00
7e1c05edf5
morph: accommodate fractional add values 2024-01-09 17:11:53 -06:00
36411203ff
Add bitmapfilter.mix
This allows operations between channels in an image. It can be used for
the following use cases:
 * Conversion to B&W or sepia
 * Adding color casts
 * Mixing or swapping arbitrary channels
 * Inverting or scaling arbitrary channels
2024-01-09 15:00:42 -06:00
214ebc3955
morph improvements
* weight can be any sequence (& test it)
 * improve error message
 * correct documentation of ``mask`` vs copypaste from openmv
2024-01-08 08:57:20 -06:00
7e23fac766
bitmapfilter: refine morph, add docs 2024-01-06 13:34:42 -06:00
75be426377
Add "bitmapfilter"
bitmapfilter.morph is taken from openmv's imlib.

It is substantially faster than blur/sharpen implemented in ulab,
by up to 10x. It also avoids making many allocations.
2024-01-05 14:16:00 -06:00