-
Notifications
You must be signed in to change notification settings - Fork 45
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
WIP commit to eliminate the ._vertices arrays from images. #365
base: horizon
Are you sure you want to change the base?
Conversation
… changes the image implementation in a few ways: - Because .vertices are going away whenever possible, we no longer have to render images solely in Quadrant I - Introduces a BoundingBox object to track bounding boxes of images - Computing the bounding box of an image can be done more precisely (especially for ellipses), by passing the current transformation *down* the image tree, and computing the bounding box for the particular transformation as needed. These bounding boxes are memoized for the identity transformation, so that we know what the bounding box is for a standalone image - Rendering images to canvases shifts slightly, to translate the origin of the canvas to the center, and then again to make that match the actual middle of the image. This transformation eliminates the dependency on Quadrant I Not all tests pass yet, some pinholes are still wrong, and possibly not all image primitives work yet. I *think* this should improve performance, but it's possible the additional bounding-box computations slow things down.
Can you say a little more about what It's not clear to me which bullets in the PR comment are necessary in order to remove This PR would be easiest for me to review if the answer was “all the changes are necessary in order to remove |
The "quadrant I dependency" is an independent thing, and I'm reconsidering it already since it currently slightly breaks how The main use for the I've eliminated the copying of
produces
produces The only way I know of to compute the correct bounding box for an ellipse is the lazy way: by traversing the image tree, passing down the current transformation, and then doing some math on that transformation matrix to compute the tight bounds of the ellipse. The same circle code above, in my branch, produces Unfortunately, my current branch is slower than I expected: I think these extra transformation matrices are outweighing the benefits of getting rid of the vertices arrays. More work is needed to figure out what's going on... Lastly, there are two image tests that are failing against our regression suite: they appear to be ~1px different in size than before, which I think is due solely to rounding differences in coordinate calculations; the images visually look identical to me. |
…stigial and should be removed
…ns gives _massive_ speedups
- resetting pinhole coordinate system to top-left, per docs - fixing overlay somewhat more, so that e.g. overlaying a triangle on a circle never overflows the circle - adding color-frame and color-pinhole, for additional debugging. Three tests currently fail, and arguably the reference images need fixing
… than the barycenter
This PR changes the image implementation in a few ways:
Not all tests pass yet, some pinholes are still wrong, and possibly not all image primitives work yet. I think this should improve performance, but it's possible the additional bounding-box computations slow things down.