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

Return the ImageData from the Canvas context #30

Closed
davidshen84 opened this issue Oct 31, 2018 · 5 comments
Closed

Return the ImageData from the Canvas context #30

davidshen84 opened this issue Oct 31, 2018 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@davidshen84
Copy link
Contributor

The WebcamImage object should contain the ImageDate from the canvas' context. So it would be easier to perform pixel-level manipulation on the captured image.

Sample: https://www.w3schools.com/tags/canvas_getimagedata.asp

@basst314
Copy link
Owner

Hi @davidshen84,

Thanks for raising this, it sounds like an interesting extension. I will read into it and provide an update on this thread soon.

Cheers!

@basst314 basst314 self-assigned this Oct 31, 2018
@basst314 basst314 added the enhancement New feature or request label Oct 31, 2018
davidshen84 pushed a commit to davidshen84/ngx-webcam that referenced this issue Nov 1, 2018
Extracts ImageData instance from the canvas' 2D context and save it in
the WebcamImage instance.
davidshen84 pushed a commit to davidshen84/ngx-webcam that referenced this issue Nov 1, 2018
Extracts ImageData instance from the canvas' 2D context and save it in
the WebcamImage instance.
davidshen84 added a commit to davidshen84/ngx-webcam that referenced this issue Nov 1, 2018
Extracts ImageData instance from the canvas' 2D context and save it in
the WebcamImage instance.
@davidshen84
Copy link
Contributor Author

davidshen84 commented Nov 1, 2018

https://davidshen84.github.io/#/webcam

Here's a simple application that makes use of this change.

The layout doesn't work well on a small screen.

@basst314
Copy link
Owner

basst314 commented Dec 5, 2018

Hi @davidshen84,

I quickly wanted to provide an update here since my last comment was already a while ago (sorry for that!).

Thanks a lot btw for the pull request!

The extension looks fine and the only concern I have, or thing that I‘d like to investigate a little bit more is to understand the memory implications of this change.

  • how large is such a bitmap in memory?
  • will it slow down the event firing process to generate that bitmap first?

I thought of maybe introducing a flag where this could be controlled by the developer using the module. To indicate whether or not they want to receive that bitmap, in case its mem or time consumption is significant.

If you have time to do some deep-dive, I‘d highly appreciate it. Otherwise, I‘ll spend some time on it as soon as I get to it.

Thanks!

@davidshen84
Copy link
Contributor Author

davidshen84 commented Dec 6, 2018 via email

@davidshen84
Copy link
Contributor Author

Hi @basst314 ,

Instead of adding a module level configuration, I decided to add a captureImageData attribute to the component. It's a boolean type value and the default value is false. This makes sure the component is backward compatible, and the developers have instance level control of this object.

Thanks.

basst314 added a commit that referenced this issue Jan 12, 2019
Include PR #31 to fix #30 - add imagedata (contributor: davidshen84)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants