|
Krita Source Code Documentation
|
This class maintains queues of dirty frames sorted in the order of proximity to the last changed frame. It regenerates the frames emits the paintdevice for each of the frames. The m_changedFramesQueue list is given preference. More...
#include <KisStoryboardThumbnailRenderScheduler.h>
Inheritance diagram for KisStoryboardThumbnailRenderScheduler:Public Slots | |
| void | slotStartFrameRendering () |
Signals | |
| void | sigFrameCancelled (int frame) |
| void | sigFrameCompleted (int frame, KisPaintDeviceSP dev) |
Public Member Functions | |
| void | cancelAllFrameRendering () |
| Cancels all frame rendering. Empties all queues and cancels the current rendering, if any. | |
| void | cancelFrameRendering (int frame) |
| Cancel rendering of a single frame. | |
| KisStoryboardThumbnailRenderScheduler (QObject *parent) | |
| void | scheduleFrameForRegeneration (int frame, bool affected) |
| Adds the frame to the list of "to be regenerated" frames. | |
| void | setImage (KisImageSP image) |
| Sets an image, the class takes an image, clones it and calls frame regeneration on the clone so do not pass cloned image explicitly. The image should be set only_once and not every time before scheduling a frame for regeneration. Setting an image cancels rendering of all previously scheduled frames. | |
| ~KisStoryboardThumbnailRenderScheduler () | |
Private Slots | |
| void | slotFrameRegenerationCancelled (int frame) |
Emits sigFrameCancelled(int) and schedules the next frame for regeneration. | |
| void | slotFrameRegenerationCompleted (int frame, KisPaintDeviceSP contents) |
Emits sigFrameCompleted(int,KisPaintDeviceSP) if the regeneration was complete and calls regeneration of the next frame in queue. | |
Private Member Functions | |
| void | renderNextFrame () |
Renders the next frame, either from affected or changed queue. Changed queue is given preference. It removes the frame from the queue right after calling startFrameRegeneration() | |
| void | sortAffectedFrameQueue () |
Sorts the m_affectedFramesQueue based on proximity to the last changed frame. | |
Private Attributes | |
| QVector< int > | m_affectedFramesQueue |
| QVector< int > | m_changedFramesQueue |
| int | m_currentFrame |
| KisImageSP | m_image |
| KisAsyncStoryboardThumbnailRenderer * | m_renderer |
This class maintains queues of dirty frames sorted in the order of proximity to the last changed frame. It regenerates the frames emits the paintdevice for each of the frames. The m_changedFramesQueue list is given preference.
Definition at line 24 of file KisStoryboardThumbnailRenderScheduler.h.
| KisStoryboardThumbnailRenderScheduler::KisStoryboardThumbnailRenderScheduler | ( | QObject * | parent | ) |
Definition at line 15 of file KisStoryboardThumbnailRenderScheduler.cpp.
References connect(), m_renderer, sigFrameCancelled(), slotFrameRegenerationCancelled(), and slotFrameRegenerationCompleted().
| KisStoryboardThumbnailRenderScheduler::~KisStoryboardThumbnailRenderScheduler | ( | ) |
Definition at line 25 of file KisStoryboardThumbnailRenderScheduler.cpp.
References m_renderer.
| void KisStoryboardThumbnailRenderScheduler::cancelAllFrameRendering | ( | ) |
Cancels all frame rendering. Empties all queues and cancels the current rendering, if any.
Definition at line 62 of file KisStoryboardThumbnailRenderScheduler.cpp.
References KisAsyncAnimationRendererBase::cancelCurrentFrameRendering(), KisAsyncAnimationRendererBase::isActive(), m_affectedFramesQueue, m_changedFramesQueue, m_currentFrame, m_renderer, and KisAsyncAnimationRendererBase::UserCancelled.
| void KisStoryboardThumbnailRenderScheduler::cancelFrameRendering | ( | int | frame | ) |
Cancel rendering of a single frame.
| frame | The frame whose rendering is to be cancelled. |
Definition at line 72 of file KisStoryboardThumbnailRenderScheduler.cpp.
References KisAsyncAnimationRendererBase::cancelCurrentFrameRendering(), KisAsyncAnimationRendererBase::isActive(), m_affectedFramesQueue, m_changedFramesQueue, m_currentFrame, m_renderer, and KisAsyncAnimationRendererBase::UserCancelled.
|
private |
Renders the next frame, either from affected or changed queue. Changed queue is given preference. It removes the frame from the queue right after calling startFrameRegeneration()
Definition at line 122 of file KisStoryboardThumbnailRenderScheduler.cpp.
References KisImage::animationInterface(), KisImageAnimationInterface::backgroundFrameGenerationBlocked(), KisImage::clone(), KisImage::isIdle(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_affectedFramesQueue, m_changedFramesQueue, m_currentFrame, m_image, m_renderer, KisAsyncAnimationRendererBase::None, and KisAsyncAnimationRendererBase::startFrameRegeneration().
| void KisStoryboardThumbnailRenderScheduler::scheduleFrameForRegeneration | ( | int | frame, |
| bool | affected ) |
Adds the frame to the list of "to be regenerated" frames.
| frame | To be regenerated frame |
| affected | Denotes whether this frame was directly changed or affected by changes made to other keyframes. |
Definition at line 39 of file KisStoryboardThumbnailRenderScheduler.cpp.
References m_affectedFramesQueue, m_changedFramesQueue, and sortAffectedFrameQueue().
| void KisStoryboardThumbnailRenderScheduler::setImage | ( | KisImageSP | image | ) |
Sets an image, the class takes an image, clones it and calls frame regeneration on the clone so do not pass cloned image explicitly. The image should be set only_once and not every time before scheduling a frame for regeneration. Setting an image cancels rendering of all previously scheduled frames.
| image | Image whose frames are to be rendered. |
Definition at line 30 of file KisStoryboardThumbnailRenderScheduler.cpp.
References cancelAllFrameRendering(), and m_image.
|
signal |
|
signal |
|
privateslot |
Emits sigFrameCancelled(int) and schedules the next frame for regeneration.
Definition at line 104 of file KisStoryboardThumbnailRenderScheduler.cpp.
References renderNextFrame(), and sigFrameCancelled().
|
privateslot |
Emits sigFrameCompleted(int,KisPaintDeviceSP) if the regeneration was complete and calls regeneration of the next frame in queue.
Definition at line 98 of file KisStoryboardThumbnailRenderScheduler.cpp.
References renderNextFrame(), and sigFrameCompleted().
|
slot |
Definition at line 89 of file KisStoryboardThumbnailRenderScheduler.cpp.
References KisAsyncAnimationRendererBase::isActive(), m_renderer, and renderNextFrame().
|
private |
Sorts the m_affectedFramesQueue based on proximity to the last changed frame.
Definition at line 110 of file KisStoryboardThumbnailRenderScheduler.cpp.
References m_affectedFramesQueue, and m_changedFramesQueue.
|
private |
Definition at line 90 of file KisStoryboardThumbnailRenderScheduler.h.
|
private |
Definition at line 89 of file KisStoryboardThumbnailRenderScheduler.h.
|
private |
Definition at line 93 of file KisStoryboardThumbnailRenderScheduler.h.
|
private |
Definition at line 92 of file KisStoryboardThumbnailRenderScheduler.h.
|
private |
Definition at line 91 of file KisStoryboardThumbnailRenderScheduler.h.