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

requests regeneration of a frame. The regeneration should be requested after switching the KisImage to the relevant frame. More...

#include <KisAsyncStoryboardThumbnailRenderer.h>

+ Inheritance diagram for KisAsyncStoryboardThumbnailRenderer:

Signals

void sigNotifyFrameCancelled (int frame, KisAsyncAnimationRendererBase::CancelReason cancelReason)
 
void sigNotifyFrameCompleted (int frameTime)
 
void sigNotifyFrameCompleted (int frameTime, KisPaintDeviceSP frameContents)
 
- Signals inherited from KisAsyncAnimationRendererBase
void sigFrameCancelled (int frame, KisAsyncAnimationRendererBase::CancelReason cancelReason)
 
void sigFrameCompleted (int frame)
 

Public Member Functions

 KisAsyncStoryboardThumbnailRenderer (QObject *parent)
 
 ~KisAsyncStoryboardThumbnailRenderer ()
 
- Public Member Functions inherited from KisAsyncAnimationRendererBase
bool isActive () const
 
 KisAsyncAnimationRendererBase (QObject *parent=0)
 
void startFrameRegeneration (KisImageSP image, int frame, const KisRegion &regionOfInterest, Flags flags, KisLockFrameGenerationLock &&frameGenerationLock)
 
void startFrameRegeneration (KisImageSP image, int frame, Flags flags, KisLockFrameGenerationLock &&frameGenerationLock)
 
virtual ~KisAsyncAnimationRendererBase ()
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 

Protected Member Functions

void clearFrameRegenerationState (bool isCancelled) override
 
void frameCancelledCallback (int frame, CancelReason cancelReason) override
 frameCancelledCallback is called when the rendering of the frame was cancelled.
 
void frameCompletedCallback (int frame, const KisRegion &requestedRegion) override
 frameCompletedCallback is called by the renderer when a new frame becomes ready
 
- Protected Member Functions inherited from KisAsyncAnimationRendererBase
KisImageSP requestedImage () const
 

Additional Inherited Members

- Public Types inherited from KisAsyncAnimationRendererBase
enum  CancelReason { UserCancelled = 0 , RenderingFailed , RenderingTimedOut }
 
enum  Flag { None = 0x0 , Cancellable = 0x1 }
 
- Public Slots inherited from KisAsyncAnimationRendererBase
void cancelCurrentFrameRendering (CancelReason cancelReason)
 cancels current rendering operation
 
- Public Attributes inherited from KisAsyncAnimationRendererBase
KisSignalAutoConnectionsStore imageRequestConnections
 
bool isCancelled = false
 
QTimer regenerationTimeout
 
int requestedFrame = -1
 
KisImageSP requestedImage
 
KisRegion requestedRegion
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 
- Protected Slots inherited from KisAsyncAnimationRendererBase
void notifyFrameCancelled (int frame, KisAsyncAnimationRendererBase::CancelReason cancelReason)
 
void notifyFrameCompleted (int frame)
 

Detailed Description

requests regeneration of a frame. The regeneration should be requested after switching the KisImage to the relevant frame.

Definition at line 19 of file KisAsyncStoryboardThumbnailRenderer.h.

Constructor & Destructor Documentation

◆ KisAsyncStoryboardThumbnailRenderer()

KisAsyncStoryboardThumbnailRenderer::KisAsyncStoryboardThumbnailRenderer ( QObject * parent)

Definition at line 11 of file KisAsyncStoryboardThumbnailRenderer.cpp.

13{
14 connect(this, SIGNAL(sigNotifyFrameCompleted(int)), SLOT(notifyFrameCompleted(int)), Qt::QueuedConnection);
15 connect(this,
18}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void sigNotifyFrameCancelled(int frame, KisAsyncAnimationRendererBase::CancelReason cancelReason)
void sigNotifyFrameCompleted(int frameTime, KisPaintDeviceSP frameContents)
void notifyFrameCancelled(int frame, KisAsyncAnimationRendererBase::CancelReason cancelReason)

References connect(), KisAsyncAnimationRendererBase::notifyFrameCancelled(), KisAsyncAnimationRendererBase::notifyFrameCompleted(), sigNotifyFrameCancelled(), and sigNotifyFrameCompleted().

◆ ~KisAsyncStoryboardThumbnailRenderer()

KisAsyncStoryboardThumbnailRenderer::~KisAsyncStoryboardThumbnailRenderer ( )

Definition at line 20 of file KisAsyncStoryboardThumbnailRenderer.cpp.

21{
22}

Member Function Documentation

◆ clearFrameRegenerationState()

void KisAsyncStoryboardThumbnailRenderer::clearFrameRegenerationState ( bool isCancelled)
overrideprotectedvirtual

Called by KisAsyncAnimationRendererBase when the processing has been completed and the internal state of the populator should be cleared

Parameters
isCancelledtells if frame regeneration has failed to be regenerated

Reimplemented from KisAsyncAnimationRendererBase.

Definition at line 42 of file KisAsyncStoryboardThumbnailRenderer.cpp.

References KisAsyncAnimationRendererBase::clearFrameRegenerationState(), and KisAsyncAnimationRendererBase::isCancelled.

◆ frameCancelledCallback()

void KisAsyncStoryboardThumbnailRenderer::frameCancelledCallback ( int frame,
CancelReason cancelReason )
overrideprotectedvirtual

frameCancelledCallback is called when the rendering of the frame was cancelled.

The rendering of the frame can be either cancelled by the image itself or by receiving a timeout signal (10 seconds).

NOTE: the slot is called in the GUI thread. Don't forget to call notifyFrameCancelled() in he end of your call.

Implements KisAsyncAnimationRendererBase.

Definition at line 37 of file KisAsyncStoryboardThumbnailRenderer.cpp.

38{
39 Q_EMIT sigNotifyFrameCancelled(frame, cancelReason);
40}

References sigNotifyFrameCancelled().

◆ frameCompletedCallback()

void KisAsyncStoryboardThumbnailRenderer::frameCompletedCallback ( int frame,
const KisRegion & requestedRegion )
overrideprotectedvirtual

frameCompletedCallback is called by the renderer when a new frame becomes ready

NOTE1: the callback is called from the context of a image worker thread! So it is asynchronous from the GUI thread. NOTE2: in case of successful processing of the frame, the callback must issue some signal, connected to notifyFrameCompleted() via auto connection, to continue processing. Please do not call the method directly, because notifyFame*() slots should be called from the context of the GUI thread. NOTE3: In case of failure, notifyFrameCancelled(). The same threading rules apply.

Implements KisAsyncAnimationRendererBase.

Definition at line 24 of file KisAsyncStoryboardThumbnailRenderer.cpp.

References KritaUtils::CopySnapshot, KisImage::projection(), KisAsyncAnimationRendererBase::RenderingFailed, KisAsyncAnimationRendererBase::requestedFrame, KisAsyncAnimationRendererBase::requestedImage, sigNotifyFrameCancelled(), and sigNotifyFrameCompleted().

◆ sigNotifyFrameCancelled

void KisAsyncStoryboardThumbnailRenderer::sigNotifyFrameCancelled ( int frame,
KisAsyncAnimationRendererBase::CancelReason cancelReason )
signal

◆ sigNotifyFrameCompleted [1/2]

void KisAsyncStoryboardThumbnailRenderer::sigNotifyFrameCompleted ( int frameTime)
signal

◆ sigNotifyFrameCompleted [2/2]

void KisAsyncStoryboardThumbnailRenderer::sigNotifyFrameCompleted ( int frameTime,
KisPaintDeviceSP frameContents )
signal

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