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>
This commit is contained in:
parent
8addae2583
commit
e83727a194
2 changed files with 108 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue