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

#include <KisAnimationRenderingOptions.h>

Public Types

enum  RenderMode { RENDER_FRAMES_ONLY , RENDER_VIDEO_ONLY , RENDER_FRAMES_AND_VIDEO }
 

Public Member Functions

void fromProperties (KisPropertiesConfigurationSP config)
 
 KisAnimationRenderingOptions ()
 
RenderMode renderMode () const
 
QString resolveAbsoluteDocumentFilePath (const QString &documentPath) const
 
QString resolveAbsoluteFramesDirectory () const
 
QString resolveAbsoluteFramesDirectory (const QString &documentPath) const
 
QString resolveAbsoluteVideoFilePath () const
 
QString resolveAbsoluteVideoFilePath (const QString &documentPath) const
 
KisPropertiesConfigurationSP toProperties () const
 

Public Attributes

QString basename = QStringLiteral("frame")
 
QString customFFMpegOptions
 
QString directory = QStringLiteral("")
 
QString ffmpegPath
 
int firstFrame = 0
 
KisPropertiesConfigurationSP frameExportConfig
 
QString frameMimeType = QStringLiteral("image/png")
 
int frameRate = 25
 
int height = 0
 
bool includeAudio = false
 
QString lastDocumentPath
 
int lastFrame = 0
 
QString scaleFilter
 
int sequenceStart = 0
 
bool shouldDeleteSequence = false
 
bool shouldEncodeVideo = false
 
QString videoFileName
 
QString videoMimeType = QStringLiteral("video/mp4")
 
bool wantsOnlyUniqueFrameSequence = false
 
int width = 0
 

Detailed Description

Definition at line 15 of file KisAnimationRenderingOptions.h.

Member Enumeration Documentation

◆ RenderMode

Enumerator
RENDER_FRAMES_ONLY 
RENDER_VIDEO_ONLY 
RENDER_FRAMES_AND_VIDEO 

Definition at line 71 of file KisAnimationRenderingOptions.h.

Constructor & Destructor Documentation

◆ KisAnimationRenderingOptions()

KisAnimationRenderingOptions::KisAnimationRenderingOptions ( )

Definition at line 18 of file KisAnimationRenderingOptions.cpp.

19{
20
21}

Member Function Documentation

◆ fromProperties()

void KisAnimationRenderingOptions::fromProperties ( KisPropertiesConfigurationSP config)

Definition at line 118 of file KisAnimationRenderingOptions.cpp.

119{
120 basename = config->getPropertyLazy("basename", basename);
121 lastDocumentPath = config->getPropertyLazy("last_document_path", "");
122 directory = config->getPropertyLazy("directory", directory);
123 firstFrame = config->getPropertyLazy("first_frame", 0);
124 lastFrame = config->getPropertyLazy("last_frame", 0);
125 sequenceStart = config->getPropertyLazy("sequence_start", 0);
126 frameMimeType = config->getPropertyLazy("frame_mimetype", frameMimeType);
127
128#ifdef Q_OS_ANDROID
129 bool encodeVideoDefault = true;
130#else
131 bool encodeVideoDefault = false;
132#endif
133 shouldEncodeVideo = config->getPropertyLazy("encode_video", encodeVideoDefault);
134#ifndef Q_OS_ANDROID
135 shouldDeleteSequence = config->getPropertyLazy("delete_sequence", false);
136#endif
137 wantsOnlyUniqueFrameSequence = config->getPropertyLazy("only_unique_frames", false);
138
139 frameRate = config->getPropertyLazy("framerate", 25);
140 height = config->getPropertyLazy("height", 0);
141 width = config->getPropertyLazy("width", 0);
142 includeAudio = config->getPropertyLazy("include_audio", true);
143 videoFileName = config->getPropertyLazy("filename", "");
144
145#ifdef Q_OS_ANDROID
146 videoFormatKey = config->getPropertyLazy("video_format_key", QString());
147 videoFormatPreferencesJson = config->getPropertyLazy("video_format_preferences_json", QString());
148#else
149 videoMimeType = config->getPropertyLazy("video_mimetype", videoMimeType);
150 ffmpegPath = config->getPropertyLazy("ffmpeg_path", "");
151 customFFMpegOptions = config->getPropertyLazy("custom_ffmpeg_options", "");
152#endif
153
155 config->getPrefixedProperties("frame_export/", frameExportConfig);
156
157}
KisPropertiesConfigurationSP frameExportConfig

References basename, customFFMpegOptions, directory, ffmpegPath, firstFrame, frameExportConfig, frameMimeType, frameRate, height, includeAudio, lastDocumentPath, lastFrame, sequenceStart, shouldDeleteSequence, shouldEncodeVideo, videoFileName, videoMimeType, wantsOnlyUniqueFrameSequence, and width.

◆ renderMode()

KisAnimationRenderingOptions::RenderMode KisAnimationRenderingOptions::renderMode ( ) const

Definition at line 59 of file KisAnimationRenderingOptions.cpp.

60{
61#ifdef Q_OS_ANDROID
63 return RENDER_VIDEO_ONLY;
64 } else {
65 return RENDER_FRAMES_ONLY;
66 }
67#else
70 return RENDER_VIDEO_ONLY;
71 } else if (!shouldEncodeVideo) {
73 return RENDER_FRAMES_ONLY;
74 } else {
76 }
77#endif
78}
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130

References KIS_SAFE_ASSERT_RECOVER_NOOP, RENDER_FRAMES_AND_VIDEO, RENDER_FRAMES_ONLY, RENDER_VIDEO_ONLY, shouldDeleteSequence, and shouldEncodeVideo.

◆ resolveAbsoluteDocumentFilePath()

QString KisAnimationRenderingOptions::resolveAbsoluteDocumentFilePath ( const QString & documentPath) const

Definition at line 24 of file KisAnimationRenderingOptions.cpp.

25{
26 return
27 !documentPath.isEmpty() ?
28 documentPath :
29 QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
30}

◆ resolveAbsoluteFramesDirectory() [1/2]

QString KisAnimationRenderingOptions::resolveAbsoluteFramesDirectory ( ) const

◆ resolveAbsoluteFramesDirectory() [2/2]

QString KisAnimationRenderingOptions::resolveAbsoluteFramesDirectory ( const QString & documentPath) const

Definition at line 38 of file KisAnimationRenderingOptions.cpp.

39{
41 return QFileInfo(resolveAbsoluteVideoFilePath()).absolutePath();
42 }
43
44 const QString basePath = resolveAbsoluteDocumentFilePath(documentPath);
46}
QString resolveAbsoluteDocumentFilePath(const QString &documentPath) const
QString resolveAbsoluteFilePath(const QString &baseDir, const QString &fileName)
Resolve absolute file path from a file path and base dir.

References directory, RENDER_VIDEO_ONLY, renderMode(), resolveAbsoluteDocumentFilePath(), KritaUtils::resolveAbsoluteFilePath(), and resolveAbsoluteVideoFilePath().

◆ resolveAbsoluteVideoFilePath() [1/2]

QString KisAnimationRenderingOptions::resolveAbsoluteVideoFilePath ( ) const

◆ resolveAbsoluteVideoFilePath() [2/2]

QString KisAnimationRenderingOptions::resolveAbsoluteVideoFilePath ( const QString & documentPath) const

◆ toProperties()

KisPropertiesConfigurationSP KisAnimationRenderingOptions::toProperties ( ) const

Definition at line 80 of file KisAnimationRenderingOptions.cpp.

81{
83
84 config->setProperty("basename", basename);
85 config->setProperty("last_document_path", lastDocumentPath);
86 config->setProperty("directory", directory);
87 config->setProperty("first_frame", firstFrame);
88 config->setProperty("last_frame", lastFrame);
89 config->setProperty("sequence_start", sequenceStart);
90 config->setProperty("frame_mimetype", frameMimeType);
91
92 config->setProperty("encode_video", shouldEncodeVideo);
93#ifndef Q_OS_ANDROID
94 config->setProperty("delete_sequence", shouldDeleteSequence);
95#endif
96 config->setProperty("only_unique_frames", wantsOnlyUniqueFrameSequence);
97
98 config->setProperty("framerate", frameRate);
99 config->setProperty("height", height);
100 config->setProperty("width", width);
101 config->setProperty("include_audio", includeAudio);
102 config->setProperty("filename", videoFileName);
103
104#ifdef Q_OS_ANDROID
105 config->setProperty("video_format_key", videoFormatKey);
106 config->setProperty("video_format_preferences_json", videoFormatPreferencesJson);
107#else
108 config->setProperty("video_mimetype", videoMimeType);
109 config->setProperty("ffmpeg_path", ffmpegPath);
110 config->setProperty("custom_ffmpeg_options", customFFMpegOptions);
111#endif
112
113 config->setPrefixedProperties("frame_export/", frameExportConfig);
114
115 return config;
116}

References basename, customFFMpegOptions, directory, ffmpegPath, firstFrame, frameExportConfig, frameMimeType, frameRate, height, includeAudio, lastDocumentPath, lastFrame, sequenceStart, shouldDeleteSequence, shouldEncodeVideo, videoFileName, videoMimeType, wantsOnlyUniqueFrameSequence, and width.

Member Data Documentation

◆ basename

QString KisAnimationRenderingOptions::basename = QStringLiteral("frame")

Definition at line 29 of file KisAnimationRenderingOptions.h.

◆ customFFMpegOptions

QString KisAnimationRenderingOptions::customFFMpegOptions

Definition at line 57 of file KisAnimationRenderingOptions.h.

◆ directory

QString KisAnimationRenderingOptions::directory = QStringLiteral("")

Definition at line 30 of file KisAnimationRenderingOptions.h.

◆ ffmpegPath

QString KisAnimationRenderingOptions::ffmpegPath

Definition at line 48 of file KisAnimationRenderingOptions.h.

◆ firstFrame

int KisAnimationRenderingOptions::firstFrame = 0

Definition at line 31 of file KisAnimationRenderingOptions.h.

◆ frameExportConfig

KisPropertiesConfigurationSP KisAnimationRenderingOptions::frameExportConfig

Definition at line 59 of file KisAnimationRenderingOptions.h.

◆ frameMimeType

QString KisAnimationRenderingOptions::frameMimeType = QStringLiteral("image/png")

Definition at line 27 of file KisAnimationRenderingOptions.h.

◆ frameRate

int KisAnimationRenderingOptions::frameRate = 25

Definition at line 50 of file KisAnimationRenderingOptions.h.

◆ height

int KisAnimationRenderingOptions::height = 0

Definition at line 52 of file KisAnimationRenderingOptions.h.

◆ includeAudio

bool KisAnimationRenderingOptions::includeAudio = false

Definition at line 44 of file KisAnimationRenderingOptions.h.

◆ lastDocumentPath

QString KisAnimationRenderingOptions::lastDocumentPath

Definition at line 20 of file KisAnimationRenderingOptions.h.

◆ lastFrame

int KisAnimationRenderingOptions::lastFrame = 0

Definition at line 32 of file KisAnimationRenderingOptions.h.

◆ scaleFilter

QString KisAnimationRenderingOptions::scaleFilter

Definition at line 53 of file KisAnimationRenderingOptions.h.

◆ sequenceStart

int KisAnimationRenderingOptions::sequenceStart = 0

Definition at line 33 of file KisAnimationRenderingOptions.h.

◆ shouldDeleteSequence

bool KisAnimationRenderingOptions::shouldDeleteSequence = false

Definition at line 42 of file KisAnimationRenderingOptions.h.

◆ shouldEncodeVideo

bool KisAnimationRenderingOptions::shouldEncodeVideo = false

Definition at line 40 of file KisAnimationRenderingOptions.h.

◆ videoFileName

QString KisAnimationRenderingOptions::videoFileName

Definition at line 54 of file KisAnimationRenderingOptions.h.

◆ videoMimeType

QString KisAnimationRenderingOptions::videoMimeType = QStringLiteral("video/mp4")

Definition at line 25 of file KisAnimationRenderingOptions.h.

◆ wantsOnlyUniqueFrameSequence

bool KisAnimationRenderingOptions::wantsOnlyUniqueFrameSequence = false

Definition at line 45 of file KisAnimationRenderingOptions.h.

◆ width

int KisAnimationRenderingOptions::width = 0

Definition at line 51 of file KisAnimationRenderingOptions.h.


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