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

proposal: image: Add Pitch to image formats #57409

Closed
kevmo314 opened this issue Dec 20, 2022 · 1 comment
Closed

proposal: image: Add Pitch to image formats #57409

kevmo314 opened this issue Dec 20, 2022 · 1 comment

Comments

@kevmo314
Copy link

Currently, image.YCbCr and friends require the image's planes to be aligned with the image width. That is, for a given image of size w x h, a full-size plane must be w x h bytes.

I'd like to propose adding a field Pitch to the image structs that allows the underlying data's width to be larger than w. This is common if the image is sourced from external sources, such as a hardware decoder that has memory-mapped the image and image.YCbCr serves as a nice wrapper around it.

For some prior art, OpenCV includes a step argument which does the same thing: https://docs.opencv.org/4.x/d3/d63/classcv_1_1Mat.html#a51615ebf17a64c968df0bf49b4de6a3a

@gopherbot gopherbot added this to the Proposal milestone Dec 20, 2022
@kevmo314
Copy link
Author

Oh nevermind, this seems to be what Stride does. Too many terms, sorry for the noise!

@golang golang locked and limited conversation to collaborators Dec 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants