Commit cccbdc7
committed
LibGfx: Give BilevelImage::create_from_bitmap() a fast path
If the input image is black and white, shortcircuit all the fancy
processing.
Takes Tests/LibGfx/test-inputs/jbig2/json/compile.sh from 0.23s to
0.20s on my machine. (When running the tests serially, it reduced
the time for that from 1.72s to 1.32s on my machine.)
(I also tried putting a decoding cache in jbig2-from-image.cpp, but
this approach here is more general, simpler, and just as fast.)1 parent 5348f51 commit cccbdc7
1 file changed
+18
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
249 | 267 | | |
250 | 268 | | |
251 | 269 | | |
| |||
0 commit comments