in reply to Re^4: Why this code is so slow if run in thread?
in thread Why this code is so slow if run in thread?
But then simple solution will be to, first, get a substring, and only then decode it
Okay, great. But I don't understand how decoding utf16le works on the data returned by cc8compt() which contains 4-byte integers? 3 * width * height of them?
Ie. a 10x10 image that looks like this (. is white * is black):
.......... .*.******. .*........ .*.*.****. .*.*...... .*.*.****. .*.*.*.... .*.*.*.... .*.*.*.... ..........
Comes back from cc8compt()->get_dataref as a 1200 byte string (10*10*4*3), and contains three identical copies of the 'color map' that looks like this when unpacked as 'V*'
0:0:0:0:0:0:0:0:0:0 0:1:0:2:2:2:2:2:2:0 0:1:0:0:0:0:0:0:0:0 0:1:0:3:0:4:4:4:4:0 0:1:0:3:0:0:0:0:0:0 0:1:0:3:0:5:5:5:5:0 0:1:0:3:0:5:0:0:0:0 0:1:0:3:0:5:0:0:0:0 0:1:0:3:0:5:0:0:0:0 0:0:0:0:0:0:0:0:0:0 0:0:0:0:0:0:0:0:0:0 0:1:0:2:2:2:2:2:2:0 0:1:0:0:0:0:0:0:0:0 0:1:0:3:0:4:4:4:4:0 0:1:0:3:0:0:0:0:0:0 0:1:0:3:0:5:5:5:5:0 0:1:0:3:0:5:0:0:0:0 0:1:0:3:0:5:0:0:0:0 0:1:0:3:0:5:0:0:0:0 0:0:0:0:0:0:0:0:0:0 0:0:0:0:0:0:0:0:0:0 0:1:0:2:2:2:2:2:2:0 0:1:0:0:0:0:0:0:0:0 0:1:0:3:0:4:4:4:4:0 0:1:0:3:0:0:0:0:0:0 0:1:0:3:0:5:5:5:5:0 0:1:0:3:0:5:0:0:0:0 0:1:0:3:0:5:0:0:0:0 0:1:0:3:0:5:0:0:0:0 0:0:0:0:0:0:0:0:0:0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Why this code is so slow if run in thread?
by vr (Curate) on Dec 12, 2016 at 12:11 UTC | |
by BrowserUk (Patriarch) on Dec 12, 2016 at 12:20 UTC | |
by vr (Curate) on Dec 12, 2016 at 12:27 UTC | |
by BrowserUk (Patriarch) on Dec 12, 2016 at 13:18 UTC | |
by BrowserUk (Patriarch) on Dec 14, 2016 at 01:18 UTC | |
by vr (Curate) on Dec 16, 2016 at 16:11 UTC | |
by etj (Priest) on May 18, 2022 at 23:48 UTC |