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

Add image mark #35

Merged
merged 8 commits into from
Jan 22, 2024
Merged

Add image mark #35

merged 8 commits into from
Jan 22, 2024

Conversation

jonmmease
Copy link
Owner

Adds support for image marks. Some notes:

  • The scenegraph works with in-memory images. Loading images from URLs is handled in the vega logic using reqwest.
  • Images are written to a texture atlas, positioned using etagere. The texture coordinates are stored in the vertex structs.
  • If there are too many images to fit in one texture, the texture us updated once per batch.
  • Following the design of other marks, I added a generic TextureRenderer that is parameterized by a TextureRenderShader. The image shader contains the image atlas logic. I haven't looked deeply into gradiants, but it's possible there will be a separate GradientShader, or perhaps gradients will reuse the image shader.
  • aspect, align, baseline, and smooth are all supported

Here are some examples rendered by this PR:

Vega-Lite logos example:
image-logos

aspect = false
image-logos_sized_aspect_false

aspect = true with baseline and align specifications
image-logos_sized_aspect_true_align_baseline

expanded image with smooth=true
image-smooth_true

expanded image with smooth=false
image-smooth_false

example with larger images that triggers multi-batch logic:
image-large_images

@jonmmease jonmmease merged commit 2413707 into main Jan 22, 2024
1 check passed
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.

1 participant