Ocean
|
Definition of a frame type composed by the frame dimension, pixel format and pixel origin. More...
Data Structures | |
class | GenericPixelFormat |
This class implements a helper class allowing to create generic pixel formats. More... | |
struct | PixelFormatProperties |
Helper struct allowing to get access to the properties of a pixel format with a debugger. More... | |
union | PixelFormatUnion |
This union mainly contains the pixel format as value. More... | |
Public Types | |
enum | DataType : uint8_t { DT_UNDEFINED = 0u , DT_UNSIGNED_INTEGER_8 , DT_SIGNED_INTEGER_8 , DT_UNSIGNED_INTEGER_16 , DT_SIGNED_INTEGER_16 , DT_UNSIGNED_INTEGER_32 , DT_SIGNED_INTEGER_32 , DT_UNSIGNED_INTEGER_64 , DT_SIGNED_INTEGER_64 , DT_SIGNED_FLOAT_16 , DT_SIGNED_FLOAT_32 , DT_SIGNED_FLOAT_64 , DT_END } |
Definition of individual channel data type. More... | |
enum | PixelFormat : uint64_t { FORMAT_UNDEFINED = 0ull , FORMAT_ABGR32 = 1ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_4, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_ARGB32 = 2ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_4, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_BGR24 = 3ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_3, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_BGR32 = 4ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_4, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_BGR4444 = 5ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_16, CV_CHANNELS_UNDEFINED , PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_BGR5551 = 6ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_16, CV_CHANNELS_UNDEFINED , PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_BGR565 = 7ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_16, CV_CHANNELS_UNDEFINED , PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_BGRA32 = 8ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_4, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_BGRA4444 = 9ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_16, CV_CHANNELS_UNDEFINED , PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_BGGR10_PACKED = 10ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_1, MV_MULTIPLE_4, MV_MULTIPLE_2>::value , FORMAT_RGB24 = 11ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_3, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_RGB32 = 12ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_4, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_RGB4444 = 13ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_16, CV_CHANNELS_UNDEFINED , PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_RGB5551 = 14ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_16, CV_CHANNELS_UNDEFINED , PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_RGB565 = 15ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_16, CV_CHANNELS_UNDEFINED , PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_RGBA32 = 16ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_4, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_RGBA4444 = 17ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_16, CV_CHANNELS_UNDEFINED , PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_RGBT32 = 18ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_4, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_RGGB10_PACKED = 19ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_1, MV_MULTIPLE_4, MV_MULTIPLE_2>::value , FORMAT_Y_U_V12 = 20ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_3, MV_MULTIPLE_2, MV_MULTIPLE_2>::value , FORMAT_YUV24 = 21ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_3, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_YUVA32 = 22ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_4, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_YUVT32 = 23ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_4, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_Y_V_U12 = 24ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_3, MV_MULTIPLE_2, MV_MULTIPLE_2>::value , FORMAT_YVU24 = 25ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_3, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_Y_UV12 = 26ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_2, MV_MULTIPLE_2, MV_MULTIPLE_2>::value , FORMAT_Y_VU12 = 27ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_2, MV_MULTIPLE_2, MV_MULTIPLE_2>::value , FORMAT_YUYV16 = 28ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_1, MV_MULTIPLE_2, MV_MULTIPLE_1>::value , FORMAT_UYVY16 = 29ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_1, MV_MULTIPLE_2, MV_MULTIPLE_1>::value , FORMAT_Y8 = 30ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_1, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_Y10 = 31ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_16, CV_CHANNELS_1, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_Y10_PACKED = 32ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_1, MV_MULTIPLE_4, MV_MULTIPLE_1>::value , FORMAT_Y16 = 33ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_16, CV_CHANNELS_1, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_Y32 = 34ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_32, CV_CHANNELS_1, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_Y64 = 35ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_64, CV_CHANNELS_1, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_YA16 = 36ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_2, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_RGB48 = 37ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_16, CV_CHANNELS_3, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_RGBA64 = 38ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_16, CV_CHANNELS_4, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_Y_U_V24 = 39ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_3, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_Y_U_V24_LIMITED_RANGE = FORMAT_Y_U_V24 , FORMAT_Y_U_V24_FULL_RANGE = 40ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_3, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_Y8_LIMITED_RANGE = 41ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_1, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_Y8_FULL_RANGE = FORMAT_Y8 , FORMAT_Y_UV12_LIMITED_RANGE = FORMAT_Y_UV12 , FORMAT_Y_UV12_FULL_RANGE = 42ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_2, MV_MULTIPLE_2, MV_MULTIPLE_2>::value , FORMAT_Y_VU12_LIMITED_RANGE = FORMAT_Y_VU12 , FORMAT_Y_VU12_FULL_RANGE = 43ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_2, MV_MULTIPLE_2, MV_MULTIPLE_2>::value , FORMAT_Y_U_V12_LIMITED_RANGE = FORMAT_Y_U_V12 , FORMAT_Y_U_V12_FULL_RANGE = 44ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_3, MV_MULTIPLE_2, MV_MULTIPLE_2>::value , FORMAT_Y_V_U12_LIMITED_RANGE = FORMAT_Y_V_U12 , FORMAT_Y_V_U12_FULL_RANGE = 45ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_3, MV_MULTIPLE_2, MV_MULTIPLE_2>::value , FORMAT_F32 = 46ull | GenericPixelFormat<DT_SIGNED_FLOAT_32, CV_CHANNELS_1, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_F64 = 47ull | GenericPixelFormat<DT_SIGNED_FLOAT_64, CV_CHANNELS_1, PV_PLANES_1, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_R_G_B24 = 48ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_3, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_B_G_R24 = 49ull | GenericPixelFormat<DT_UNSIGNED_INTEGER_8, CV_CHANNELS_UNDEFINED , PV_PLANES_3, MV_MULTIPLE_1, MV_MULTIPLE_1>::value , FORMAT_END = 50ull } |
Definition of all pixel formats available in the Ocean framework. More... | |
enum | PixelOrigin : uint32_t { ORIGIN_INVALID = 0u , ORIGIN_UPPER_LEFT , ORIGIN_LOWER_LEFT } |
Defines different types of frame origin positions. More... | |
using | DataTypes = std::vector< DataType > |
Definition of a vector holding data types. More... | |
using | PixelFormats = std::vector< PixelFormat > |
Definition of a vector holding pixel formats. More... | |
Public Member Functions | |
FrameType ()=default | |
Creates a new frame type with invalid parameters. More... | |
FrameType (const unsigned int width, const unsigned int height, const PixelFormat pixelFormat, const PixelOrigin pixelOrigin) | |
Creates a new frame type. More... | |
FrameType (const FrameType &type, const unsigned int width, const unsigned int height) | |
Creates a new frame type. More... | |
FrameType (const FrameType &type, const PixelFormat pixelFormat) | |
Creates a new frame type. More... | |
FrameType (const FrameType &type, const PixelOrigin pixelOrigin) | |
Creates a new frame type. More... | |
FrameType (const FrameType &type, const PixelFormat pixelFormat, const PixelOrigin pixelOrigin) | |
Creates a new frame type. More... | |
unsigned int | width () const |
Returns the width of the frame format in pixel. More... | |
unsigned int | height () const |
Returns the height of the frame in pixel. More... | |
PixelFormat | pixelFormat () const |
Returns the pixel format of the frame. More... | |
void | setPixelFormat (const PixelFormat pixelFormat) |
Explicitly changes the pixel format of this frame. More... | |
DataType | dataType () const |
Returns the data type of the pixel format of this frame. More... | |
unsigned int | bytesPerDataType () const |
Returns the number of bytes which are necessary to store the data type of this frame. More... | |
unsigned int | channels () const |
Returns the number of individual channels the frame has. More... | |
uint32_t | numberPlanes () const |
Returns the number of planes of the pixel format of this frame. More... | |
PixelOrigin | pixelOrigin () const |
Returns the pixel origin of the frame. More... | |
unsigned int | pixels () const |
Returns the number of pixels for the frame. More... | |
unsigned int | frameTypeSize () const |
Returns the number of bytes necessary for the frame type, without padding at the end of frame rows. More... | |
bool | isPixelFormatCompatible (const PixelFormat pixelFormat) const |
Returns whether the pixel format of this frame type is compatible with a given pixel format. More... | |
bool | isFrameTypeCompatible (const FrameType &frameType, const bool allowDifferentPixelOrigins) const |
Returns whether this frame type is compatible with a given frame type. More... | |
bool | operator== (const FrameType &right) const |
Returns whether two frame types are equal. More... | |
bool | operator!= (const FrameType &right) const |
Returns whether two frame types are not equal. More... | |
bool | operator< (const FrameType &right) const |
Returns whether the left frame type is 'smaller' than the right one. More... | |
bool | isValid () const |
Returns whether this frame type is valid. More... | |
template<FrameType::DataType tDataType, uint32_t tChannels, uint32_t tPlanes, uint32_t tWidthMultiple, uint32_t tHeightMultiple> | |
constexpr FrameType::PixelFormat | genericPixelFormat () |
template<FrameType::DataType tDataType> | |
constexpr FrameType::PixelFormat | genericPixelFormat (const uint32_t channels, const uint32_t planes, const uint32_t widthMultiple, const uint32_t heightMultiple) |
Static Public Member Functions | |
static unsigned int | channels (const PixelFormat pixelFormat) |
Returns the number of individual channels of a given pixel format. More... | |
static uint32_t | numberPlanes (const PixelFormat pixelFormat) |
Returns the number of planes of a pixel format. More... | |
template<typename T > | |
static constexpr DataType | dataType () |
Returns the (pixel format) data type of a given C++ data type. More... | |
static DataType | dataType (const PixelFormat pixelFormat) |
Returns the data type of a pixel format. More... | |
static unsigned int | bytesPerDataType (const DataType dataType) |
Returns the number of bytes which are necessary to store a specified data type. More... | |
static constexpr PixelFormat | genericPixelFormat (const DataType dataType, const uint32_t channels, const uint32_t planes=1u, const uint32_t widthMultiple=1u, const uint32_t heightMultiple=1u) |
Returns a specific generic pixel format with a specified data type, channel number, and plane number. More... | |
static PixelFormat | genericPixelFormat (const unsigned int bitsPerPixelChannel, const uint32_t channels, const uint32_t planes=1u, const uint32_t widthMultiple=1u, const uint32_t heightMultiple=1u) |
Returns a specific generic pixel format with specified bit per pixel per channel, channel number, and plane number. More... | |
template<DataType tDataType, uint32_t tChannels, uint32_t tPlanes = 1u, uint32_t tWidthMultiple = 1u, uint32_t tHeightMultiple = 1u> | |
constexpr static PixelFormat | genericPixelFormat () |
Returns a specific generic pixel format with a specified data type and channel number. More... | |
template<DataType tDataType> | |
constexpr static PixelFormat | genericPixelFormat (const uint32_t channels, const uint32_t planes=1u, const uint32_t widthMultiple=1u, const uint32_t heightMultiple=1u) |
Returns a specific generic pixel format with a specified data type and channel number. More... | |
template<typename TDataType , uint32_t tChannels, uint32_t tPlanes = 1u, uint32_t tWidthMultiple = 1u, uint32_t tHeightMultiple = 1u> | |
constexpr static PixelFormat | genericPixelFormat () |
Returns a specific generic pixel format with a specified data type and channel number. More... | |
template<typename TDataType > | |
constexpr static PixelFormat | genericPixelFormat (uint32_t channels, const uint32_t planes=1u, const uint32_t widthMultiple=1u, const uint32_t heightMultiple=1u) |
Returns a specific generic pixel format with a specified data type and channel number. More... | |
static PixelFormat | makeGenericPixelFormat (const PixelFormat pixelFormat) |
Converts a any pixel format into a generic one This function has no effect for input pixel formats which are already generic. More... | |
static bool | formatIsGeneric (const PixelFormat pixelFormat, const DataType dataType, const uint32_t channels, const uint32_t planes=1u, const uint32_t widthMultiple=1u, const uint32_t heightMultiple=1u) |
Checks whether a given pixel format is a specific layout regarding data channels and data type. More... | |
static bool | formatIsGeneric (const PixelFormat pixelFormat) |
Checks whether a given pixel format is a generic pixel format. More... | |
static bool | formatIsPureGeneric (const PixelFormat pixelFormat) |
Checks whether a given pixel format is a pure generic pixel format. More... | |
static unsigned int | formatGenericNumberChannels (const PixelFormat pixelFormat) |
Returns the number of individual channels of a given generic pixel format. More... | |
static unsigned int | formatGenericBitsPerPixel (const PixelFormat pixelFormat) |
Returns the number of bits of one pixel for a given generic pixel format. More... | |
static unsigned int | formatBitsPerPixelRedChannel (const PixelFormat pixelFormat) |
Returns the number of bits of one pixel for the red channel. More... | |
static unsigned int | formatBitsPerPixelGreenChannel (const PixelFormat pixelFormat) |
Returns the number of bits of one pixel for the green channel. More... | |
static unsigned int | formatBitsPerPixelBlueChannel (const PixelFormat pixelFormat) |
Returns the number of bits of one pixel for the blue channel. More... | |
static unsigned int | formatBitsPerPixelAlphaChannel (const PixelFormat pixelFormat) |
Returns the number of bits of one pixel for the alpha channel. More... | |
static bool | formatHasAlphaChannel (const PixelFormat pixelFormat, bool *isLastChannel=nullptr) |
Returns whether a given pixel format holds an alpha channel. More... | |
static bool | formatIsPacked (const PixelFormat pixelFormat) |
Returns whether a given pixel format is a packed pixel format. More... | |
static PixelFormat | genericSinglePlanePixelFormat (const PixelFormat pixelFormat) |
Returns the most suitable 1-plane pixel format for a given pixel format which may be composed of several planes. More... | |
static PixelFormat | formatAddAlphaChannel (const PixelFormat pixelFormat, const bool lastChannel=true) |
Adds an alpha channel to a given pixel format. More... | |
static PixelFormat | formatRemoveAlphaChannel (const PixelFormat pixelFormat) |
Removes an alpha channel from a given pixel format. More... | |
static unsigned int | widthMultiple (const PixelFormat pixelFormat) |
Returns the number of pixels the width of a frame must be a multiple of. More... | |
static unsigned int | heightMultiple (const PixelFormat pixelFormat) |
Returns the number of pixels the height of a frame must be a multiple of. More... | |
static unsigned int | planeChannels (const PixelFormat &imagePixelFormat, const unsigned int planeIndex) |
Returns the channels of a plane for a pixel format. More... | |
static unsigned int | planeBytesPerPixel (const PixelFormat &imagePixelFormat, const unsigned int planeIndex) |
Returns the number of bytes of one pixel of a plane for a pixel format. More... | |
static bool | planeLayout (const PixelFormat imagePixelFormat, const unsigned int imageWidth, const unsigned int imageHeight, const unsigned int planeIndex, unsigned int &planeWidth, unsigned int &planeHeight, unsigned int &planeChannels, unsigned int *planeWidthElementsMultiple=nullptr, unsigned int *planeHeightElementsMultiple=nullptr) |
Returns the plane layout of a given pixel format. More... | |
static bool | planeLayout (const FrameType &frameType, const unsigned int planeIndex, unsigned int &planeWidth, unsigned int &planeHeight, unsigned int &planeChannels, unsigned int *planeWidthElementsMultiple=nullptr, unsigned int *planeHeightElementsMultiple=nullptr) |
Returns the plane layout of a given frame type. More... | |
static DataType | translateDataType (const std::string &dataType) |
Translates a string containing a data type into the data type. More... | |
static PixelFormat | translatePixelFormat (const std::string &pixelFormat) |
Translates a string containing a pixel format into the pixel format. More... | |
static PixelOrigin | translatePixelOrigin (const std::string &pixelOrigin) |
Translates a string containing the pixel origin into the pixel origin value. More... | |
static std::string | translateDataType (const DataType dataType) |
Translates a data type value into a string containing the data type. More... | |
static std::string | translatePixelFormat (const PixelFormat pixelFormat) |
Translates a pixel format value into a string containing the pixel format. More... | |
static std::string | translatePixelOrigin (const PixelOrigin pixelOrigin) |
Translates a pixel origin value into a string containing the pixel origin. More... | |
static PixelFormat | findPixelFormat (const unsigned int bitsPerPixel) |
Returns a best fitting pixel format having the given number of bits per pixels. More... | |
static PixelFormat | findPixelFormat (const DataType dataType, const unsigned int channels) |
Returns a best fitting pixel format having the given number of bits per pixels. More... | |
static bool | arePixelFormatsCompatible (const PixelFormat pixelFormatA, const PixelFormat pixelFormatB) |
Returns whether two given pixel formats are compatible. More... | |
static bool | areFrameTypesCompatible (const FrameType &frameTypeA, const FrameType &frameTypeB, const bool allowDifferentPixelOrigins) |
Returns whether two given frame types are compatible. More... | |
template<typename T > | |
static bool | dataIsAligned (const void *data) |
Returns whether a given pointer has the same byte alignment as the size of the data type the pointer is pointing to. More... | |
static const FrameType::DataTypes & | definedDataTypes () |
Returns all defined data types. More... | |
static const FrameType::PixelFormats & | definedPixelFormats () |
Returns all defined pixel formats. More... | |
template<> | |
constexpr FrameType::DataType | dataType () |
template<> | |
constexpr FrameType::DataType | dataType () |
template<> | |
constexpr FrameType::DataType | dataType () |
template<> | |
constexpr FrameType::DataType | dataType () |
template<> | |
constexpr FrameType::DataType | dataType () |
template<> | |
constexpr FrameType::DataType | dataType () |
template<> | |
constexpr FrameType::DataType | dataType () |
template<> | |
constexpr FrameType::DataType | dataType () |
template<> | |
constexpr FrameType::DataType | dataType () |
template<> | |
constexpr FrameType::DataType | dataType () |
template<> | |
constexpr FrameType::DataType | dataType () |
template<> | |
constexpr FrameType::DataType | dataType () |
template<> | |
constexpr FrameType::DataType | dataType () |
Protected Types | |
enum | ChannelsValue : uint32_t { CV_CHANNELS_UNDEFINED = 0u , CV_CHANNELS_1 = 1u , CV_CHANNELS_2 = 2u , CV_CHANNELS_3 = 3u , CV_CHANNELS_4 = 4u } |
Definition of a protected helper enum that simplifies to read the definition of a predefined pixel format. More... | |
enum | PlanesValue : uint32_t { PV_PLANES_1 = 1u , PV_PLANES_2 = 2u , PV_PLANES_3 = 3u , PV_PLANES_4 = 4u } |
Definition of a protected helper enum that simplifies to read the definition of a predefined pixel format. More... | |
enum | MultipleValue : uint32_t { MV_MULTIPLE_1 = 1u , MV_MULTIPLE_2 = 2u , MV_MULTIPLE_3 = 3u , MV_MULTIPLE_4 = 4u } |
Definition of a protected helper enum that simplifies to read the definition of a predefined pixel format. More... | |
Static Protected Attributes | |
static constexpr uint32_t | pixelFormatBitOffsetChannels = 16u |
The number of bits the channel value is shifted within the PixelFormat value. More... | |
static constexpr uint32_t | pixelFormatBitOffsetDatatype = pixelFormatBitOffsetChannels + 8u |
The number of bits the data type value is shifted within the PixelFormat value. More... | |
static constexpr uint32_t | pixelFormatBitOffsetPlanes = pixelFormatBitOffsetDatatype + 8u |
The number of bits the planes value is shifted within the PixelFormat value. More... | |
static constexpr uint32_t | pixelFormatBitOffsetWidthMultiple = pixelFormatBitOffsetPlanes + 8u |
The number of bits the width-multiple value is shifted within the PixelFormat value. More... | |
static constexpr uint32_t | pixelFormatBitOffsetHeightMultiple = pixelFormatBitOffsetWidthMultiple + 8u |
The number of bits the height-multiple value is shifted within the PixelFormat value. More... | |
Private Attributes | |
unsigned int | width_ = 0u |
Frame width in pixel, with range [0, infinity) More... | |
unsigned int | height_ = 0u |
Frame height in pixel, with range [0, infinity) More... | |
PixelFormatUnion | pixelFormat_ = PixelFormatUnion(FORMAT_UNDEFINED) |
The pixel format of the frame encapsulated in a union (mainly holding PixelFormat). More... | |
PixelOrigin | pixelOrigin_ = ORIGIN_INVALID |
The origin of the pixel data, either the upper left corner or the bottom left corner (if valid). More... | |
Definition of a frame type composed by the frame dimension, pixel format and pixel origin.
The frame dimension of a frame specifies the number of pixels in horizontal (width) and vertical (height) direction.
The pixel format specifies which kind of image information is stored.
The pixel origin defines whether the image data starts at the top left corner or at the bottom left corner.
using Ocean::FrameType::DataTypes = std::vector<DataType> |
Definition of a vector holding data types.
using Ocean::FrameType::PixelFormats = std::vector<PixelFormat> |
Definition of a vector holding pixel formats.
|
protected |
Definition of a protected helper enum that simplifies to read the definition of a predefined pixel format.
enum Ocean::FrameType::DataType : uint8_t |
Definition of individual channel data type.
|
protected |
Definition of a protected helper enum that simplifies to read the definition of a predefined pixel format.
enum Ocean::FrameType::PixelFormat : uint64_t |
Definition of all pixel formats available in the Ocean framework.
Several common pixel formats are predefined specifying a unique representation of the image information of a frame.
Further, generic pixel formats can be defined. Generic formats can have up to 31 zipped data channels and can be composed of any kind of data type.
The value of a pixel format can be separated into individual parts.
The lower two bytes can be used for predefined pixel formats.
The third byte define the number of data channels of all generic zipped pixel formats.
The fourth byte define the data type.
The fifth byte holds the number of planes.
The sixth byte holds the number of pixels the width of a frame must be a multiple of.
The seventh byte holds the number of pixels the height of a frame must be a multiple of:
Byte: | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | | unused | height-multiple | width-multiple | planes | data type | channel number | predefined pixel format |
A generic zipped pixel format may have the same data layout compared to a predefined pixel format while the actual value of the pixel format may be different.
The naming convention of predefined pixel formats is:
Left to right is equivalent from first to last bytes in memory.
For example RGB24 stored the red color value in the first byte and the blue color value in the last byte.
BGRA32 stores the blue color value in the first byte, green in the second bytes, red in the third byte and the alpha value in the last byte.
The following code can be used to define a generic pixel format, in case the predefined pixel formats in 'PixelFormat' do not have the desired format:
Enumerator | |
---|---|
FORMAT_UNDEFINED | Undefined pixel format. |
FORMAT_ABGR32 | Pixel format with byte order ABGR and 32 bits per pixel. Here is the memory layout: Pixel: 0 1 Byte: 0 1 2 3 4 Bit: 0123456789ABCDEF0123456789ABCDEF 01234567 Channel: 0 1 2 3 0 Color: AAAAAAAABBBBBBBBGGGGGGGGRRRRRRRR AAAAAAAA ........ |
FORMAT_ARGB32 | Pixel format with byte order ARGB and 32 bits per pixel. Here is the memory layout: Pixel: 0 1 Byte: 0 1 2 3 4 Bit: 0123456789ABCDEF0123456789ABCDEF 01234567 Channel: 0 1 2 3 0 Color: AAAAAAAARRRRRRRRGGGGGGGGBBBBBBBB AAAAAAAA ........ |
FORMAT_BGR24 | Pixel format with byte order BGR and 24 bits per pixel. Here is the memory layout: Pixel: 0 1 2 Byte: 0 1 2 3 4 5 6 Bit: 0123456789ABCDEF01234567 89ABCDEF0123456789ABCDEF 01234567 Channel: 0 1 2 0 1 2 0 Color: BBBBBBBBGGGGGGGGRRRRRRRR BBBBBBBBGGGGGGGGRRRRRRRR BBBBBBBB ........ |
FORMAT_BGR32 | Pixel format with byte order BGR and 24 bits per pixel and 8 unused bits. Here is the memory layout: Pixel: 0 1 Byte: 0 1 2 3 4 Bit: 0123456789ABCDEF0123456789ABCDEF 01234567 Channel: 0 1 2 0 Color: BBBBBBBBGGGGGGGGRRRRRRRR BBBBBBBB ........ |
FORMAT_BGR4444 | Pixel format with entirely 16 bits per pixel, 12 bits for BGR and 4 unused bits. |
FORMAT_BGR5551 | Pixel format with entirely 16 bits per pixel, 15 bits for BGR and 1 unused bit. |
FORMAT_BGR565 | Pixel format with 16 bits per pixel, 5 bits for blue, 6 bits for green and 5 bits for red. Here is the memory layout: Pixel: 0 1 2 Byte: 0 1 2 3 4 Bit: 0123456789ABCDEF 0123456789ABCDEF 01234 Channel: 0 1 2 0 1 2 0 Color: BBBBBGGGGGGRRRRR BBBBBGGGGGGRRRRR BBBBB ........ This pixel format is equivalent to the following pixel formats on Android (note the inverse order or RGB): |
FORMAT_BGRA32 | Pixel format with byte order BGRA and 32 bits per pixel. Here is the memory layout: Pixel: 0 1 Byte: 0 1 2 3 4 Bit: 0123456789ABCDEF0123456789ABCDEF 01234567 Channel: 0 1 2 3 0 Color: BBBBBBBBGGGGGGGGRRRRRRRRAAAAAAAA BBBBBBBB ........ |
FORMAT_BGRA4444 | Pixel format with entirely 16 bits per pixel, 4 bits for each channel. |
FORMAT_BGGR10_PACKED | The packed pixel format representing a Bayer mosaic pattern for images with blue, green, and red channels with order BGGR for a 2x2 pixel block. The format has the byte order B G for the upper two pixels, and G R for the lower two pixels in a 2x2 pixel block. Pixel: 0 1 2 3 0 1 2 3 4 5 6 7 4 5 6 7 Byte: 0 1 2 3 4 5 6 7 8 9 Bit: 01234567 89ABCDEF 01234567 89ABCDEF 01234567 01234567 89ABCDEF 01234567 89ABCDEF 01234567 Channel: row 0: 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Channel: row 1: 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 Color: row 1: BBBBBBBB GGGGGGGG BBBBBBBB GGGGGGGG BBGGBBGG BBBBBBBB GGGGGGGG BBBBBBBB GGGGGGGG BBGGBBGG ........ Color: row 0: GGGGGGGG RRRRRRRR GGGGGGGG RRRRRRRR GGRRGGRR GGGGGGGG RRRRRRRR GGGGGGGG RRRRRRRR GGRRGGRR ........ Color: row 2: BBBBBBBB GGGGGGGG ........ |
FORMAT_RGB24 | Pixel format with byte order RGB and 24 bits per pixel. Here is the memory layout: Pixel: 0 1 2 Byte: 0 1 2 3 4 5 6 Bit: 0123456789ABCDEF01234567 89ABCDEF0123456789ABCDEF 01234567 Channel: 0 1 2 0 1 2 0 Color: RRRRRRRRGGGGGGGGBBBBBBBB RRRRRRRRGGGGGGGGBBBBBBBB RRRRRRRR ........ |
FORMAT_RGB32 | Pixel format with byte order RGB and 24 bits per pixel and 8 unused bits. Here is the memory layout: Pixel: 0 1 Byte: 0 1 2 3 4 Bit: 0123456789ABCDEF0123456789ABCDEF 01234567 Channel: 0 1 2 0 Color: RRRRRRRRGGGGGGGGBBBBBBBB RRRRRRRR ........ |
FORMAT_RGB4444 | Pixel format with entirely 16 bits per pixel, 12 bits for RGB and 4 unused bits. Here is the memory layout: Pixel: 0 1 2 Byte: 0 1 2 3 4 Bit: 0123456789ABCDEF 0123456789ABCDEF 01234 Channel: 0 1 2 0 1 2 0 Color: RRRRGGGGBBBB RRRRGGGGBBBB RRRRR ........ |
FORMAT_RGB5551 | Pixel format with entirely 16 bits per pixel, 15 bits for RGB and 1 unused bit. Here is the memory layout: Pixel: 0 1 2 Byte: 0 1 2 3 4 Bit: 0123456789ABCDEF 0123456789ABCDEF 01234 Channel: 0 1 2 0 1 2 0 Color: RRRRRGGGGGBBBBB RRRRRGGGGGBBBBB RRRRR ........ |
FORMAT_RGB565 | Pixel format with entirely 16 bits per pixel, 5 bits for red, 6 bits for green and 5 bits for blue. Here is the memory layout: Pixel: 0 1 2 Byte: 0 1 2 3 4 Bit: 0123456789ABCDEF 0123456789ABCDEF 01234 Channel: 0 1 2 0 1 2 0 Color: RRRRRGGGGGGBBBBB RRRRRGGGGGGBBBBB RRRRR ........ |
FORMAT_RGBA32 | Pixel format with byte order RGBA and 32 bits per pixel. Here is the memory layout: Pixel: 0 1 Byte: 0 1 2 3 4 Bit: 0123456789ABCDEF0123456789ABCDEF 01234567 Channel: 0 1 2 3 0 Color: RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA RRRRRRRR ........ This pixel format is equivalent to the following pixel formats on Android (note the inverse order of ARGB): |
FORMAT_RGBA4444 | Pixel format with entirely 16 bits per pixel, 4 bits for each channel. Here is the memory layout: Pixel: 0 1 2 Byte: 0 1 2 3 4 Bit: 0123456789ABCDEF 0123456789ABCDEF 01234 Channel: 0 1 2 0 1 2 0 Color: RRRRGGGGBBBBAAAA RRRRGGGGBBBBAAAA RRRRR ........ |
FORMAT_RGBT32 | Pixel format with byte order RGBT and 24 bits for the RGB channels and 8 bits for an arbitrary texture channel. Here is the memory layout: Pixel: 0 1 Byte: 0 1 2 3 4 Bit: 0123456789ABCDEF0123456789ABCDEF 01234567 Channel: 0 1 2 3 0 Color: RRRRRRRRGGGGGGGGBBBBBBBBTTTTTTTT RRRRRRRR ........ |
FORMAT_RGGB10_PACKED | The packed pixel format representing a Bayer mosaic pattern for images with red, green, and blue channels with order RGGB for a 2x2 pixel block. The format has the byte order R G for the upper two pixels, and G B for the lower two pixels in a 2x2 pixel block. Pixel: 0 1 2 3 0 1 2 3 4 5 6 7 4 5 6 7 Byte: 0 1 2 3 4 5 6 7 8 9 Bit: 01234567 89ABCDEF 01234567 89ABCDEF 01234567 01234567 89ABCDEF 01234567 89ABCDEF 01234567 Channel: row 0: 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Channel: row 1: 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 Color: row 0: RRRRRRRR GGGGGGGG RRRRRRRR GGGGGGGG RRGGRRGG RRRRRRRR GGGGGGGG RRRRRRRR GGGGGGGG RRGGRRGG ........ Color: row 1: GGGGGGGG BBBBBBBB GGGGGGGG BBBBBBBB GGBBGGBB GGGGGGGG BBBBBBBB GGGGGGGG BBBBBBBB GGBBGGBB ........ Color: row 2: RRRRRRRR GGGGGGGG ........ |
FORMAT_Y_U_V12 | Pixel format with 8 bits Y frame as individual block, followed by 8 bits 2x2 sub-sampled U frame and 8 bits 2x2 sub-sampled V frame, both as individual blocks, resulting in 12 bits per pixel. Sometimes also denoted as 'I420'. The memory layout of a Y_U_V12 image looks like this: y-plane: u-plane: v-plane: --------- ----- ----- | Y Y Y Y | | U U | | V V | | Y Y Y Y | | U U | | V V | | Y Y Y Y | ----- ----- | Y Y Y Y | --------- Width and height must be even (multiple of two). |
FORMAT_YUV24 | Pixel format with byte order YUV and 24 bits per pixel. Here is the memory layout: Pixel: 0 1 2 Byte: 0 1 2 3 4 5 6 Bit: 0123456789ABCDEF01234567 89ABCDEF0123456789ABCDEF 01234567 Channel: 0 1 2 0 1 2 0 Color: YYYYYYYYUUUUUUUUVVVVVVVV YYYYYYYYUUUUUUUUVVVVVVVV YYYYYYYY ........ |
FORMAT_YUVA32 | Pixel format with byte order YUVA and 32 bits per pixel. Here is the memory layout: Pixel: 0 1 Byte: 0 1 2 3 4 Bit: 0123456789ABCDEF0123456789ABCDEF 01234567 Channel: 0 1 2 3 0 Color: YYYYYYYYUUUUUUUUVVVVVVVVAAAAAAAA YYYYYYYY ........ |
FORMAT_YUVT32 | Pixel format with byte order YUVA and 24 bits for the YUV channels and 8 bit for an arbitrary texture channel. |
FORMAT_Y_V_U12 | Pixel format with 8 bits Y frame as individual block, followed by 8 bits 2x2 sub-sampled V frame and 8 bits 2x2 sub-sampled U frame, both as individual blocks, resulting in 12 bits per pixel. Sometimes also denoted as 'YV12'. The memory layout of a Y_V_U12 image looks like this: y-plane: v-plane: u-plane: --------- ----- ----- | Y Y Y Y | | V V | | U U | | Y Y Y Y | | V V | | U U | | Y Y Y Y | ----- ----- | Y Y Y Y | --------- Width and height must be even (multiple of two). |
FORMAT_YVU24 | Pixel format with byte order YVU and 24-bits per pixel. Here is the memory layout: Pixel: 0 1 2 Byte: 0 1 2 3 4 5 6 Bit: 0123456789ABCDEF01234567 89ABCDEF0123456789ABCDEF 01234567 Channel: 0 1 2 0 1 2 0 Color: YYYYYYYYVVVVVVVVUUUUUUUU YYYYYYYYVVVVVVVVUUUUUUUU YYYYYYYY ........ |
FORMAT_Y_UV12 | This pixel format is deprecated and is currently an alias for FORMAT_Y_UV12_LIMITED_RANGE. Pixel format with 8 bits Y frame as entire block, followed by 8 bits 2x2 sub-sampled U and V zipped (interleaved) pixels, resulting in 12 bits per pixel. Sometimes also denoted as 'NV12'. The memory layout of a Y_UV12 image looks like this: y-plane: u/v-plane: --------- --------- | Y Y Y Y | | U V U V | | Y Y Y Y | | U V U V | | Y Y Y Y | --------- | Y Y Y Y | --------- Width and height must be even (multiple of two). |
FORMAT_Y_VU12 | Pixel format with 8 bits Y frame as entire block, followed by 8 bits 2x2 sub-sampled V and U zipped (interleaved) pixels, resulting in 12 bits per pixel. Sometimes also denoted as 'NV21'. The memory layout of a Y_VU12 image looks like this: y-plane: v/u-plane: --------- --------- | Y Y Y Y | | V U V U | | Y Y Y Y | | V U V U | | Y Y Y Y | --------- | Y Y Y Y | --------- Width and height must be even (multiple of two). |
FORMAT_YUYV16 | Pixel format with 8 bit Y pixel values zipped (interleaved) with 8 bits 2x1 (horizontal) sub-sampled U and V pixel values respectively, resulting in 16 bits per pixel. Sometimes also denoted as 'YUY2'. The memory layout of a YUYV16 image looks like this: y/u/v-plane: ----------------- | Y U Y V Y U Y V | | Y U Y V Y U Y V | | Y U Y V Y U Y V | | Y U Y V Y U Y V | ----------------- The width must be even (multiple of two). |
FORMAT_UYVY16 | Pixel format with 8 bit Y pixel values zipped (interleaved) with 8 bits 2x1 (horizontal) sub-sampled U and V pixel values respectively, resulting in 16 bits per pixel. Sometimes also denoted as 'UYVY'. The memory layout of a UYVY16 image looks like this: y/u/v-plane: ----------------- | U Y V Y U Y V Y | | U Y V Y U Y V Y | | U Y V Y U Y V Y | | U Y V Y U Y V Y | ----------------- The width must be even (multiple of two). |
FORMAT_Y8 | Pixel format for grayscale images with byte order Y and 8 bits per pixel. Here is the memory layout: Pixel: 0 1 Byte: 0 1 Bit: 01234567 89ABCDEF Channel: 0 0 Color: YYYYYYYY YYYYYYYY ........ |
FORMAT_Y10 | Pixel format with byte order Y and 10 bits per pixel, the upper 6 bits are unused. Here is the memory layout: Pixel: 0 1 Byte: 0 1 2 3 Bit: 01234567 89ABCDEF 01234567 89ABCDEF Channel: 0 0 Color: YYYYYYYY YY YYYYYYYY YY ........ |
FORMAT_Y10_PACKED | Pixel format with byte order Y and 10 bits per pixel, packed so that four consecutive pixels fit into five bytes. The higher 8 bits of each pixel are stored in the first four bytes, the lower 2 bits of all four pixels are stored in the fifth byte. Here is the memory layout: Pixel: 0 1 2 3 0 1 2 3 4 5 6 7 4 5 6 7 Byte: 0 1 2 3 4 5 6 7 8 9 Bit: 01234567 89ABCDEF 01234567 89ABCDEF 01234567 01234567 89ABCDEF 01234567 89ABCDEF 01234567 Channel: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Color: YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY ........ |
FORMAT_Y16 | Pixel format with 16 bits Y frame. Here is the memory layout: Pixel: 0 1 2 Byte: 0 1 2 3 4 Bit: 0123456789ABCDEF 0123456789ABCDEF 01 Channel: 0 0 Color: YYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYY YY ........ |
FORMAT_Y32 | Pixel format with 32 bits Y frame. |
FORMAT_Y64 | Pixel format with 64 bits Y frame. |
FORMAT_YA16 | Pixel format with byte order YA and 16 bits per pixel. |
FORMAT_RGB48 | Pixel format with byte order RGB and 48 bits per pixel, with 16 bit per component. Here is the memory layout: Pixel: 0 1 Byte: 0 1 2 3 4 5 6 7 Bit: 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF 0123456789ABCDEF Channel: 0 1 2 0 Color: RRRRRRRRRRRRRRRRGGGGGGGGGGGGGGGGBBBBBBBBBBBBBBBB RRRRRRRRRRRRRRRR ........ |
FORMAT_RGBA64 | Pixel format with byte order RGBA and 64 bits per pixel, with 16 bit per component. Here is the memory layout: Pixel: 0 1 Byte: 0 1 2 3 4 5 6 7 8 9 Bit: 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF 0123456789ABCDEF Channel: 0 1 2 3 0 Color: RRRRRRRRRRRRRRRRGGGGGGGGGGGGGGGGBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAA RRRRRRRRRRRRRRRR ........ |
FORMAT_Y_U_V24 | This pixel format is deprecated and is currently an alias for FORMAT_Y_U_V24_LIMITED_RANGE. Pixel format with 8 bits Y frame as individual block, followed by 8 bits U frame as individual block, followed by a V frame as individual block, resulting in 24 bits per pixel. Sometimes also denoted as 'I444'. The memory layout of a Y_U_V24 image looks like this: y-plane: u-plane: v-plane: --------- --------- --------- | Y Y Y Y | | U U U U | | V V V V | | Y Y Y Y | | U U U U | | V V V V | | Y Y Y Y | | U U U U | | V V V V | | Y Y Y Y | | U U U U | | V V V V | --------- --------- --------- |
FORMAT_Y_U_V24_LIMITED_RANGE | Pixel format with 8 bits Y frame as individual block, followed by 8 bits U frame as individual block, followed by a V frame as individual block, resulting in 24 bits per pixel. Sometimes also denoted as 'I444'. The pixel format is using a limited value range for the individual channels: Y channel: [16, 235] U channel: [16, 240] V channel: [16, 240] The memory layout of a Y_U_V24 image looks like this: y-plane: u-plane: v-plane: --------- --------- --------- | Y Y Y Y | | U U U U | | V V V V | | Y Y Y Y | | U U U U | | V V V V | | Y Y Y Y | | U U U U | | V V V V | | Y Y Y Y | | U U U U | | V V V V | --------- --------- ---------
|
FORMAT_Y_U_V24_FULL_RANGE | Pixel format with 8 bits Y frame as individual block, followed by 8 bits U frame as individual block, followed by a V frame as individual block, resulting in 24 bits per pixel. Sometimes also denoted as 'I444'. The pixel format is using a full value range for all three channels: Y channel: [0, 255] U channel: [0, 255] V channel: [0, 255] The memory layout of a Y_U_V24 image looks like this: y-plane: u-plane: v-plane: --------- --------- --------- | Y Y Y Y | | U U U U | | V V V V | | Y Y Y Y | | U U U U | | V V V V | | Y Y Y Y | | U U U U | | V V V V | | Y Y Y Y | | U U U U | | V V V V | --------- --------- ---------
|
FORMAT_Y8_LIMITED_RANGE | Pixel format for grayscale images with byte order Y and 8 bits per pixel (with limited range). The pixel format is using a limited value range: Y channel: [16, 235] Here is the memory layout: Pixel: 0 1 Byte: 0 1 Bit: 01234567 89ABCDEF Channel: 0 0 Color: YYYYYYYY YYYYYYYY ........
|
FORMAT_Y8_FULL_RANGE | Pixel format for grayscale images with byte order Y and 8 bits per pixel (with full range). The pixel format is using a full value range: Y channel: [0, 255] Here is the memory layout: Pixel: 0 1 Byte: 0 1 Bit: 01234567 89ABCDEF Channel: 0 0 Color: YYYYYYYY YYYYYYYY ........
|
FORMAT_Y_UV12_LIMITED_RANGE | Pixel format with 8 bits Y frame as entire block, followed by 8 bits 2x2 sub-sampled U and V zipped (interleaved) pixels, resulting in 12 bits per pixel. Sometimes also denoted as 'NV12'. The pixel format is using a limited value range for all three channels: Y channel: [16, 235] U channel: [16, 240] V channel: [16, 240] The memory layout of a Y_UV12 image looks like this: y-plane: u/v-plane: --------- --------- | Y Y Y Y | | U V U V | | Y Y Y Y | | U V U V | | Y Y Y Y | --------- | Y Y Y Y | ---------
|
FORMAT_Y_UV12_FULL_RANGE | Pixel format with 8 bits Y frame as entire block, followed by 8 bits 2x2 sub-sampled U and V zipped (interleaved) pixels, resulting in 12 bits per pixel. Sometimes also denoted as 'NV12'. The pixel format is using a full value range for all three channels: Y channel: [0, 255] U channel: [0, 255] V channel: [0, 255] The memory layout of a Y_UV12 image looks like this: y-plane: u/v-plane: --------- --------- | Y Y Y Y | | U V U V | | Y Y Y Y | | U V U V | | Y Y Y Y | --------- | Y Y Y Y | ---------
|
FORMAT_Y_VU12_LIMITED_RANGE | Pixel format with 8 bits Y frame as entire block, followed by 8 bits 2x2 sub-sampled V and U zipped (interleaved) pixels, resulting in 12 bits per pixel. Sometimes also denoted as 'NV21'. The pixel format is using a limited value range for all three channels: Y channel: [16, 235] V channel: [16, 240] U channel: [16, 240] The memory layout of a Y_VU12 image looks like this: y-plane: u/v-plane: --------- --------- | Y Y Y Y | | V U V U | | Y Y Y Y | | V U V U | | Y Y Y Y | --------- | Y Y Y Y | ---------
|
FORMAT_Y_VU12_FULL_RANGE | Pixel format with 8 bits Y frame as entire block, followed by 8 bits 2x2 sub-sampled V and U zipped (interleaved) pixels, resulting in 12 bits per pixel. Sometimes also denoted as 'NV21'. The pixel format is using a full value range for all three channels: Y channel: [0, 255] V channel: [0, 255] U channel: [0, 255] The memory layout of a Y_VU12 image looks like this: y-plane: u/v-plane: --------- --------- | Y Y Y Y | | V U V U | | Y Y Y Y | | V U V U | | Y Y Y Y | --------- | Y Y Y Y | ---------
|
FORMAT_Y_U_V12_LIMITED_RANGE | Pixel format with 8 bits Y frame as individual block, followed by 8 bits 2x2 sub-sampled U frame and 8 bits 2x2 sub-sampled V frame, both as individual blocks, resulting in 12 bits per pixel. Sometimes also denoted as 'I420'. The pixel format is using a limited value range for all three channels: Y channel: [16, 235] V channel: [16, 240] U channel: [16, 240] The memory layout of a Y_U_V12 image looks like this: y-plane: u-plane: v-plane: --------- ----- ----- | Y Y Y Y | | U U | | V V | | Y Y Y Y | | U U | | V V | | Y Y Y Y | ----- ----- | Y Y Y Y | ---------
|
FORMAT_Y_U_V12_FULL_RANGE | Pixel format with 8 bits Y frame as individual block, followed by 8 bits 2x2 sub-sampled U frame and 8 bits 2x2 sub-sampled V frame, both as individual blocks, resulting in 12 bits per pixel. Sometimes also denoted as 'I420'. The pixel format is using a full value range for all three channels: Y channel: [0, 255] V channel: [0, 255] U channel: [0, 255] The memory layout of a Y_U_V12 image looks like this: y-plane: u-plane: v-plane: --------- ----- ----- | Y Y Y Y | | U U | | V V | | Y Y Y Y | | U U | | V V | | Y Y Y Y | ----- ----- | Y Y Y Y | ---------
|
FORMAT_Y_V_U12_LIMITED_RANGE | Pixel format with 8 bits Y frame as individual block, followed by 8 bits 2x2 sub-sampled V frame and 8 bits 2x2 sub-sampled U frame, both as individual blocks, resulting in 12 bits per pixel. Sometimes also denoted as 'YV12'. The pixel format is using a limited value range for all three channels: Y channel: [16, 235] V channel: [16, 240] U channel: [16, 240] The memory layout of a Y_V_U12 image looks like this: y-plane: v-plane: u-plane: --------- ----- ----- | Y Y Y Y | | V V | | U U | | Y Y Y Y | | V V | | U U | | Y Y Y Y | ----- ----- | Y Y Y Y | ---------
|
FORMAT_Y_V_U12_FULL_RANGE | Pixel format with 8 bits Y frame as individual block, followed by 8 bits 2x2 sub-sampled V frame and 8 bits 2x2 sub-sampled U frame, both as individual blocks, resulting in 12 bits per pixel. Sometimes also denoted as 'YV12'. The pixel format is using a full value range for all three channels: Y channel: [0, 255] V channel: [0, 255] U channel: [0, 255] The memory layout of a Y_V_U12 image looks like this: y-plane: v-plane: u-plane: --------- ----- ----- | Y Y Y Y | | V V | | U U | | Y Y Y Y | | V V | | U U | | Y Y Y Y | ----- ----- | Y Y Y Y | ---------
|
FORMAT_F32 | Pixel format for a frame with one channel and 32 bit floating point precision per element. |
FORMAT_F64 | Pixel format for a frame with one channel and 64 bit floating point precision per element. |
FORMAT_R_G_B24 | Pixel format with 8 bits R frame as individual block, followed by 8 bits G frame as individual block, followed by a B frame as individual block, resulting in 24 bits per pixel. The memory layout of a R_G_B24 image looks like this: r-plane: g-plane: b-plane: --------- --------- --------- | R R R R | | G G G G | | B B B B | | R R R R | | G G G G | | B B B B | | R R R R | | G G G G | | B B B B | | R R R R | | G G G G | | B B B B | --------- --------- --------- |
FORMAT_B_G_R24 | Pixel format with 8 bits B frame as individual block, followed by 8 bits G frame as individual block, followed by a R frame as individual block, resulting in 24 bits per pixel. The memory layout of a B_G_R24 image looks like this: b-plane: g-plane: r-plane: --------- --------- --------- | B B B B | | G G G G | | R R R R | | B B B B | | G G G G | | R R R R | | B B B B | | G G G G | | R R R R | | B B B B | | G G G G | | R R R R | --------- --------- --------- |
FORMAT_END | The helper pixel format which can be used to identify the last defined pixel format, FORMAT_END is exclusive. |
enum Ocean::FrameType::PixelOrigin : uint32_t |
Defines different types of frame origin positions.
|
protected |
|
default |
Creates a new frame type with invalid parameters.
|
inline |
Creates a new frame type.
width | The width of the frame in pixel, must match with the pixel format condition, widthMultiple() |
height | The height of the frame in pixel, must match with the pixel format condition, heightMultiple() |
pixelFormat | Pixel format of the frame |
pixelOrigin | Pixel origin of the frame |
|
inline |
Creates a new frame type.
type | Frame type to copy most properties from |
width | The width of the frame in pixel to be used instead of the width defined in the given frame type, must match with the pixel format condition, widthMultiple() |
height | The height of the frame in pixel to be used instead of the height defined in the given frame type, must match with the pixel format condition, heightMultiple() |
|
inline |
Creates a new frame type.
type | Frame type to copy most properties from |
pixelFormat | Pixel format to be used instead of the pixel format defined in the given frame type |
|
inline |
Creates a new frame type.
type | Frame type to copy most properties from |
pixelOrigin | Pixel origin to be used instead of the pixel origin defined in the given frame type |
|
inline |
Creates a new frame type.
type | Frame type to copy most properties from |
pixelFormat | Pixel format of the frame |
pixelOrigin | Pixel origin to be used instead of the pixel origin defined in the given frame type |
|
static |
Returns whether two given frame types are compatible.
Two frame types are compatible if:
frameTypeA | The first frame type to be checked, must be valid |
frameTypeB | The second frame type to be checked, must be valid |
allowDifferentPixelOrigins | True, to allow different pixel origins; False, so that both frame types must have the same pixel origin |
|
static |
Returns whether two given pixel formats are compatible.
Two pixel formats are compatible if:
pixelFormatA | The first pixel format to be checked, must be valid |
pixelFormatB | The second pixel format to be checked, must be valid |
|
inline |
Returns the number of bytes which are necessary to store the data type of this frame.
|
static |
Returns the number of bytes which are necessary to store a specified data type.
dataType | The data type for which the number of bytes is requested |
|
inline |
Returns the number of individual channels the frame has.
An invalid frame or a frame with undefined pixel format has 0 channels.
|
static |
Returns the number of individual channels of a given pixel format.
pixelFormat | Pixel format to be check |
|
inlinestatic |
Returns whether a given pointer has the same byte alignment as the size of the data type the pointer is pointing to.
Actually, this function returns whether the following condition is true:
size_t(data) % sizeof(T) == 0
data | The pointer to the memory to be checked, must be valid |
|
staticconstexpr |
Returns the (pixel format) data type of a given C++ data type.
T | The C++ data type for which the (pixel format) data type is returned |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
inline |
Returns the data type of the pixel format of this frame.
|
inlinestatic |
Returns the data type of a pixel format.
pixelFormat | Pixel format to be check |
|
static |
Returns all defined data types.
|
static |
Returns all defined pixel formats.
|
static |
Returns a best fitting pixel format having the given number of bits per pixels.
The following mappings are defined:
DataType: Channels: PixelFormat: DT_UNSIGNED_INTEGER_8 1 FORMAT_Y8 DT_UNSIGNED_INTEGER_8 2 FORMAT_YA16 DT_UNSIGNED_INTEGER_8 3 FORMAT_RGB24 DT_UNSIGNED_INTEGER_8 4 FORMAT_RGBA32
dataType | The data type of each pixel element for which a pixel type is determined, must be valid |
channels | The number of channels for which a pixel format will be determined, with range [1, infinity) |
|
static |
Returns a best fitting pixel format having the given number of bits per pixels.
bitsPerPixel | Number of bits per pixel the resulting pixel format will have, with range [1, infinity) |
|
static |
Adds an alpha channel to a given pixel format.
pixelFormat | Pixel format without alpha channel |
lastChannel | True, to add the alpha channel at the end of the data channels, otherwise the alpha channel will be added in front of the data channels |
|
static |
Returns the number of bits of one pixel for the alpha channel.
pixelFormat | Pixel format to check |
|
static |
Returns the number of bits of one pixel for the blue channel.
pixelFormat | Pixel format to check |
|
static |
Returns the number of bits of one pixel for the green channel.
pixelFormat | Pixel format to check |
|
static |
Returns the number of bits of one pixel for the red channel.
pixelFormat | Pixel format to check |
|
inlinestatic |
Returns the number of bits of one pixel for a given generic pixel format.
pixelFormat | Pixel format to check |
|
inlinestatic |
Returns the number of individual channels of a given generic pixel format.
pixelFormat | Generic pixel format to be checked |
|
static |
Returns whether a given pixel format holds an alpha channel.
pixelFormat | Pixel format to check |
isLastChannel | Optional returning whether the alpha channel is the last channel (true) or whether it is the first channel (false) |
|
inlinestatic |
Checks whether a given pixel format is a generic pixel format.
pixelFormat | The pixel format to be checked |
|
inlinestatic |
Checks whether a given pixel format is a specific layout regarding data channels and data type.
pixelFormat | The pixel format to be checked |
dataType | The expected data type of the given pixel format |
channels | The expected number of channels of the given pixel format, with range [0, 31] |
planes | The number of planes of the generic pixel format, with range [0, 255] |
widthMultiple | The number of pixels the width of a frame must be a multiple of, with range [1, 255] |
heightMultiple | The number of pixels the height of a frame must be a multiple of, with range [1, 255] |
|
static |
Returns whether a given pixel format is a packed pixel format.
Packed pixel formats like FORMAT_BGGR10_PACKED or FORMAT_Y10_PACKED contain bytes providing color information for several individual pixels.
|
inlinestatic |
Checks whether a given pixel format is a pure generic pixel format.
pixelFormat | The pixel format to be checked |
|
static |
Removes an alpha channel from a given pixel format.
pixelFormat | Pixel format with alpha channel |
unsigned int Ocean::FrameType::frameTypeSize | ( | ) | const |
Returns the number of bytes necessary for the frame type, without padding at the end of frame rows.
In case the pixel format holds more than one plane, the resulting number of bytes is the sum of all planes. Beware: An actual frame may have a larger size if the frame comes with padding at end of rows.
|
staticconstexpr |
Returns a specific generic pixel format with a specified data type and channel number.
tDataType | The data type of the generic format |
tChannels | The number of channels of the generic format, with range [1, 31] |
tPlanes | The number of planes of the generic pixel format, with range [1, 255] |
tWidthMultiple | The number of pixels the width of a frame must be a multiple of, with range [1, 255] |
tHeightMultiple | The number of pixels the height of a frame must be a multiple of, with range [1, 255] |
|
staticconstexpr |
Returns a specific generic pixel format with a specified data type and channel number.
TDataType | The C++ data type for which the (pixel format) data type is returned |
tChannels | The number of channels of the generic format, with range [1, 31] |
tPlanes | The number of planes of the generic pixel format, with range [1, 255] |
tWidthMultiple | The number of pixels the width of a frame must be a multiple of, with range [1, 255] |
tHeightMultiple | The number of pixels the height of a frame must be a multiple of, with range [1, 255] |
The following code snippet shows how to use this function:
|
constexpr |
|
inlinestaticconstexpr |
Returns a specific generic pixel format with a specified data type, channel number, and plane number.
dataType | The data type of the generic format |
channels | The number of channels of the generic format, with range [1, 31] |
planes | The number of planes of the generic pixel format, with range [1, 255] |
widthMultiple | The number of pixels the width of a frame must be a multiple of, with range [1, 255] |
heightMultiple | The number of pixels the height of a frame must be a multiple of, with range [1, 255] |
|
constexpr |
|
staticconstexpr |
Returns a specific generic pixel format with a specified data type and channel number.
channels | The number of channels of the generic format, with range [1, 31] |
planes | The number of planes of the generic pixel format, with range [1, 255] |
widthMultiple | The number of pixels the width of a frame must be a multiple of, with range [1, 255] |
heightMultiple | The number of pixels the height of a frame must be a multiple of, with range [1, 255] |
tDataType | The data type of the generic format |
|
static |
Returns a specific generic pixel format with specified bit per pixel per channel, channel number, and plane number.
The overall number of bits per pixel will be bitsPerPixelChannel * channels
bitsPerPixelChannel | The number of bits each pixel and channel of the pixel format will have, with values (4, 8, 16, 32, 64) |
channels | The number of channels of the generic format, with range [1, 31] |
planes | The number of planes of the generic pixel format, with range [1, 255] |
widthMultiple | The number of pixels the width of a frame must be a multiple of, with range [1, 255] |
heightMultiple | The number of pixels the height of a frame must be a multiple of, with range [1, 255] |
|
staticconstexpr |
Returns a specific generic pixel format with a specified data type and channel number.
channels | The number of channels of the generic format, with range [1, 31] |
planes | The number of planes of the generic pixel format, with range [1, 255] |
widthMultiple | The number of pixels the width of a frame must be a multiple of, with range [1, 255] |
heightMultiple | The number of pixels the height of a frame must be a multiple of, with range [1, 255] |
TDataType | The C++ data type for which the (pixel format) data type is returned |
The following code snippet shows how to use this function:
|
static |
Returns the most suitable 1-plane pixel format for a given pixel format which may be composed of several planes.
If the given pixel format is a generic 1-plane pixel format already, the same pixel format will be returned. Here is a table with some examples:
Output pixel format: Input pixel format: <generic pixel format> <generic pixel format> (e.g., FORMAT_RGB24) FORMAT_BGR24 FORMAT_BGR4444, FORMAT_BGR5551, FORMAT_BGR565 FORMAT_BGRA32 FORMAT_BGRA4444 FORMAT_RGB24 FORMAT_RGB4444, FORMAT_RGB5551, FORMAT_RGB565 FORMAT_RGBA32 FORMAT_RGBA4444 FORMAT_YUV24, FORMAT_Y_UV12, FORMAT_UYVY16, FORMAT_Y_U_V12, FORMAT_YUYV16, FORMAT_Y_U_V24 FORMAT_YVU24 FORMAT_Y_VU12, FORMAT_Y_V_U12
pixelFormat | Pixel format for which the 1-plane pixel format will be returned |
|
inline |
Returns the height of the frame in pixel.
|
inlinestatic |
Returns the number of pixels the height of a frame must be a multiple of.
pixelFormat | Pixel format to return the number of pixels for |
|
inline |
Returns whether this frame type is compatible with a given frame type.
Two frame types are compatible if:
frameType | The first frame type to be checked, must be valid |
allowDifferentPixelOrigins | True, to allow different pixel origins; False, so that both frame types must have the same pixel origin |
|
inline |
Returns whether the pixel format of this frame type is compatible with a given pixel format.
Two pixel formats are compatible if:
pixelFormat | The pixel format to be checked, must be valid |
|
inline |
Returns whether this frame type is valid.
|
inlinestatic |
Converts a any pixel format into a generic one This function has no effect for input pixel formats which are already generic.
pixelFormat | A pixel format |
|
inline |
Returns the number of planes of the pixel format of this frame.
|
inlinestatic |
Returns the number of planes of a pixel format.
pixelFormat | The pixel format for which the number of planes will be returned |
|
inline |
Returns whether two frame types are not equal.
right | The right frame type |
bool Ocean::FrameType::operator< | ( | const FrameType & | right | ) | const |
Returns whether the left frame type is 'smaller' than the right one.
The operator does not compare the area of both frames but considers 'width', 'height', pixel format, and pixel origin to create a unique order between frame types.
right | The right frame type |
bool Ocean::FrameType::operator== | ( | const FrameType & | right | ) | const |
Returns whether two frame types are equal.
right | The right frame type |
|
inline |
Returns the pixel format of the frame.
|
inline |
Returns the pixel origin of the frame.
|
inline |
Returns the number of pixels for the frame.
|
inlinestatic |
Returns the number of bytes of one pixel of a plane for a pixel format.
Beware: This function will return 0 if the pixel format is a special packed format (e.g., FORMAT_Y10_PACKED) which does not allow to calculate the number of bytes per pixel.
imagePixelFormat | The pixel format of the entire frame, must be valid |
planeIndex | The index of the plane for which the bytes per pixel will be returned, with range [0, numberPlanes(imagePixelFormat)) |
|
static |
Returns the channels of a plane for a pixel format.
imagePixelFormat | The pixel format of the entire frame, must be valid |
planeIndex | The index of the plane for which the channels will be returned, with range [0, numberPlanes(imagePixelFormat)) |
|
inlinestatic |
Returns the plane layout of a given frame type.
frameType | The frame type for which the plane layout will be returned, must be valid |
planeIndex | The index of the plane for which the layout will be returned, with range [0, numberPlanes(imagePixelFormat) - 1] |
planeWidth | The resulting width of the specified plane, in (plane) pixel, with range [1, infinity) |
planeHeight | The resulting height of the specified plane, in (plane) pixel, with range [1, infinity) |
planeChannels | The resulting number of channels the plane has, with range [1, infinity) |
planeWidthElementsMultiple | Optional the resulting number of (plane) elements the width of the plane must be a multiple of, in elements, with range [1, infinity) |
planeHeightElementsMultiple | Optional the resulting number of (plane) elements the height of the plane must be a multiple of, in elements, with range [1, infinity) |
|
static |
Returns the plane layout of a given pixel format.
imagePixelFormat | The pixel format of the image for which the plane layout will be returned, must be valid |
imageWidth | The width of the image, in (image) pixel, with range [1, infinity) |
imageHeight | The height of the image, in (image) pixel, with range [1, infinity) |
planeIndex | The index of the plane for which the layout will be returned, with range [0, numberPlanes(imagePixelFormat) - 1] |
planeWidth | The resulting width of the specified plane, in (plane) pixel, with range [1, infinity) |
planeHeight | The resulting height of the specified plane, in (plane) pixel, with range [1, infinity) |
planeChannels | The resulting number of channels the plane has, with range [1, infinity) |
planeWidthElementsMultiple | Optional the resulting number of (plane) elements the width of the plane must be a multiple of, in elements, with range [1, infinity) |
planeHeightElementsMultiple | Optional the resulting number of (plane) elements the height of the plane must be a multiple of, in elements, with range [1, infinity) |
|
inline |
Explicitly changes the pixel format of this frame.
Beware: Commonly there is no need to change the pixel format explicitly.
pixelFormat | The new pixel format to be set, can be invalid |
|
static |
Translates a data type value into a string containing the data type.
For example the DT_UNSIGNED_INTEGER_8 will be translated into 'UNSIGNED_INTEGER_8'.
dataType | the data type as value |
|
static |
Translates a string containing a data type into the data type.
For example 'UNSIGNED_INTEGER_8' will be translated into DT_UNSIGNED_INTEGER_8.
dataType | Data type as string |
|
static |
Translates a pixel format value into a string containing the pixel format.
For example the FORMAT_BGR24 will be translated into 'BGR24'.
pixelFormat | Pixel format as value |
|
static |
Translates a string containing a pixel format into the pixel format.
For example 'BGR24' will be translated into FORMAT_BGR24.
pixelFormat | Pixel format as string |
|
static |
Translates a pixel origin value into a string containing the pixel origin.
For example the ORIGIN_UPPER_LEFT will be translated into 'UPPER_LEFT'.
pixelOrigin | Pixel origin as value |
|
static |
Translates a string containing the pixel origin into the pixel origin value.
For example 'UPPER_LEFT' will be translated into ORIGIN_UPPER_LEFT.
pixelOrigin | Pixel origin as string |
|
inline |
Returns the width of the frame format in pixel.
|
inlinestatic |
Returns the number of pixels the width of a frame must be a multiple of.
pixelFormat | Pixel format to return the number of pixels for |
|
private |
Frame height in pixel, with range [0, infinity)
|
private |
The pixel format of the frame encapsulated in a union (mainly holding PixelFormat).
|
staticconstexprprotected |
The number of bits the channel value is shifted within the PixelFormat value.
|
staticconstexprprotected |
The number of bits the data type value is shifted within the PixelFormat value.
|
staticconstexprprotected |
The number of bits the height-multiple value is shifted within the PixelFormat value.
|
staticconstexprprotected |
The number of bits the planes value is shifted within the PixelFormat value.
|
staticconstexprprotected |
The number of bits the width-multiple value is shifted within the PixelFormat value.
|
private |
The origin of the pixel data, either the upper left corner or the bottom left corner (if valid).
|
private |
Frame width in pixel, with range [0, infinity)