Krita Source Code Documentation
Loading...
Searching...
No Matches
KisVideoExportOptionsDialog Class Reference

#include <VideoExportOptionsDialog.h>

+ Inheritance diagram for KisVideoExportOptionsDialog:

Classes

struct  Private
 

Public Types

enum  CodecPageIndex {
  CODEC_OPENH264 , CODEC_H264 , CODEC_H265 , CODEC_THEORA ,
  CODEC_VP9 , CODEC_GIF , CODEC_APNG , CODEC_WEBP
}
 
enum  ContainerType {
  DEFAULT = 0 , MP4 = 0 , MKV , WEBM ,
  GIF , APNG , WEBP , OGV ,
  NUM_CONTAINER_TYPE
}
 

Public Member Functions

KisPropertiesConfigurationSP configuration () const override
 
QStringList customUserOptions () const
 
QString customUserOptionsString () const
 
 KisVideoExportOptionsDialog (ContainerType containerType, const QStringList &validEncoders, QWidget *parent=0)
 
void setConfiguration (const KisPropertiesConfigurationSP config) override
 
void setHDRConfiguration (bool value)
 
void setSupportsHDR (bool value)
 
bool videoConfiguredForHDR () const
 
 ~KisVideoExportOptionsDialog () override
 
- Public Member Functions inherited from KisConfigWidget
virtual KoCanvasResourcesInterfaceSP canvasResourcesInterface () const
 
virtual void setCanvasResourcesInterface (KoCanvasResourcesInterfaceSP canvasResourcesInterface)
 
virtual void setView (KisViewManager *view)
 
 ~KisConfigWidget () override
 

Static Public Member Functions

static QVector< KoIDencoderIdentifiers (ContainerType type)
 
static ContainerType mimeToContainer (const QString &mimeType)
 

Private Slots

void slotBayerFilterSelected (int index)
 
void slotCodecSelected (int index)
 
void slotCustomLineToggled (bool value)
 
void slotEditHDRMetadata ()
 
void slotH265ProfileChanged (int index)
 
void slotResetCustomLine ()
 
void slotSaveCustomLine ()
 

Private Member Functions

QString currentCodecId () const
 
QStringList generateCustomLine () const
 

Private Attributes

const QScopedPointer< Privatem_d
 
Ui::VideoExportOptionsDialog * ui
 

Additional Inherited Members

- Signals inherited from KisConfigWidget
void sigConfigurationItemChanged ()
 
void sigConfigurationUpdated ()
 
void sigDropLockedConfig (KisPropertiesConfigurationSP p)
 
void sigSaveLockedConfig (KisPropertiesConfigurationSP p)
 
- Protected Member Functions inherited from KisConfigWidget
 KisConfigWidget (QWidget *parent=0, Qt::WindowFlags f=Qt::WindowFlags(), int delay=200)
 

Detailed Description

Definition at line 21 of file VideoExportOptionsDialog.h.

Member Enumeration Documentation

◆ CodecPageIndex

◆ ContainerType

Constructor & Destructor Documentation

◆ KisVideoExportOptionsDialog()

KisVideoExportOptionsDialog::KisVideoExportOptionsDialog ( ContainerType containerType,
const QStringList & validEncoders,
QWidget * parent = 0 )
explicit

Definition at line 140 of file VideoExportOptionsDialog.cpp.

141 : KisConfigWidget(parent),
142 ui(new Ui::VideoExportOptionsDialog),
143 m_d(new Private(containerType, validEncoders))
144{
145 ui->setupUi(this);
146
147 ui->intOpenH264bitrate->setRange(100, 10000);
148 ui->intOpenH264bitrate->setValue(5000);
149 ui->intOpenH264bitrate->setSuffix(i18nc("kilo-bits-per-second, video bitrate suffix", "kbps"));
150
151 ui->intCRFH264->setRange(0, 51);
152 ui->intCRFH264->setValue(28);
153
154 ui->intCRFH265->setRange(0, 51);
155 ui->intCRFH265->setValue(28);
156
157 populateComboWithKoIds(ui->cmbPresetH264, m_d->presetsXH264, 5);
158 populateComboWithKoIds(ui->cmbPresetH265, m_d->presetsXH264, 5);
159
160 populateComboWithKoIds(ui->cmbProfileH264, m_d->profilesXH264, 0);
161 populateComboWithKoIds(ui->cmbProfileH265, m_d->profilesXH265, 0);
162
163 populateComboWithKoIds(ui->cmbTuneH264, m_d->tuningXH264, 0);
164 populateComboWithKoIds(ui->cmbTuneH265, m_d->tuningXH265, 0);
165
166 ui->intBitrate->setRange(10, 50000);
167 ui->intBitrate->setValue(5000);
168 ui->intBitrate->setSuffix(i18nc("kilo-bits-per-second, video bitrate suffix", "kbps"));
169
170 ui->gifReserveTransparent->setChecked(true);
171 ui->gifLoop->setChecked(true);
172 ui->gifTransDiff->setChecked(true);
173
174 populateComboWithKoIds(ui->cmbPalettegenStatsModeGIF, m_d->paletteGenModeGIF, 0);
175 populateComboWithKoIds(ui->cmbPaletteuseDitherGIF, m_d->paletteDitherGIF, 5);
176 populateComboWithKoIds(ui->cmbPaletteuseDiffModeGIF, m_d->paletteDiffModeGIF, 0);
177
178 ui->intPaletteuseBayerScaleGIF->setRange(0, 5);
179 ui->intPaletteuseBayerScaleGIF->setValue(2);
180
181 ui->apngLoop->setChecked(true);
182
183 populateComboWithKoIds(ui->cmbPredAPNG, m_d->predAPNG, 0);
184
185 ui->intCompressWEBP->setRange(0, 6);
186 ui->intCompressWEBP->setValue(4);
187
188 ui->intQscaleWEBP->setRange(0, 100);
189 ui->intQscaleWEBP->setValue(75);
190
191 populateComboWithKoIds(ui->cmbPresetWEBP, m_d->presetsWEBP, 0);
192
193 ui->webpLoop->setChecked(true);
194
195 populateComboWithKoIds(ui->cmbCodec, m_d->encoders, 0);
196 connect(ui->cmbCodec, SIGNAL(currentIndexChanged(int)), SLOT(slotCodecSelected(int)));
198
199 // TODO: temporarily hidden! Some combinations of 'tune' and
200 // 'profile' options make ffmpeg generate empty file.
201 // We should not let the user shoot into his own foot!
202 ui->cmbTuneH264->setVisible(false);
203 ui->lblTuneH264->setVisible(false);
204
205 ui->cmbTuneH265->setVisible(false);
206 ui->lblTuneH265->setVisible(false);
207
209 connect(ui->chkCustomLine, SIGNAL(toggled(bool)), SLOT(slotCustomLineToggled(bool)));
210 connect(ui->txtCustomLine, SIGNAL(editingFinished()), SLOT(slotSaveCustomLine()));
211 connect(ui->btnResetCustomLine, SIGNAL(clicked()), SLOT(slotResetCustomLine()));
212
213 connect(ui->chkUseHDRMetadata, SIGNAL(toggled(bool)),
214 ui->btnHdrMetadata, SLOT(setEnabled(bool)));
215 connect(ui->cmbProfileH265,
216 SIGNAL(currentIndexChanged(int)),
217 SLOT(slotH265ProfileChanged(int)));
218 slotH265ProfileChanged(ui->cmbProfileH265->currentIndex());
219
220 connect(ui->btnHdrMetadata, SIGNAL(clicked()), SLOT(slotEditHDRMetadata()));
221
222 connect(ui->cmbPaletteuseDitherGIF,
223 SIGNAL(currentIndexChanged(int)),
224 SLOT(slotBayerFilterSelected(int)));
225
226 slotBayerFilterSelected(ui->cmbPaletteuseDitherGIF->currentIndex());
227
228 setSupportsHDR(false);
229}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void populateComboWithKoIds(QComboBox *combo, const QVector< KoID > &ids, int defaultIndex)
KisConfigWidget(QWidget *parent=0, Qt::WindowFlags f=Qt::WindowFlags(), int delay=200)
const QScopedPointer< Private > m_d
Ui::VideoExportOptionsDialog * ui

References connect(), m_d, populateComboWithKoIds(), setSupportsHDR(), slotBayerFilterSelected(), slotCodecSelected(), slotCustomLineToggled(), slotEditHDRMetadata(), slotH265ProfileChanged(), slotResetCustomLine(), slotSaveCustomLine(), and ui.

◆ ~KisVideoExportOptionsDialog()

KisVideoExportOptionsDialog::~KisVideoExportOptionsDialog ( )
override

Definition at line 231 of file VideoExportOptionsDialog.cpp.

232{
233 delete ui;
234}

References ui.

Member Function Documentation

◆ configuration()

KisPropertiesConfigurationSP KisVideoExportOptionsDialog::configuration ( ) const
overridevirtual
Returns
the configuration

Implements KisConfigWidget.

Definition at line 242 of file VideoExportOptionsDialog.cpp.

243{
245
246 cfg->setProperty("CodecId", currentCodecId());
247
248 cfg->setProperty("Openh264Bitrate", ui->intOpenH264bitrate->value());
249
250 cfg->setProperty("h264PresetIndex", ui->cmbPresetH264->currentIndex());
251 cfg->setProperty("h264ConstantRateFactor", ui->intCRFH264->value());
252 cfg->setProperty("h264ProfileIndex", ui->cmbProfileH264->currentIndex());
253 cfg->setProperty("h264TuneIndex", ui->cmbTuneH264->currentIndex());
254
255 cfg->setProperty("h265PresetIndex", ui->cmbPresetH265->currentIndex());
256 cfg->setProperty("h265ConstantRateFactor", ui->intCRFH265->value());
257 cfg->setProperty("h265ProfileIndex", ui->cmbProfileH265->currentIndex());
258 cfg->setProperty("h265TuneIndex", ui->cmbTuneH265->currentIndex());
259 cfg->setProperty("h265UseHDRMetadata", ui->chkUseHDRMetadata->isChecked());
260
261 cfg->setProperty("TheoraBitrate", ui->intBitrate->value());
262 cfg->setProperty("CustomLineValue", ui->txtCustomLine->text());
263 cfg->setProperty("customUserOptions", customUserOptions().join(' '));
264
265 cfg->setPrefixedProperties("hdrMetadata/", m_d->hdrMetadataOptions.toProperties());
266
267 return cfg;
268}

References currentCodecId(), customUserOptions(), m_d, and ui.

◆ currentCodecId()

QString KisVideoExportOptionsDialog::currentCodecId ( ) const
private

Definition at line 562 of file VideoExportOptionsDialog.cpp.

563{
564 return m_d->encoders[ui->cmbCodec->currentIndex()].id();
565}

References m_d, and ui.

◆ customUserOptions()

QStringList KisVideoExportOptionsDialog::customUserOptions ( ) const

Definition at line 378 of file VideoExportOptionsDialog.cpp.

379{
380 return ui->chkCustomLine->isChecked() ?
381 ui->txtCustomLine->text().split(" ", Qt::SkipEmptyParts) :
383}

References generateCustomLine(), and ui.

◆ customUserOptionsString()

QString KisVideoExportOptionsDialog::customUserOptionsString ( ) const

Definition at line 385 of file VideoExportOptionsDialog.cpp.

386{
387 return customUserOptions().join(' ');
388}

References customUserOptions().

◆ encoderIdentifiers()

QVector< KoID > KisVideoExportOptionsDialog::encoderIdentifiers ( ContainerType type)
static

Definition at line 287 of file VideoExportOptionsDialog.cpp.

288{
289 KIS_ASSERT(type < ContainerType::NUM_CONTAINER_TYPE && type >= ContainerType::DEFAULT);
290 QVector<KoID> encoders;
291 QVector<KoID> h264Encoders = {
292 KoID("libopenh264", i18nc("openh264 codec name", "OpenH264")),
293 KoID("libx264", i18nc("h264 codec name, check simplescreenrecorder for standard translations", "H.264, MPEG-4 Part 10")),
294 KoID("libx265", i18nc("h265 codec name, check simplescreenrecorder for standard translations", "H.265, MPEG-H Part 2 (HEVC)"))
295 };
296
297 KoID vp9Encoder = KoID("libvpx-vp9", i18nc("VP9 codec name", "VP9"));
298
299
300 switch (type) {
302 encoders << KoID("libtheora", i18nc("theora codec name, check simplescreenrecorder for standard translations", "Theora"));
303 break;
305 encoders << KoID("libwebp", i18nc("WEBP codec name", "WEBP"));
306 break;
308 encoders << KoID("apng", i18nc("APNG codec name", "APNG"));
309 break;
311 encoders << KoID("gif", i18nc("GIF codec name", "GIF"));
312 break;
314 encoders << vp9Encoder;
315 break;
318 default:
319 encoders << h264Encoders;
320 encoders << vp9Encoder;
321 break;
322 }
323
324 return encoders;
325}
Definition KoID.h:30
#define KIS_ASSERT(cond)
Definition kis_assert.h:33

References APNG, DEFAULT, GIF, KIS_ASSERT, MKV, MP4, OGV, WEBM, and WEBP.

◆ generateCustomLine()

QStringList KisVideoExportOptionsDialog::generateCustomLine ( ) const
private

Definition at line 456 of file VideoExportOptionsDialog.cpp.

457{
458 QStringList options;
459
460 if (currentCodecId() == "libopenh264") {
461 options << "-c:v" << "libopenh264";
462 options << "-b:v" << QString::number(ui->intOpenH264bitrate->value()) + "k";
463 } else if (currentCodecId() == "libx264") {
464 options << "-crf" << QString::number(ui->intCRFH264->value());
465
466 const int presetIndex = ui->cmbPresetH264->currentIndex();
467 options << "-preset" << m_d->presetsXH264[presetIndex].id();
468
469 const int profileIndex = ui->cmbProfileH264->currentIndex();
470 options << "-profile:v" << m_d->profilesXH264[profileIndex].id();
471
472 if (m_d->profilesXH264[profileIndex].id() == "high422") {
473 options << "-pix_fmt" << "yuv422p";
474 } else if (m_d->profilesXH264[profileIndex].id() == "high444") {
475 options << "-pix_fmt" << "yuv444p";
476 } else {
477 options << "-pix_fmt" << "yuv420p";
478 }
479
480 // Disabled! see the comment in c-tor!
481 //const int tuneIndex = ui->cmbTune->currentIndex();
482 //options << "-tune" << m_d->tunes[tuneIndex].id();
483
484 } else if (currentCodecId() == "libx265") {
485 const bool enableHDR =
486 ui->chkUseHDRMetadata->isEnabled() &&
487 ui->chkUseHDRMetadata->isChecked();
488
489 if (enableHDR) {
490 options << "-colorspace" << "bt2020c"
491 << "-color_trc" << "smpte2084"
492 << "-color_primaries" << "bt2020";
493 }
494
495 options << "-c:v" << "libx265";
496 options << "-crf" << QString::number(ui->intCRFH265->value());
497
498 const int presetIndex = ui->cmbPresetH265->currentIndex();
499 options << "-preset" << m_d->presetsXH264[presetIndex].id();
500
501 const int profileIndex = ui->cmbProfileH265->currentIndex();
502 options << "-profile:v" << m_d->profilesXH265[profileIndex].id();
503
504 if (m_d->profilesXH265[profileIndex].id() == "main") {
505 options << "-pix_fmt" << "yuv420p";
506 } else if (m_d->profilesXH265[profileIndex].id() == "main10") {
507 options << "-pix_fmt" << "yuv420p10le";
508 } else {
509 KIS_SAFE_ASSERT_RECOVER_NOOP(0 && "Unknown profile selected for h265 encoder");
510 }
511
512 if (enableHDR) {
513 const QString metadataLine = m_d->hdrMetadataOptions.generateFFMpegOptions();
514 options << metadataLine.split(" ");
515 }
516
517 } else if (currentCodecId() == "libtheora") {
518 options << "-b" << QString::number(ui->intBitrate->value()) + "k";
519 } else if (currentCodecId() == "libvpx-vp9") {
520 options << "-c:v" << currentCodecId();
521 if (ui->vp9Lossless->isChecked()) {
522 options << "-lossless" << "1";
523 } else {
524 options << "-b:v" << QString::number(ui->vp9Mbits->value()) + "M";
525 }
526 } else if (currentCodecId() == "gif") {
527 const QString ditherFilterString = m_d->paletteDitherGIF[ ui->cmbPaletteuseDitherGIF->currentIndex() ].id();
528
529 options << "-f" << "gif"
530 << "-loop" << ( ui->gifLoop->isChecked() ? "0":"-1" )
531 << "-gifflags" << ( ui->gifTransDiff->isChecked() ? "+transdiff":"-transdiff" )
532 << "-palettegen" << QString("palettegen=stats_mode=%1%2")
533 .arg(m_d->paletteGenModeGIF[ ui->cmbPalettegenStatsModeGIF->currentIndex() ].id())
534 .arg(":reserve_transparent=" + QString(ui->gifReserveTransparent->isChecked() ? "1":"0"))
535 << "-lavfi" << QString("[0:v][1:v]paletteuse=dither=%1%2%3")
536 .arg(ditherFilterString)
537 .arg(ditherFilterString == "bayer" ? (QString(":bayer_scale=%1").arg(ui->intPaletteuseBayerScaleGIF->value()) ):"" )
538 .arg(":diff_mode=" + m_d->paletteDiffModeGIF[ ui->cmbPaletteuseDiffModeGIF->currentIndex() ].id() );
539
540 } else if (currentCodecId() == "apng") {
541 const int predIndex = ui->cmbPredAPNG->currentIndex();
542
543 options << "-f" << "apng"
544 << "-pred" << m_d->predAPNG[predIndex].id()
545 << "-plays" << ( ui->apngLoop->isChecked() ? "0":"1" );
546
547 } else if (currentCodecId() == "libwebp") {
548 const int presetIndex = ui->cmbPresetWEBP->currentIndex();
549
550 options << "-f" << "webp"
551 << "-lossless" << ( ui->webpLossless->isChecked() ? "1":"0" )
552 << "-compression_level" << QString::number(ui->intCompressWEBP->value())
553 << "-q:v" << QString::number(ui->intQscaleWEBP->value())
554 << "-preset" << m_d->presetsWEBP[presetIndex].id()
555 << "-loop" << ( ui->webpLoop->isChecked() ? "0":"1" );
556
557 }
558
559 return options;
560}
float value(const T *src, size_t ch)
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130

References currentCodecId(), KIS_SAFE_ASSERT_RECOVER_NOOP, m_d, and ui.

◆ mimeToContainer()

KisVideoExportOptionsDialog::ContainerType KisVideoExportOptionsDialog::mimeToContainer ( const QString & mimeType)
static

Definition at line 270 of file VideoExportOptionsDialog.cpp.

271{
272 if (mimeType == "video/webm") {
273 return ContainerType::WEBM;
274 } else if (mimeType == "video/ogg") {
275 return ContainerType::OGV;
276 } else if (mimeType == "image/gif") {
277 return ContainerType::GIF;
278 } else if (mimeType == "image/apng") {
279 return ContainerType::APNG;
280 } else if (mimeType == "image/webp") {
281 return ContainerType::WEBP;
282 }
283
285}

References APNG, DEFAULT, GIF, OGV, WEBM, and WEBP.

◆ setConfiguration()

void KisVideoExportOptionsDialog::setConfiguration ( const KisPropertiesConfigurationSP config)
overridevirtual
Parameters
configthe configuration for this configuration widget.

Implements KisConfigWidget.

Definition at line 422 of file VideoExportOptionsDialog.cpp.

423{
424 ui->intOpenH264bitrate->setValue(cfg->getInt("Openh264Bitrate", 5000));
425
426 ui->cmbPresetH264->setCurrentIndex(cfg->getInt("h264PresetIndex", 5));
427 ui->intCRFH264->setValue(cfg->getInt("h264ConstantRateFactor", 23));
428 ui->cmbProfileH264->setCurrentIndex(cfg->getInt("h264ProfileIndex", 0));
429 ui->cmbTuneH264->setCurrentIndex(cfg->getInt("h264TuneIndex", 1));
430
431 ui->cmbPresetH265->setCurrentIndex(cfg->getInt("h265PresetIndex", 5));
432 ui->intCRFH265->setValue(cfg->getInt("h265ConstantRateFactor", 23));
433 ui->cmbProfileH265->setCurrentIndex(cfg->getInt("h265ProfileIndex", 0));
434 ui->cmbTuneH265->setCurrentIndex(cfg->getInt("h265TuneIndex", 1));
435 ui->chkUseHDRMetadata->setChecked(cfg->getBool("h265UseHDRMetadata", false));
436
437 ui->intBitrate->setValue(cfg->getInt("TheoraBitrate", 5000));
438
439 m_d->currentCustomLine = cfg->getString("CustomLineValue", QString());
440 ui->chkCustomLine->setChecked(!m_d->currentCustomLine.isEmpty());
441 slotCustomLineToggled(ui->chkCustomLine->isChecked());
442
443 const QString codecId = cfg->getString("CodecId", "");
444
445 const int index = qMax(0, findIndexById(codecId, m_d->encoders));
446 ui->cmbCodec->setCurrentIndex(index);
447 slotCodecSelected(index);
448
449 slotH265ProfileChanged(ui->cmbProfileH265->currentIndex());
450
452 cfg->getPrefixedProperties("hdrMetadata/", metadataProperties);
453 m_d->hdrMetadataOptions.fromProperties(metadataProperties);
454}
int findIndexById(const QString &id, const QVector< KoID > &ids)

References findIndexById(), m_d, slotCodecSelected(), slotCustomLineToggled(), slotH265ProfileChanged(), and ui.

◆ setHDRConfiguration()

void KisVideoExportOptionsDialog::setHDRConfiguration ( bool value)

Definition at line 397 of file VideoExportOptionsDialog.cpp.

397 {
398 if (value && currentCodecId() != "libx265") {
399 ui->cmbCodec->setCurrentIndex(m_d->encoders.indexOf(KoID("libx265")));
400 ui->chkUseHDRMetadata->setEnabled(true);
401 }
402
403 //If HDR is enabled && the codec id is correct, we need to use main10.
404 if (value && currentCodecId() == "libx265") {
405 ui->cmbProfileH265->setCurrentIndex(m_d->profilesXH265.indexOf(KoID("main10")));
406 }
407
408 ui->chkUseHDRMetadata->setChecked(value);
409}

References currentCodecId(), m_d, ui, and value().

◆ setSupportsHDR()

void KisVideoExportOptionsDialog::setSupportsHDR ( bool value)

Definition at line 236 of file VideoExportOptionsDialog.cpp.

237{
238 m_d->supportsHDR = value;
239 slotH265ProfileChanged(ui->cmbProfileH265->currentIndex());
240}

References m_d, slotH265ProfileChanged(), ui, and value().

◆ slotBayerFilterSelected

void KisVideoExportOptionsDialog::slotBayerFilterSelected ( int index)
privateslot

Definition at line 599 of file VideoExportOptionsDialog.cpp.

600{
601 const bool enableBayer = m_d->paletteDitherGIF[ index ].id() == "bayer";
602 ui->lblPaletteuseBayerScaleGIF->setEnabled( enableBayer );
603 ui->intPaletteuseBayerScaleGIF->setEnabled( enableBayer );
604}

References m_d, and ui.

◆ slotCodecSelected

void KisVideoExportOptionsDialog::slotCodecSelected ( int index)
privateslot

Definition at line 351 of file VideoExportOptionsDialog.cpp.

352{
353 const QString codec = m_d->encoders[index].id();
354 if (codec == "libopenh264") {
355 ui->stackedWidget->setCurrentIndex(CODEC_OPENH264);
356 } else if (codec == "libx264") {
357 ui->stackedWidget->setCurrentIndex(CODEC_H264);
358 } else if (codec == "libx265") {
359 ui->stackedWidget->setCurrentIndex(CODEC_H265);
360 } else if (codec == "libtheora") {
361 ui->stackedWidget->setCurrentIndex(CODEC_THEORA);
362 } else if (codec == "libvpx-vp9") {
363 ui->stackedWidget->setCurrentIndex(CODEC_VP9);
364 } else if (codec == "gif") {
365 ui->stackedWidget->setCurrentIndex(CODEC_GIF);
366 } else if (codec == "apng") {
367 ui->stackedWidget->setCurrentIndex(CODEC_APNG);
368 } else if (codec == "libwebp") {
369 ui->stackedWidget->setCurrentIndex(CODEC_WEBP);
370 }
371}

References CODEC_APNG, CODEC_GIF, CODEC_H264, CODEC_H265, CODEC_OPENH264, CODEC_THEORA, CODEC_VP9, CODEC_WEBP, m_d, and ui.

◆ slotCustomLineToggled

void KisVideoExportOptionsDialog::slotCustomLineToggled ( bool value)
privateslot

Definition at line 327 of file VideoExportOptionsDialog.cpp.

328{
329 QString customLine = m_d->currentCustomLine;
330
331 if (m_d->currentCustomLine.isEmpty() && value) {
332 customLine = generateCustomLine().join(" ");
333 } else if (!value) {
334 customLine = QString();
335 m_d->currentCustomLine = QString();
336 }
337
338 ui->txtCustomLine->setText(customLine);
339
340 ui->stackedWidget->setEnabled(!value);
341 ui->txtCustomLine->setEnabled(value);
342 ui->btnResetCustomLine->setEnabled(value);
343}

References generateCustomLine(), m_d, ui, and value().

◆ slotEditHDRMetadata

void KisVideoExportOptionsDialog::slotEditHDRMetadata ( )
privateslot

Definition at line 589 of file VideoExportOptionsDialog.cpp.

590{
592 dlg.setHDRMetadataOptions(m_d->hdrMetadataOptions);
593
594 if (dlg.exec() == QDialog::Accepted) {
595 m_d->hdrMetadataOptions = dlg.hdrMetadataOptions();
596 }
597}

References VideoHDRMetadataOptionsDialog::hdrMetadataOptions(), m_d, and VideoHDRMetadataOptionsDialog::setHDRMetadataOptions().

◆ slotH265ProfileChanged

void KisVideoExportOptionsDialog::slotH265ProfileChanged ( int index)
privateslot

Definition at line 567 of file VideoExportOptionsDialog.cpp.

568{
569 const bool enableHDR =
570 m_d->supportsHDR &&
571 index >= 0 &&
572 m_d->profilesXH265[index].id() == "main10";
573
574 ui->chkUseHDRMetadata->setEnabled(enableHDR);
575 ui->btnHdrMetadata->setEnabled(enableHDR && ui->chkUseHDRMetadata->isChecked());
576
577 QString hdrToolTip;
578
579 if (!m_d->supportsHDR) {
580 hdrToolTip = i18nc("@info:tooltip", "Exported animation format does not support HDR");
581 } else if (!enableHDR) {
582 hdrToolTip = i18nc("@info:tooltip", "HDR metadata available only with \"main10\" profile");
583 }
584
585 ui->chkUseHDRMetadata->setToolTip(hdrToolTip);
586 ui->btnHdrMetadata->setToolTip(hdrToolTip);
587}

References m_d, and ui.

◆ slotResetCustomLine

void KisVideoExportOptionsDialog::slotResetCustomLine ( )
privateslot

Definition at line 345 of file VideoExportOptionsDialog.cpp.

346{
347 ui->txtCustomLine->setText(generateCustomLine().join(" "));
349}

References generateCustomLine(), slotSaveCustomLine(), and ui.

◆ slotSaveCustomLine

void KisVideoExportOptionsDialog::slotSaveCustomLine ( )
privateslot

Definition at line 373 of file VideoExportOptionsDialog.cpp.

374{
375 m_d->currentCustomLine = ui->txtCustomLine->text();
376}

References m_d, and ui.

◆ videoConfiguredForHDR()

bool KisVideoExportOptionsDialog::videoConfiguredForHDR ( ) const

Definition at line 390 of file VideoExportOptionsDialog.cpp.

391{
392 return currentCodecId() == "libx265" &&
393 ui->chkUseHDRMetadata->isEnabled() &&
394 ui->chkUseHDRMetadata->isChecked();
395}

References currentCodecId(), and ui.

Member Data Documentation

◆ m_d

const QScopedPointer<Private> KisVideoExportOptionsDialog::m_d
private

Definition at line 87 of file VideoExportOptionsDialog.h.

◆ ui

Ui::VideoExportOptionsDialog* KisVideoExportOptionsDialog::ui
private

Definition at line 78 of file VideoExportOptionsDialog.h.


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