|
Krita Source Code Documentation
|
#include <kis_image_animation_interface.h>
Inheritance diagram for KisImageAnimationInterface:Classes | |
| struct | Private |
Public Types | |
| enum | SwitchTimeAsyncOption { STAO_NONE = 0 , STAO_USE_UNDO = 1 << 1 , STAO_FORCE_REGENERATION = 1 << 2 } |
Public Slots | |
| void | setDocumentRangeEndFrame (int column) |
| void | setDocumentRangeStartFrame (int column) |
| void | setFramerate (int fps) |
| void | switchCurrentTimeAsync (int frameId, SwitchTimeAsyncFlags options=STAO_NONE) |
Signals | |
| void | sigDocumentRangeChanged () |
| void | sigFrameCancelled () |
| void | sigFramerateChanged () |
| void | sigFrameReady (int time) |
| sigFrameReady notifies when an External frame has been regenerated and is available. | |
| void | sigFrameRegenerated (int time) |
| sigFrameRegenerated notifies when internal frame has been fully regenerated. | |
| void | sigFrameRegenerationSkipped (int time) |
| sigFrameRegenerationSkipped notified when async frame changes are skipped. | |
| void | sigFramesChanged (const KisTimeSpan &range, const QRect &rect) |
| void | sigInternalRequestTimeSwitch (int frameId, bool useUndo) |
| void | sigKeyframeAdded (const KisKeyframeChannel *channel, int time) |
| void | sigKeyframeRemoved (const KisKeyframeChannel *channel, int time) |
| void | sigPlaybackRangeChanged () |
| void | sigUiTimeChanged (int newTime) |
Private Member Functions | |
| void | blockFrameInvalidation (bool value) |
| void | explicitlySetCurrentTime (int frameId) |
| void | notifyFrameCancelled () |
| void | notifyFrameReady () |
| void | notifyFrameRegenerated () |
| bool | requiresOnionSkinRendering () |
| void | restoreCurrentTime (int *savedValue) |
| void | saveAndResetCurrentTime (int frameId, int *savedValue) |
| KisUpdatesFacade * | updatesFacade () const |
Private Attributes | |
| const QScopedPointer< Private > | m_d |
Friends | |
| class | KisAnimationFrameCacheTest |
| class | KisImageTest |
| struct | KisLayerUtils::SwitchFrameCommand |
| class | KisRegenerateFrameStrokeStrategy |
| class | KisSuspendProjectionUpdatesStrokeStrategy |
| class | KisSwitchTimeStrokeStrategy |
| class | TransformStrokeStrategy |
Definition at line 27 of file kis_image_animation_interface.h.
| Enumerator | |
|---|---|
| STAO_NONE | |
| STAO_USE_UNDO | |
| STAO_FORCE_REGENERATION | |
Definition at line 197 of file kis_image_animation_interface.h.
| KisImageAnimationInterface::KisImageAnimationInterface | ( | KisImage * | image | ) |
Definition at line 96 of file kis_image_animation_interface.cpp.
References connect(), KisTimeSpan::fromTimeToTime(), image(), m_d, sigInternalRequestTimeSwitch(), STAO_NONE, STAO_USE_UNDO, and switchCurrentTimeAsync().
| KisImageAnimationInterface::KisImageAnimationInterface | ( | const KisImageAnimationInterface & | rhs, |
| KisImage * | newImage ) |
Definition at line 110 of file kis_image_animation_interface.cpp.
References connect(), sigInternalRequestTimeSwitch(), STAO_NONE, STAO_USE_UNDO, and switchCurrentTimeAsync().
|
override |
Definition at line 118 of file kis_image_animation_interface.cpp.
| QSet< int > KisImageAnimationInterface::activeLayerSelectedTimes | ( | ) |
Definition at line 216 of file kis_image_animation_interface.cpp.
References m_d.
| const KisTimeSpan & KisImageAnimationInterface::activePlaybackRange | ( | ) | const |
activePlaybackRange
Definition at line 169 of file kis_image_animation_interface.cpp.
References KisTimeSpan::isValid(), and m_d.
| bool KisImageAnimationInterface::backgroundFrameGenerationBlocked | ( | ) | const |
Reports if background generation process is blocked
Definition at line 492 of file kis_image_animation_interface.cpp.
References m_d.
| void KisImageAnimationInterface::blockBackgroundFrameGeneration | ( | ) |
Blocks background processes like frame cache populator from starting the generation process, hence giving priority to the interactive frame generation methods.
This method is not blocking, it just forbids further actions. If there is any background action running, it continues to run. Use lockFrameGeneration() to wait for completion of such actions.
Definition at line 482 of file kis_image_animation_interface.cpp.
References m_d.
|
private |
Definition at line 445 of file kis_image_animation_interface.cpp.
| int KisImageAnimationInterface::currentTime | ( | ) | const |
Returns currently active frame of the underlying image. Some strokes can override this value and it will report a different value.
Definition at line 135 of file kis_image_animation_interface.cpp.
References m_d.
| int KisImageAnimationInterface::currentUITime | ( | ) | const |
Same as currentTime, except it isn't changed when background strokes are running.
Definition at line 140 of file kis_image_animation_interface.cpp.
References m_d.
| const KisTimeSpan & KisImageAnimationInterface::documentPlaybackRange | ( | ) | const |
documentPlaybackRange
Definition at line 145 of file kis_image_animation_interface.cpp.
References m_d.
|
private |
Definition at line 264 of file kis_image_animation_interface.cpp.
References m_d.
| int KisImageAnimationInterface::exportInitialFrameNumber | ( | ) |
Definition at line 206 of file kis_image_animation_interface.cpp.
References m_d.
| QString KisImageAnimationInterface::exportSequenceBaseName | ( | ) |
Definition at line 196 of file kis_image_animation_interface.cpp.
References m_d.
| QString KisImageAnimationInterface::exportSequenceFilePath | ( | ) |
Definition at line 186 of file kis_image_animation_interface.cpp.
References m_d.
| bool KisImageAnimationInterface::externalFrameActive | ( | ) | const |
While any non-current frame is being regenerated by the strategy, the image is kept in a special state, named 'externalFrameActive'. Is this state the following applies:
1) All the animated paint devices switch its state into frameId() defined by global time.
2) All animation-not-capable devices switch to a temporary content device, which is in undefined state. The stroke should regenerate the image projection manually.
Definition at line 239 of file kis_image_animation_interface.cpp.
References m_d.
| int KisImageAnimationInterface::framerate | ( | ) | const |
Definition at line 181 of file kis_image_animation_interface.cpp.
References m_d.
| bool KisImageAnimationInterface::hasAnimation | ( | ) | const |
Returns true of the image has at least one animated layer
Definition at line 122 of file kis_image_animation_interface.cpp.
References hasAnimation(), m_d, and KisLayerUtils::recursiveApplyNodes().
| KisImageWSP KisImageAnimationInterface::image | ( | ) | const |
Definition at line 234 of file kis_image_animation_interface.cpp.
References m_d.
Definition at line 433 of file kis_image_animation_interface.cpp.
References KisLayerUtils::fetchLayerActiveRasterFrameSpan(), KisLayerUtils::fetchLayerIdenticalRasterFrameTimes(), m_d, sigFramesChanged(), and target().
| void KisImageAnimationInterface::invalidateFrames | ( | const KisTimeSpan & | range, |
| const QRect & | rect ) |
Definition at line 427 of file kis_image_animation_interface.cpp.
References m_d, and sigFramesChanged().
| void KisImageAnimationInterface::lockFrameGeneration | ( | ) |
Acquire an exclusive lock for the frame generation process initiated by requestFrameRegeneration().
It is impossible to execute multiple background frame generation processes on a single image, because the image returns the result using global signals. Hence the initiator of the generation should acquire the lock first and pass it to requestFrameRegeneration(). The lock will be automatically released when the frame generation process is ended and all the signals are emitted.
Calling to lockFrameGeneration() may block until the currently executing frame generation process is running.
Definition at line 502 of file kis_image_animation_interface.cpp.
References m_d.
|
private |
Definition at line 351 of file kis_image_animation_interface.cpp.
References sigFrameCancelled().
|
private |
Definition at line 346 of file kis_image_animation_interface.cpp.
References m_d, and sigFrameReady().
|
private |
Definition at line 356 of file kis_image_animation_interface.cpp.
References m_d, and sigFrameRegenerated().
| void KisImageAnimationInterface::notifyNodeChanged | ( | const KisNode * | node, |
| const QRect & | rect, | ||
| bool | recursive ) |
Definition at line 376 of file kis_image_animation_interface.cpp.
References notifyNodeChanged().
| void KisImageAnimationInterface::notifyNodeChanged | ( | const KisNode * | node, |
| const QVector< QRect > & | rects, | ||
| bool | recursive ) |
Definition at line 383 of file kis_image_animation_interface.cpp.
References KisTimeSpan::calculateAffectedFramesRecursive(), KisTimeSpan::calculateNodeAffectedFrames(), KisRasterKeyframeChannel::clonesOf(), externalFrameActive(), invalidateFrames(), m_d, and KisLayerUtils::recursiveApplyNodes().
| KisImageAnimationInterface::Q_DECLARE_FLAGS | ( | SwitchTimeAsyncFlags | , |
| SwitchTimeAsyncOption | ) |
| void KisImageAnimationInterface::requestFrameRegeneration | ( | int | frameId, |
| const KisRegion & | dirtyRegion, | ||
| bool | isCancellable, | ||
| KisLockFrameGenerationLock && | lock ) |
Start a background thread that will recalculate some extra frame. The result will be reported using two types of signals:
1) KisImage::sigImageUpdated() will be emitted for every chunk of updated area.
2) sigFrameReady() will be emitted in the end of the operation. IMPORTANT: to get the result you must connect to this signal with Qt::DirectConnection and fetch the result from frameProjection(). After the signal handler is exited, the data will no longer be available.
3) The passed lock will be released when the stroke is finished execution (and the strategy is destroyed)
Definition at line 315 of file kis_image_animation_interface.cpp.
References KisRegenerateFrameStrokeStrategy::createJobsData(), KisRegenerateFrameStrokeStrategy, and m_d.
| void KisImageAnimationInterface::requestTimeSwitchNonGUI | ( | int | time, |
| bool | useUndo = false ) |
Definition at line 259 of file kis_image_animation_interface.cpp.
References sigInternalRequestTimeSwitch().
| void KisImageAnimationInterface::requestTimeSwitchWithUndo | ( | int | time | ) |
Definition at line 244 of file kis_image_animation_interface.cpp.
References requestTimeSwitchNonGUI().
|
private |
Definition at line 361 of file kis_image_animation_interface.cpp.
References m_d, p, and KisLayerUtils::recursiveFindNode().
|
private |
Definition at line 340 of file kis_image_animation_interface.cpp.
References m_d.
|
private |
| void KisImageAnimationInterface::setActiveLayerSelectedTimes | ( | const QSet< int > & | times | ) |
Definition at line 221 of file kis_image_animation_interface.cpp.
References m_d.
| void KisImageAnimationInterface::setActivePlaybackRange | ( | const KisTimeSpan | range | ) |
Definition at line 174 of file kis_image_animation_interface.cpp.
References KisTimeSpan::isInfinite(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, and sigPlaybackRangeChanged().
Changes the default color of the "external frame" projection of the image's root layer. Please note that this command should be executed from a context of an exclusive job!
Definition at line 249 of file kis_image_animation_interface.cpp.
References currentTime(), m_d, restoreCurrentTime(), and saveAndResetCurrentTime().
| void KisImageAnimationInterface::setDocumentRange | ( | const KisTimeSpan | range | ) |
Definition at line 150 of file kis_image_animation_interface.cpp.
References KisTimeSpan::isInfinite(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, and sigDocumentRangeChanged().
|
slot |
Definition at line 163 of file kis_image_animation_interface.cpp.
References KisTimeSpan::fromTimeToTime(), m_d, and setDocumentRange().
|
slot |
Definition at line 157 of file kis_image_animation_interface.cpp.
References KisTimeSpan::fromTimeToTime(), m_d, and setDocumentRange().
| void KisImageAnimationInterface::setExportInitialFrameNumber | ( | const int | frameNum | ) |
Definition at line 211 of file kis_image_animation_interface.cpp.
References m_d.
| void KisImageAnimationInterface::setExportSequenceBaseName | ( | const QString & | baseName | ) |
Definition at line 201 of file kis_image_animation_interface.cpp.
References m_d.
| void KisImageAnimationInterface::setExportSequenceFilePath | ( | const QString & | filePath | ) |
Definition at line 191 of file kis_image_animation_interface.cpp.
References m_d.
|
slot |
Definition at line 226 of file kis_image_animation_interface.cpp.
References m_d, and sigFramerateChanged().
|
signal |
|
signal |
|
signal |
|
signal |
sigFrameReady notifies when an External frame has been regenerated and is available.
| time | – frame index |
Used for background processing of frames where we want to ensure that an external frame has been fully processed before updating.
|
signal |
sigFrameRegenerated notifies when internal frame has been fully regenerated.
| time |
Used to notify switchCurrentTimeAsync clients that the frame is visible to the user. Only notifies when internal frame regeneration occurs, not external. Currently used in AnimationPlayer to update what it considers to be the "visible" frame
|
signal |
sigFrameRegenerationSkipped notified when async frame changes are skipped.
| time |
Skipping frame regeneration occurs when the contents of the frame are deemed unimportant and not work updating the canvas for (generally for image-wide hold frames, for example.)
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
slot |
Switches current frame (synchronously) and starts an asynchronous regeneration of the entire image.
Definition at line 269 of file kis_image_animation_interface.cpp.
References KisTimeSpan::calculateIdenticalFramesRecursive(), KisTimeSpan::contains(), currentUITime(), KisRegenerateFrameStrokeStrategy, KisSwitchTimeStrokeStrategy, m_d, requiresOnionSkinRendering(), sigFrameRegenerationSkipped(), sigUiTimeChanged(), STAO_FORCE_REGENERATION, STAO_USE_UNDO, and KisSwitchTimeStrokeStrategy::token().
| int KisImageAnimationInterface::totalLength | ( | ) |
Definition at line 468 of file kis_image_animation_interface.cpp.
References findLastKeyframeTimeRecursive(), and m_d.
| bool KisImageAnimationInterface::tryLockFrameGeneration | ( | ) |
Try to acquire frame generation lock
Definition at line 497 of file kis_image_animation_interface.cpp.
References m_d.
| void KisImageAnimationInterface::unblockBackgroundFrameGeneration | ( | ) |
Unblocks background generation process.
Definition at line 487 of file kis_image_animation_interface.cpp.
References m_d.
| void KisImageAnimationInterface::unlockFrameGeneration | ( | ) |
Release frame generation lock
Definition at line 507 of file kis_image_animation_interface.cpp.
References m_d.
|
private |
Definition at line 371 of file kis_image_animation_interface.cpp.
References m_d.
|
friend |
Definition at line 264 of file kis_image_animation_interface.h.
|
friend |
Definition at line 266 of file kis_image_animation_interface.h.
|
friend |
Definition at line 265 of file kis_image_animation_interface.h.
|
friend |
Definition at line 262 of file kis_image_animation_interface.h.
|
friend |
Definition at line 263 of file kis_image_animation_interface.h.
|
friend |
Definition at line 278 of file kis_image_animation_interface.h.
|
friend |
Definition at line 279 of file kis_image_animation_interface.h.
|
private |
Definition at line 282 of file kis_image_animation_interface.h.