Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
KeyFrame Class Reference
+ Inheritance diagram for KeyFrame:
Inheritance graph
[legend]
+ Collaboration diagram for KeyFrame:
Collaboration graph
[legend]

Public Member Functions

 KeyFrame (const KeyFrame &k2)
 
KeyFrame & operator= (const KeyFrame &k2)
 
int pos () const
 
void setPos (int position)
 
int length () const
 
void setLength (int len)
 
void modification ()
 
void setModified (bool b)
 
bool isModified () const
 
QString fileName () const
 
void setFileName (QString strFileName)
 
void addEventListener (KeyFrameEventListener *)
 
void removeEventListner (KeyFrameEventListener *)
 
virtual KeyFrame * clone () const
 
virtual void loadFile ()
 Loads the backing file into memory if it exists, otherwise it does nothing.
 
virtual void unloadFile ()
 Unloads the data from memory in order to save memory.
 
virtual bool isLoaded () const
 A check to ensure that the keyframe holds valid data.
 
virtual quint64 memoryUsage ()
 

Private Attributes

int mFrame = -1
 
int mLength = 1
 
bool mIsModified = true
 
QString mAttachedFileName
 
std::vector< KeyFrameEventListener * > mEventListeners
 

Detailed Description

Definition at line 29 of file keyframe.h.

Constructor & Destructor Documentation

◆ KeyFrame() [1/2]

KeyFrame::KeyFrame ( )
explicit

Definition at line 21 of file keyframe.cpp.

◆ KeyFrame() [2/2]

KeyFrame::KeyFrame ( const KeyFrame &  k2)
explicit

Definition at line 25 of file keyframe.cpp.

◆ ~KeyFrame()

KeyFrame::~KeyFrame ( )
virtual

Definition at line 34 of file keyframe.cpp.

Member Function Documentation

◆ addEventListener()

void KeyFrame::addEventListener ( KeyFrameEventListener *  listener)

Definition at line 57 of file keyframe.cpp.

◆ clone()

virtual KeyFrame * KeyFrame::clone ( ) const
inlinevirtual

Definition at line 54 of file keyframe.h.

◆ fileName()

QString KeyFrame::fileName ( ) const
inline

Definition at line 48 of file keyframe.h.

◆ isLoaded()

virtual bool KeyFrame::isLoaded ( ) const
inlinevirtual

A check to ensure that the keyframe holds valid data.

Returns
true if the keyframe holds valid data, otherwise false.

Reimplemented in BitmapImage.

Definition at line 64 of file keyframe.h.

◆ isModified()

bool KeyFrame::isModified ( ) const
inline

Definition at line 46 of file keyframe.h.

◆ length()

int KeyFrame::length ( ) const
inline

Definition at line 41 of file keyframe.h.

◆ loadFile()

virtual void KeyFrame::loadFile ( )
inlinevirtual

Loads the backing file into memory if it exists, otherwise it does nothing.

Reimplemented in BitmapImage.

Definition at line 56 of file keyframe.h.

◆ memoryUsage()

virtual quint64 KeyFrame::memoryUsage ( )
inlinevirtual

Definition at line 66 of file keyframe.h.

◆ modification()

void KeyFrame::modification ( )
inline

Definition at line 44 of file keyframe.h.

◆ operator=()

KeyFrame & KeyFrame::operator= ( const KeyFrame &  k2)

Definition at line 42 of file keyframe.cpp.

◆ pos()

int KeyFrame::pos ( ) const
inline

Definition at line 38 of file keyframe.h.

◆ removeEventListner()

void KeyFrame::removeEventListner ( KeyFrameEventListener *  listener)

Definition at line 66 of file keyframe.cpp.

◆ setFileName()

void KeyFrame::setFileName ( QString  strFileName)
inline

Definition at line 49 of file keyframe.h.

◆ setLength()

void KeyFrame::setLength ( int  len)
inline

Definition at line 42 of file keyframe.h.

◆ setModified()

void KeyFrame::setModified ( bool  b)
inline

Definition at line 45 of file keyframe.h.

◆ setPos()

void KeyFrame::setPos ( int  position)
inline

Definition at line 39 of file keyframe.h.

◆ unloadFile()

virtual void KeyFrame::unloadFile ( )
inlinevirtual

Unloads the data from memory in order to save memory.

This will only work if a backing file exists and the latest keyframe data has been saved to disk, eg. isModified is false

Reimplemented in BitmapImage.

Definition at line 60 of file keyframe.h.

Member Data Documentation

◆ mAttachedFileName

QString KeyFrame::mAttachedFileName
private

Definition at line 72 of file keyframe.h.

◆ mEventListeners

std::vector<KeyFrameEventListener*> KeyFrame::mEventListeners
private

Definition at line 74 of file keyframe.h.

◆ mFrame

int KeyFrame::mFrame = -1
private

Definition at line 69 of file keyframe.h.

◆ mIsModified

bool KeyFrame::mIsModified = true
private

Definition at line 71 of file keyframe.h.

◆ mLength

int KeyFrame::mLength = 1
private

Definition at line 70 of file keyframe.h.


The documentation for this class was generated from the following files:
  • core_lib/src/structure/keyframe.h
  • core_lib/src/structure/keyframe.cpp
Generated on Wed May 20 2026 06:16:32 for Pencil2D by doxygen 1.9.6 based on revision b8a30d7dfe4ff276bcca8087d5396d1507ed94fa