|
avcpp 3.2.1
Wrapper for the FFmpeg that simplify usage from C++ projects.
|
The PixelFormat class is a simple wrapper for AVPixelFormat that allow to acces it it properties. More...
#include <pixelformat.h>
Public Types | |
| using | Parent = PixSampleFmtWrapper<PixelFormat, AVPixelFormat> |
| The wrapper this type builds on. | |
Public Member Functions | |
| PixelFormat ()=default | |
| Create an unset format, equivalent to AV_PIX_FMT_NONE. | |
| PixelFormat (const char *name) noexcept | |
| Look a pixel format up by name. | |
| PixelFormat (const std::string &name) noexcept | |
| Look a pixel format up by name. | |
| const char * | name (OptionalErrorCode ec=throws()) const |
| Name of the format. | |
| const AVPixFmtDescriptor * | descriptor (OptionalErrorCode ec=throws()) const |
| FFmpeg description of the format. | |
| int | bitsPerPixel (OptionalErrorCode ec=throws()) const |
| Bits needed for one pixel. | |
| size_t | planesCount (OptionalErrorCode ec=throws()) const |
| Number of image planes. | |
| PixelFormat | swapEndianness () const noexcept |
| The same format with the opposite byte order. | |
| size_t | convertionLoss (PixelFormat dstFmt, bool srcHasAlpha=false) const noexcept |
| What a conversion to another format would lose. | |
| Public Member Functions inherited from PixSampleFmtWrapper< PixelFormat, AVPixelFormat > | |
| constexpr | PixSampleFmtWrapper ()=default |
| Create a wrapper holding NoneValue. | |
| constexpr | PixSampleFmtWrapper (AVPixelFormat fmt) noexcept |
| Wrap a raw enum value. | |
| operator AVPixelFormat () const noexcept | |
| Implicit conversion to the FFmpeg enum. | |
| AVPixelFormat | get () const noexcept |
| The stored enum value. | |
| operator AVPixelFormat & () noexcept | |
| Mutable access to the stored value. | |
| PixelFormat & | operator= (AVPixelFormat fmt) noexcept |
| Assign a raw enum value. | |
| void | set (AVPixelFormat fmt) noexcept |
| Assign a raw enum value. | |
| operator AVPixelFormat () const noexcept | |
| Implicit conversion to the FFmpeg enum. | |
| operator AVPixelFormat & () noexcept | |
| Mutable access to the stored value. | |
Additional Inherited Members | |
| Protected Attributes inherited from PixSampleFmtWrapper< PixelFormat, AVPixelFormat > | |
| AVPixelFormat | m_fmt |
| The stored enum value. | |
It has size same to the AVPixelFormat, but wrap pixel description function too. Pixel format descriptor.
A thin wrapper over AVPixelFormat that can answer the questions a pipeline asks: the name of the format, how many planes it has, how many bits per pixel it needs, and what a conversion to another format would cost.
|
explicitnoexcept |
| name | the name FFmpeg uses, for example "yuv420p" |
|
explicitnoexcept |
| name | the name FFmpeg uses, for example "yuv420p" |
| int av::PixelFormat::bitsPerPixel | ( | OptionalErrorCode | ec = throws() | ) | const |
| ec | holder for the error code |
|
noexcept |
| dstFmt | target format |
| srcHasAlpha | whether the source actually carries alpha |
| const AVPixFmtDescriptor * av::PixelFormat::descriptor | ( | OptionalErrorCode | ec = throws() | ) | const |
| ec | holder for the error code |
| const char * av::PixelFormat::name | ( | OptionalErrorCode | ec = throws() | ) | const |
| ec | holder for the error code; an unset format reports an error |
| size_t av::PixelFormat::planesCount | ( | OptionalErrorCode | ec = throws() | ) | const |
| ec | holder for the error code |
|
noexcept |