77 std::vector<std::pair<int, int>> affected)
101 void Redo()
override;
134 std::vector<PixelChange> changes)
141 void Undo()
override;
146 void Redo()
override;
Defines the base interface for undoable and redoable editor actions.
Defines pixel color structures and frame/image data containers.
Defines the ProjectFile class, which manages animation project data.
std::weak_ptr< T > WeakPtr
Alias for a non-owning observer of a SharedPtr.
Definition Ptr.h:34
std::shared_ptr< T > SharedPtr
Alias for a reference-counted shared smart pointer.
Definition Ptr.h:31
Base interface for undoable and redoable editor actions.
Definition Common.h:24
~DrawAction() override=default
Destructor.
int m_X
Definition Core.h:57
WeakPtr< ProjectFile > m_Proj
Definition Core.h:61
Col m_Prev
Definition Core.h:58
DrawAction(const DrawAction &other)=default
Copy constructor.
void Redo() override
Applies the new pixel color.
Definition Core.cc:13
unsigned long m_FrameIndex
Definition Core.h:60
DrawAction(int x, int y, Col prev, Col next, unsigned long frameI, const SharedPtr< ProjectFile > &proj)
Creates a draw action for a single pixel change.
Definition Core.h:31
Col m_Next
Definition Core.h:59
void Undo() override
Reverts the pixel to its previous color.
Definition Core.cc:8
int m_Y
Definition Core.h:57
~FillAction() override=default
Destructor.
void Undo() override
Reverts the fill operation.
Definition Core.cc:19
void Redo() override
Reapplies the fill operation.
Definition Core.cc:28
FillAction(const FillAction &other)=default
Copy constructor.
Col m_Prev
Definition Core.h:104
FillAction(Col prev, Col next, unsigned long frameI, const SharedPtr< ProjectFile > &proj, std::vector< std::pair< int, int > > affected)
Creates a fill action from a flood-fill operation.
Definition Core.h:75
unsigned long m_FrameIndex
Definition Core.h:106
Col m_Next
Definition Core.h:105
std::vector< std::pair< int, int > > m_Pixels
Definition Core.h:108
WeakPtr< ProjectFile > m_Proj
Definition Core.h:107
std::vector< PixelChange > m_Changes
Definition Core.h:151
WeakPtr< ProjectFile > m_Proj
Definition Core.h:150
void Redo() override
Reapplies all pixel changes in the stroke.
Definition Core.cc:47
StrokeAction(unsigned long frameI, const SharedPtr< ProjectFile > &proj, std::vector< PixelChange > changes)
Creates a stroke action from a list of pixel changes.
Definition Core.h:133
void Undo() override
Reverts all pixel changes in the stroke.
Definition Core.cc:37
unsigned long m_FrameIndex
Definition Core.h:149
The FuncDoodle C++ namespace.
Definition Common.h:12
A struct holding an RGB8 color.
Definition Frame.h:47
Represents a single pixel modification in a stroke.
Definition Core.h:123
int x
X coordinate of the changed pixel.
Definition Core.h:124
int y
Y coordinate of the changed pixel.
Definition Core.h:125
Col prev
Pixel color before the stroke touched it.
Definition Core.h:126
Col next
Pixel color after the stroke applied.
Definition Core.h:127