77 std::vector<std::tuple<int, int, Col>> affected)
101 void Redo()
override;
133 std::vector<PixelChange> changes)
140 void Undo()
override;
145 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
uint64_t m_FrameIndex
Definition Core.h:60
DrawAction(int x, int y, Col prev, Col next, uint64_t frameI, const SharedPtr< ProjectFile > &proj)
Creates a draw action for a single pixel change.
Definition Core.h:31
DrawAction(const DrawAction &other)=default
Copy constructor.
void Redo() override
Applies the new pixel color.
Definition Core.cc:15
Col m_Next
Definition Core.h:59
void Undo() override
Reverts the pixel to its previous color.
Definition Core.cc:10
int m_Y
Definition Core.h:57
std::vector< std::tuple< int, int, Col > > m_Pixels
Definition Core.h:107
~FillAction() override=default
Destructor.
void Undo() override
Reverts the fill operation.
Definition Core.cc:21
void Redo() override
Reapplies the fill operation.
Definition Core.cc:31
FillAction(const FillAction &other)=default
Copy constructor.
Col m_Next
Definition Core.h:104
FillAction(Col next, uint64_t frameI, const SharedPtr< ProjectFile > &proj, std::vector< std::tuple< int, int, Col > > affected)
Creates a fill action from a flood-fill operation.
Definition Core.h:75
uint64_t m_FrameIndex
Definition Core.h:105
WeakPtr< ProjectFile > m_Proj
Definition Core.h:106
std::vector< PixelChange > m_Changes
Definition Core.h:150
WeakPtr< ProjectFile > m_Proj
Definition Core.h:149
void Redo() override
Reapplies all pixel changes in the stroke.
Definition Core.cc:50
void Undo() override
Reverts all pixel changes in the stroke.
Definition Core.cc:40
StrokeAction(uint64_t frameI, const SharedPtr< ProjectFile > &proj, std::vector< PixelChange > changes)
Creates a stroke action from a list of pixel changes.
Definition Core.h:132
uint64_t m_FrameIndex
Definition Core.h:148
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:122
int x
X coordinate of the changed pixel.
Definition Core.h:123
int y
Y coordinate of the changed pixel.
Definition Core.h:124
Col prev
Pixel color before the stroke touched it.
Definition Core.h:125
Col next
Pixel color after the stroke applied.
Definition Core.h:126