Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

De-fuzzing the fuzz #17

Open
njvack opened this issue Jan 10, 2014 · 3 comments
Open

De-fuzzing the fuzz #17

njvack opened this issue Jan 10, 2014 · 3 comments

Comments

@njvack
Copy link
Contributor

njvack commented Jan 10, 2014

Hey Tal,

I've been looking into how to get rid of the overlap artifacts that happen with zooming and transparent layers, and I think I have a pretty good handle on it.

My plan would be to have each view have its own array of layers and its own canvas, draw the pixels directly to it (with color mapping done at this step), and then use drawImage() to blit the layer to the View's canvas.

If I were to work up a PR along these lines, would you be receptive?

@tyarkoni
Copy link
Contributor

That sounds good to me. My only real concern with refactoring the models is to make sure that performance doesn't get worse. Right now the viewer unnecessarily paints each visible layer directly to the on-screen canvas, which makes it very unresponsive as soon as you have 3 or 4 layers. I can't tell if your approach will fix that (it sounds like there will still be the same number of pixel-drawing operations), but it doesn't seem like it will make it any worse, so go for it!

@njvack
Copy link
Contributor Author

njvack commented Jan 10, 2014

Well... I have ideas about performance, too :)

Most notably, I'd like to replace nested js arrays with strided, typed arrays (see https://github.com/mikolalysenko/ndarray), mapping the full-range data to byte arrays. Then color mapping and thresholding can both be done by indexing into a 256-element array.

See https://github.com/mikolalysenko/ndarray-experiments for benchmarks of different techniques...

@njvack
Copy link
Contributor Author

njvack commented Jan 10, 2014

But! Note that I do not want to make that major of a change in this PR. That's its own can of worms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants