RAII SwsContext for video scale / convert.
More...
#include <StormByte/multimedia/ffmpeg/Sws.hxx>
|
| | Sws (Sws &&other) noexcept=default |
| | Move constructor.
|
| |
| | ~Sws () noexcept override |
| | Destructor.
|
| |
| Sws & | operator= (Sws &&other) noexcept=default |
| | Move assignment.
|
| |
| | operator bool () const noexcept |
| | Whether a scaler context is open.
|
| |
| bool | Ensure (int src_w, int src_h, int src_fmt, int dst_w, int dst_h, int dst_fmt, int flags=0) noexcept |
| | Reopens if geometry, format or flags changed.
|
| |
| bool | Scale (const AVFrame &src, AVFrame &dst) const noexcept |
| | Scales src into dst.
|
| |
| constexpr | AVPointer () noexcept=delete |
| | Default constructor (deleted).
|
| |
| constexpr | AVPointer (const AVPointer &) noexcept=delete |
| | Copy constructor (deleted).
|
| |
| constexpr | AVPointer (AVPointer &&other) noexcept |
| | Move constructor.
|
| |
| virtual | ~AVPointer () noexcept=default |
| | Destructor.
|
| |
| constexpr AVPointer & | operator= (const AVPointer &) noexcept=delete |
| | Copy assignment (deleted).
|
| |
| constexpr AVPointer & | operator= (AVPointer &&other) noexcept |
| | Move assignment.
|
| |
|
| static int | Bilinear () noexcept |
| | SWS_BILINEAR.
|
| |
| static int | Bicubic () noexcept |
| | SWS_BICUBIC.
|
| |
| static int | FastBilinear () noexcept |
| | SWS_FAST_BILINEAR.
|
| |
| static int | Point () noexcept |
| | SWS_POINT.
|
| |
| static int | Lanczos () noexcept |
| | SWS_LANCZOS.
|
| |
| static Sws | Open (int src_w, int src_h, int src_fmt, int dst_w, int dst_h, int dst_fmt, int flags=0) noexcept |
| | Opens a scaler.
|
| |
|
| constexpr | AVPointer (std::decay_t< ::SwsContext > *ptr) noexcept |
| | Adopts ptr.
|
| |
| constexpr const std::decay_t< ::SwsContext > * | Get () const noexcept |
| | Const view of the raw FFmpeg pointer.
|
| |
| constexpr std::decay_t< ::SwsContext > * | Get () noexcept |
| | Mutable view of the raw FFmpeg pointer.
|
| |
| constexpr std::decay_t< ::SwsContext > * | Detach () noexcept |
| | Yields the raw pointer and leaves this wrapper empty.
|
| |
| std::decay_t< ::SwsContext > * | m_ptr |
| | Owned FFmpeg pointer.
|
| |
RAII SwsContext for video scale / convert.
◆ Sws()
| StormByte::Multimedia::FFmpeg::Sws::Sws |
( |
Sws && |
other | ) |
|
|
defaultnoexcept |
Move constructor.
Transfers the scaler.
- Parameters
-
| other | Source scaler; left empty. |
◆ ~Sws()
| StormByte::Multimedia::FFmpeg::Sws::~Sws |
( |
| ) |
|
|
overridenoexcept |
Destructor.
Frees the SwsContext.
◆ Bicubic()
| static int StormByte::Multimedia::FFmpeg::Sws::Bicubic |
( |
| ) |
|
|
staticnoexcept |
◆ Bilinear()
| static int StormByte::Multimedia::FFmpeg::Sws::Bilinear |
( |
| ) |
|
|
staticnoexcept |
◆ Ensure()
| bool StormByte::Multimedia::FFmpeg::Sws::Ensure |
( |
int |
src_w, |
|
|
int |
src_h, |
|
|
int |
src_fmt, |
|
|
int |
dst_w, |
|
|
int |
dst_h, |
|
|
int |
dst_fmt, |
|
|
int |
flags = 0 |
|
) |
| |
|
noexcept |
Reopens if geometry, format or flags changed.
- Parameters
-
| src_w | Source width in pixels. |
| src_h | Source height in pixels. |
| src_fmt | Source pixel format as int. |
| dst_w | Destination width in pixels. |
| dst_h | Destination height in pixels. |
| dst_fmt | Destination pixel format as int. |
| flags | Bilinear, Bicubic, … 0 = Bilinear. |
- Returns
- false if the scaler could not be (re)opened.
◆ FastBilinear()
| static int StormByte::Multimedia::FFmpeg::Sws::FastBilinear |
( |
| ) |
|
|
staticnoexcept |
◆ Lanczos()
| static int StormByte::Multimedia::FFmpeg::Sws::Lanczos |
( |
| ) |
|
|
staticnoexcept |
◆ Open()
| static Sws StormByte::Multimedia::FFmpeg::Sws::Open |
( |
int |
src_w, |
|
|
int |
src_h, |
|
|
int |
src_fmt, |
|
|
int |
dst_w, |
|
|
int |
dst_h, |
|
|
int |
dst_fmt, |
|
|
int |
flags = 0 |
|
) |
| |
|
staticnoexcept |
Opens a scaler.
Empty wrapper on failure.
- Parameters
-
| src_w | Source width in pixels. |
| src_h | Source height in pixels. |
| src_fmt | Source pixel format as int. |
| dst_w | Destination width in pixels. |
| dst_h | Destination height in pixels. |
| dst_fmt | Destination pixel format as int. |
| flags | Bilinear, Bicubic, … 0 = Bilinear. |
- Returns
- Open scaler, or empty on failure.
◆ operator bool()
| StormByte::Multimedia::FFmpeg::Sws::operator bool |
( |
| ) |
const |
|
explicitnoexcept |
Whether a scaler context is open.
- Returns
- true if
sws_scale can run.
◆ operator=()
| Sws & StormByte::Multimedia::FFmpeg::Sws::operator= |
( |
Sws && |
other | ) |
|
|
defaultnoexcept |
Move assignment.
Frees *this, then takes other.
- Parameters
-
| other | Source scaler; left empty. |
- Returns
- *this.
◆ Point()
| static int StormByte::Multimedia::FFmpeg::Sws::Point |
( |
| ) |
|
|
staticnoexcept |
◆ Scale()
| bool StormByte::Multimedia::FFmpeg::Sws::Scale |
( |
const AVFrame & |
src, |
|
|
AVFrame & |
dst |
|
) |
| const |
|
noexcept |
Scales src into dst.
Both frames must already have buffers.
- Parameters
-
| src | Source frame. |
| dst | Destination frame. |
- Returns
- false on failure.
The documentation for this class was generated from the following file:
- lib/public/StormByte/multimedia/ffmpeg/Sws.hxx