diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2020-06-29 22:28:38 +0900 |
---|---|---|
committer | Paul Elder <paul.elder@ideasonboard.com> | 2020-07-10 16:11:08 +0900 |
commit | e83727a194b5cf2e40331989bf8f762da74217fd (patch) | |
tree | bda97c62e216f39c1fb511a799e6ef69f00a17bb /include | |
parent | 8addae2583d68aaa4e904d7607b1d94ddc371860 (diff) |
libcamera: PixelFormatInfo: Add functions stride and frameSize
Add member functions to PixelFormatInfo for calculating stride and frame
size. This will simplify existing code that calculates these things.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/internal/formats.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/libcamera/internal/formats.h b/include/libcamera/internal/formats.h index 211da4a3..cad41ad8 100644 --- a/include/libcamera/internal/formats.h +++ b/include/libcamera/internal/formats.h @@ -53,6 +53,12 @@ public: static const PixelFormatInfo &info(const PixelFormat &format); static const PixelFormatInfo &info(const V4L2PixelFormat &format); + unsigned int stride(unsigned int width, unsigned int plane, + unsigned int align = 1) 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; + /* \todo Add support for non-contiguous memory planes */ const char *name; PixelFormat format; |