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 screenshot callback #265

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

crertel
Copy link
Contributor

@crertel crertel commented Apr 26, 2022

Description

This adds an optional take_screenshot callback to the Scenic.Driver callback list.

This would be a way forward for screenshots that would allow pulling framebuffers from both a local driver (say, OpenGL-backed) or a web driver (say, HTML5 canvas). If a driver doesn't support a screenshot for whatever reason, this should still return a useful value of {:ok, :not_supported, driver}.

Motivation and Context

We currently don't have an easy way of grabbing the framebuffer from a driver.

This starts putting into place an interface that drivers can implement that does so.

The next step, if this is the direction we want to go, is getting this merged and updating scenic_driver_local and other drivers to support this.

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any feature
    but make things better)

Checklist

  • Check other PRs and make sure that the changes are not done yet.
  • The PR title is no longer than 64 characters.

@crertel
Copy link
Contributor Author

crertel commented May 20, 2022

@boydm as per our convo, we want to update this to use a streaming bitmap instead of the type I added.

@boydm
Copy link
Collaborator

boydm commented Jul 11, 2022

I think the returned result should be of type Scenic.Assets.Stream.Bitmap.t()

We don't need to define a new type here, when the existing stream-able bitmap format already has all the same fields.

Additionally, if it is a Bitmap.t(), then it can be passed directly into the streaming bitmap functions.

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.

None yet

2 participants