mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-24 17:15:07 +03:00
libcamera: formats: Add planeSize() helpers to PixelFormatInfo
Add two helpers functions to the PixelFormatInfo class to compute the byte size of a given plane, taking the frame size, the stride, the alignment constraints and the vertical subsampling into account. Use the new functions through the code base to replace manual implementations. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
This commit is contained in:
parent
e85978ef5f
commit
94cbaa381a
5 changed files with 74 additions and 34 deletions
|
@ -41,6 +41,10 @@ public:
|
|||
|
||||
unsigned int stride(unsigned int width, unsigned int plane,
|
||||
unsigned int align = 1) const;
|
||||
unsigned int planeSize(const Size &size, unsigned int plane,
|
||||
unsigned int align = 1) const;
|
||||
unsigned int planeSize(unsigned int height, unsigned int plane,
|
||||
unsigned int stride) const;
|
||||
unsigned int frameSize(const Size &size, unsigned int align = 1) const;
|
||||
unsigned int frameSize(const Size &size,
|
||||
const std::array<unsigned int, 3> &strides) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue