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

Switch to ndarray and collapse layers #23

Merged
merged 7 commits into from
Aug 8, 2015
Merged

Switch to ndarray and collapse layers #23

merged 7 commits into from
Aug 8, 2015

Conversation

tyarkoni
Copy link
Contributor

@tyarkoni tyarkoni commented Aug 8, 2015

This PR closes #21 and #22. We switch from representing volumes as arrays-of-arrays-of-arrays to using 3D ndarrays. This provides a modest performance boost and enables much more compact code via modular plugins like ndarray-ops.

We also now collapse all layers before painting--i.e., instead of painting each layer separately to canvas, we alpha composite all layers into a single rgb ndarray, then blit the result to canvas once. This takes us from O(n) to nearly O(1) time as a function of number of layers loaded.

Note: we're now drawing on node libraries (ndarray and ndarray-ops); this is probably a good time to switch the other dependencies out too and use a more general packaging solution (e.g., browserify).

tyarkoni added a commit that referenced this pull request Aug 8, 2015
Switch to ndarray and collapse layers
@tyarkoni tyarkoni merged commit 00a113b into master Aug 8, 2015
@tyarkoni tyarkoni deleted the precompute-color branch August 10, 2015 21:45
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

Successfully merging this pull request may close these issues.

Replace array-of-array volume representation with ndarrays
1 participant