Skip to content

proposal: image: Add Pitch to image formats #57409

@kevmo314

Description

@kevmo314

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions