Conversation
It looks like `BytesPerRow` (the stride) has some kind of alignment requirement (testing on M1), that doesn't let us just use the width. So for this to work, softbuffer needs to expose the stride, and the user needs to deal with that... This doesn't seem to be showing the right thing even when width matches stride. Not sure why.
Ah, so this part is due to the alpha channel. https://developer.apple.com/documentation/corevideo/cvpixelformatdescription/1563591-pixel_format_identifiers doesn't list an |
|
We'll probably need to expose a So I think we'll ultimately want an API change like this. |
| let blue = (x * y) % 255; | ||
|
|
||
| buffer[index as usize] = blue | (green << 8) | (red << 16); | ||
| let stride = buffer.stride(); |
There was a problem hiding this comment.
Interesting, Android needs the same!
I would highly recommend looking into |
|
Is We need the |
|
Should we move this discussion over to #98 which is now open to discuss the API considering requirements of various platforms, not just limiting it to macOS here? FWIW such a crate could be provided behind a |
The Bonus if you do |
Yeah, that part gets back to #98. Unfortunately it seems we need to use RGBA on some platforms for no-copy presentation.... So I think we've settled on this solution for macOS, it's just that it requires breaking API changes, and we may want to do that along with #98. |
Well right now you say |
|
I like how an Android has as very similar API with |
|
Superseded by #329. |
It looks like
BytesPerRow(the stride) has some kind of alignment requirement (testing on M1), that doesn't let us just use the width. So for this to work, softbuffer needs to expose the stride, and the user needs to deal with that...This doesn't seem to be showing the right thing even when width matches stride. Not sure why.