d519630d14
3 Commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
Martin Chase
|
a91953e93d
|
Bypass makeARGB in some cases (#1786)
* refactor out _ndarray_to_qimage()
* combine levels back with lut
* make use of Grayscale8, RGB888 and Indexed8 QImage formats
Grayscale8 and RGB888 images are those that are ready for display
without further processing.
* add Grayscale16
* apply the efflut early for uint16 mono/rgb, uint8 rgb
* ndarray indexing is faster than np.take
* handle uint16 rgb(a) with no levels same as levels=[0, 65535]
* add support for Format_RGBA64
* fix: support colormaps of shape (h, 1)
* check ImageItem uint8 and uint16 QImage formats
* uint16 mono with rgb lut -> RGBX8888
* got width and height swapped in array dimensions
* set ImageItem as row-major
* no need to form a 1d 32-bit lut for array indexing
you can index (y, x) into a lookup table of shape (nentry, 3) or
(nentry, 4) and get an output of shape (y, x, 3) or (y, x, 4)
* Revert "no need to form a 1d 32-bit lut for array indexing"
This reverts commit
|
||
Martin Chase
|
6fed6d42b3
|
Protect makeARGB with tests and benchmarks (#1697)
* update to working * cupy tests, too * doubling up and down * add more realism to the benchmarks * name to reflect scale * use different numbers to mean different numbers (that sure does sound tautological) * more sensible: order, error * thorough check of lots of makeARGB arg combos * docstring for tool usage * no print needed * better error messages * test makeARGB using cupy, too * skip without cupy available * switch from conda to venv * skip cupy runs when not available * use endian-proof makeARGB shim in tests * generate the asv conf to suit the system * document running asv * comments for future matrix goals * put all makeARGB tests together; name for clarity * subprocess.check_output is standard for all supported pythons * better handle lack of git version * use makeARGB shim * small fixes and improvements |
||
Martin Chase
|
1654cb62ac
|
Small ImageItem-related improvements (#1501)
* Initial asv configuration * makeARGB benchmarks are working * Fix array type checking and allow making QImage in greyscale mode * Performance improvements * benchmark minor update * Add CLI args to video speed test for easier / automated benchmarking * udpate asv conf * use a buffer-qimage so we can avoid allocing so much this should improve performance under windows * Add CLI args to video speed test for easier / automated benchmarking * use a buffer-qimage so we can avoid allocing so much this should improve performance under windows * playing with numba * oh, mins/maxes in the other order * maybe put the cupy in here and see what happens * pre-alloc for gpu and cpu * handle possibility of not having cupy * no numba in this branch * organize imports * name them after their use, not their expected device * cupy.take does not support clip mode, so do it explicitly * add CUDA option to the VideoSpeedTest * rename private attr xp to _xp * handle resizes at the last moment * cupy is less accepting of lists as args * or somehow range isn't allowed? what histogram is this? * construct the array with python objects * get the python value right away * put LUT into cupy if needed * docstring about cuda toolkit version * better handling and display of missing cuda lib * lint * import need * handle switching between cupy and numpy in a single ImageItem * only use xp when necessary we can now depend on numpy >= 1.17, which means __array_function__-implementing cupy can seamlessly pass into numpy functions. the remaining uses of xp are for our functions which need to allocate new data structures, an operation that has to be substrate-specific. remove empty_cupy; just check if the import succeeded, instead. * use an option to control use of cupy * convert cupy.ceil array to int for easier mathing * RawImageWidget gets to use the getCupy function now, too * raise error to calm linters; rename for clarity * Add Generated Template Files * document things better * cruft removal * warnings to communicate when cupy is expected but somehow broken * Merge branch 'cupy-rebase' into 'l/imageitem-performance' Abundant conflicts; accept theirs in nearly every case. * playing with settings to suss out timeout * playing with more stuff to suss out timeout * replace with empty list * skip test_ExampleApp on linux+pyside2 only * clean out some bits that no longer make sense; linty * ignore airspeed velocity dir * lint * tidy up for merge * lint * lint, avoid shadowing * specific import; run-as-script setup Co-authored-by: Luke Campagnola <luke.campagnola@gmail.com> Co-authored-by: Ogi Moore <ognyan.moore@gmail.com> |