avcpp 3.2.1
Wrapper for the FFmpeg that simplify usage from C++ projects.
Loading...
Searching...
No Matches
av::hw::PixelFormatRange Class Reference

Non-owning view over a null-terminated AVPixelFormat array.

#include <hwcontext.h>

Classes

class  iterator
 Forward iterator over a null-terminated AVPixelFormat array. More...

Public Member Functions

 PixelFormatRange ()=default
 Create an empty range.
 PixelFormatRange (const AVPixelFormat *formats) noexcept
 Wrap a null-terminated format array.
iterator begin () const noexcept
 First format.
iterator end () const noexcept
 One past the last format.
size_t size () const noexcept
 Number of formats.
bool empty () const noexcept
 Whether the range has no formats.
PixelFormat operator[] (size_t index) const noexcept
 Format access.
std::vector< PixelFormat > toVector () const
 Copy the range into a vector.

Constructor & Destructor Documentation

◆ PixelFormatRange()

av::hw::PixelFormatRange::PixelFormatRange ( const AVPixelFormat * formats)
explicitnoexcept
Parameters
formatspointer to the first element, terminated by AV_PIX_FMT_NONE; may be null
Note
Non-owning: the array must outlive the range.

Member Function Documentation

◆ begin()

iterator av::hw::PixelFormatRange::begin ( ) const
inlinenoexcept
Returns
an iterator at the first element

◆ empty()

bool av::hw::PixelFormatRange::empty ( ) const
inlinenoexcept
Returns
true when the range is empty

◆ end()

iterator av::hw::PixelFormatRange::end ( ) const
inlinenoexcept
Returns
the past-the-end iterator

◆ operator[]()

PixelFormat av::hw::PixelFormatRange::operator[] ( size_t index) const
inlinenoexcept
Parameters
indexzero-based index; must be less than size()
Returns
the wrapped format at the index

◆ size()

size_t av::hw::PixelFormatRange::size ( ) const
inlinenoexcept
Returns
the element count

◆ toVector()

std::vector< PixelFormat > av::hw::PixelFormatRange::toVector ( ) const
Returns
a vector with the same formats

The documentation for this class was generated from the following file: