libcamera: formats: Move plane info structure to PixelFormatInfo

Move the PixelFormatPlaneInfo structure within the PixelFormatInfo class
definition and rename it to Plane, to align the naming scheme with other
parts of libcamera, such as FrameBuffer::Plane or FrameMetadata::Plane.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
Laurent Pinchart
2021-09-02 01:42:10 +03:00
parent 9a8c0365f7
commit e85978ef5f
2 changed files with 25 additions and 26 deletions

View File

@@ -23,22 +23,6 @@ namespace libcamera {
LOG_DEFINE_CATEGORY(Formats)
/**
* \class PixelFormatPlaneInfo
* \brief Information about a single plane of a pixel format
*
* \var PixelFormatPlaneInfo::bytesPerGroup
* \brief The number of bytes that a pixel group consumes
*
* \sa PixelFormatInfo::pixelsPerGroup
*
* \var PixelFormatPlaneInfo::verticalSubSampling
* \brief Vertical subsampling multiplier
*
* This value is the ratio between the number of rows of pixels in the frame
* to the number of rows of pixels in the plane.
*/
/**
* \class PixelFormatInfo
* \brief Information about pixel formats
@@ -87,7 +71,7 @@ LOG_DEFINE_CATEGORY(Formats)
*
* A pixel group is defined as the minimum number of pixels (including padding)
* necessary in a row when the image has only one column of effective pixels.
* pixelsPerGroup refers to this value. PixelFormatPlaneInfo::bytesPerGroup,
* pixelsPerGroup refers to this value. PixelFormatInfo::Plane::bytesPerGroup,
* then, refers to the number of bytes that a pixel group consumes. This
* definition of a pixel group allows simple calculation of stride, as
* ceil(width / pixelsPerGroup) * bytesPerGroup. These values are determined
@@ -122,7 +106,7 @@ LOG_DEFINE_CATEGORY(Formats)
* \var PixelFormatInfo::planes
* \brief Information about pixels for each plane
*
* \sa PixelFormatPlaneInfo
* \sa PixelFormatInfo::Plane
*/
/**
@@ -139,6 +123,22 @@ LOG_DEFINE_CATEGORY(Formats)
* \brief RAW colour encoding
*/
/**
* \struct PixelFormatInfo::Plane
* \brief Information about a single plane of a pixel format
*
* \var PixelFormatInfo::Plane::bytesPerGroup
* \brief The number of bytes that a pixel group consumes
*
* \sa PixelFormatInfo::pixelsPerGroup
*
* \var PixelFormatInfo::Plane::verticalSubSampling
* \brief Vertical subsampling multiplier
*
* This value is the ratio between the number of rows of pixels in the frame
* to the number of rows of pixels in the plane.
*/
namespace {
const PixelFormatInfo pixelFormatInfoInvalid{};
@@ -869,7 +869,7 @@ unsigned int PixelFormatInfo::numPlanes() const
{
unsigned int count = 0;
for (const PixelFormatPlaneInfo &p : planes) {
for (const Plane &p : planes) {
if (p.bytesPerGroup == 0)
break;