#include <KisLibavEncoderContext.h>
Definition at line 20 of file KisLibavEncoderContext.h.
◆ KisLibavEncoderContext()
| KisLibavEncoderContext::KisLibavEncoderContext |
( |
QString * | outErrorMessage = nullptr | ) |
|
|
inlineexplicit |
◆ ~KisLibavEncoderContext()
| virtual KisLibavEncoderContext::~KisLibavEncoderContext |
( |
| ) |
|
|
inlinevirtual |
◆ convertFrame()
| bool KisLibavEncoderContext::convertFrame |
( |
QImage & | inOutImage, |
|
|
AVPixelFormat & | outPixelFormat ) const |
|
inline |
Definition at line 34 of file KisLibavEncoderContext.h.
35 {
36 switch (inOutImage.format()) {
37 case QImage::Format_RGB32:
38 outPixelFormat = AV_PIX_FMT_BGR0;
39 break;
40 case QImage::Format_ARGB32:
41 outPixelFormat = AV_PIX_FMT_BGRA;
42 break;
43 default:
44
45
46 outPixelFormat = AV_PIX_FMT_BGRA;
47 inOutImage = inOutImage.convertToFormat(QImage::Format_ARGB32);
48 if (inOutImage.isNull()) {
49 warnFile <<
"Frame conversion from" << inOutImage.format() <<
"failed";
50 return false;
51 }
52 break;
53 }
54 return true;
55 }
References warnFile.
◆ getSwsContextFor()
| SwsContext * KisLibavEncoderContext::getSwsContextFor |
( |
int | inputWidth, |
|
|
int | inputHeight, |
|
|
AVPixelFormat | inputFormat, |
|
|
int | outputWidth, |
|
|
int | outputHeight, |
|
|
AVPixelFormat | outputFormat, |
|
|
int | flags ) |
|
inline |
Definition at line 76 of file KisLibavEncoderContext.h.
83 {
85 inputWidth,
86 inputHeight,
87 inputFormat,
88 outputWidth,
89 outputHeight,
90 outputFormat,
91 flags,
92 nullptr,
93 nullptr,
94 nullptr);
95 }
References m_swsContext.
◆ getSwsFlags()
| int KisLibavEncoderContext::getSwsFlags |
( |
const QString & | scaleFilter | ) |
const |
|
inline |
Definition at line 57 of file KisLibavEncoderContext.h.
58 {
59
60 if (scaleFilter.isEmpty() || scaleFilter == QStringLiteral("bilinear")) {
61 return SWS_FAST_BILINEAR;
62 } else if (scaleFilter == QStringLiteral("bicubic")) {
63 return SWS_BICUBIC;
64 } else if (scaleFilter == QStringLiteral("lanczos")) {
65 return SWS_LANCZOS;
66 } else if (scaleFilter == QStringLiteral("neighbor")) {
67 return 0;
68 } else if (scaleFilter == QStringLiteral("spline")) {
69 return SWS_SPLINE;
70 } else {
71 warnFile.nospace() <<
"Unhandled scale filter '" << scaleFilter <<
"'";
72 return SWS_FAST_BILINEAR;
73 }
74 }
References warnFile.
◆ setErrorMessage()
| void KisLibavEncoderContext::setErrorMessage |
( |
const QString & | errorMessage | ) |
|
|
inline |
◆ setInternalErrorMessage()
| void KisLibavEncoderContext::setInternalErrorMessage |
( |
const QString & | detail | ) |
|
|
inline |
◆ m_outErrorMessage
| QString* KisLibavEncoderContext::m_outErrorMessage |
|
private |
◆ m_swsContext
| SwsContext* KisLibavEncoderContext::m_swsContext = nullptr |
|
private |
The documentation for this class was generated from the following file: