44#include <unordered_map>
164 int pixelY,
bool mouseDown);
167 int pixelY,
bool mouseDown);
170 int pixelY,
bool mouseClicked);
177 std::vector<std::tuple<int, int, Col>>& changed);
179 uint64_t frameI,
int x,
int y,
const Col& prev,
const Col& next);
182 float startX,
float startY,
float frameWidth,
float frameHeight);
184 ImDrawList* drawList,
float startX,
float startY,
float frameWidth,
Core type definitions used across FuncDoodle.
Runtime configuration and user-adjustable application settings.
Renders and manages the editor grid overlay.
Defines AnimationPlayer, responsible for animation playback control.
Defines pixel color structures and frame/image data containers.
Convenience type aliases for standard smart pointers.
std::unique_ptr< T > UniquePtr
Alias for an exclusively owned smart pointer.
Definition Ptr.h:28
std::shared_ptr< T > SharedPtr
Alias for a reference-counted shared smart pointer.
Definition Ptr.h:31
Defines selection primitives for editing regions of pixels.
Responsible for playing a users' animation.
Definition Player.h:39
void FinalizeStroke(AnimationPlayer *player)
Definition EditorController.cc:306
void ApplyToolAt(CanvasContext &context, const ImageArray *pixels, float startX, float startY, float frameWidth, float frameHeight)
Definition EditorController.cc:395
EditorController()
Creates an editor controller.
std::vector< StrokeAction::PixelChange > m_StrokeChanges
Definition EditorController.h:191
static void HandleCanvasInput(CanvasContext &context)
Definition EditorController.cc:354
SharedPtr< Selection > Sel()
Returns the active selection object.
Definition EditorController.h:149
bool PaintSelect(Frame *frame, ToolManager *toolManager, int pixelX, int pixelY)
Definition EditorController.cc:214
void ResetState()
Clears transient editor state tied to the active project.
Definition EditorController.cc:66
static void FloodFill(int x, int y, ToolManager *toolManager, Col targetCol, Col fillCol, Frame *targetFrame, std::vector< std::tuple< int, int, Col > > &changed)
Definition EditorController.cc:235
bool PaintEraser(Frame *frame, uint64_t frameI, ToolManager *toolManager, AnimationPlayer *player, int pixelX, int pixelY, bool mouseDown)
Definition EditorController.cc:125
void RenderCanvas(CanvasContext &context)
Renders the frame canvas and handles its live interaction.
Definition EditorController.cc:321
bool PaintBucket(Frame *frame, uint64_t frameI, ToolManager *toolManager, AnimationPlayer *player, int pixelX, int pixelY, bool mouseClicked)
Definition EditorController.cc:168
void RecordStrokeChange(uint64_t frameI, int x, int y, const Col &prev, const Col &next)
Definition EditorController.cc:280
SharedPtr< Selection > m_Sel
Definition EditorController.h:193
std::unordered_map< uint64_t, size_t > m_StrokeIndexByKey
Definition EditorController.h:192
bool Paint(Frame *frame, uint64_t frameI, ToolManager *toolManager, AnimationPlayer *player, int pixelX, int pixelY, bool mouseDown, bool mouseClicked)
Applies the active tool to a frame at a specific pixel.
Definition EditorController.cc:24
bool m_UndoByStroke
Definition EditorController.h:188
SquareSelection m_SquareSel
Definition EditorController.h:194
bool PaintPencil(Frame *frame, uint64_t frameI, ToolManager *toolManager, AnimationPlayer *player, int pixelX, int pixelY, bool mouseDown)
Definition EditorController.cc:76
void SetSel(SharedPtr< Selection > sel)
Sets the active selection object.
Definition EditorController.h:156
void EndStroke(AnimationPlayer *player)
Finalizes the active stroke and pushes its undo record.
Definition EditorController.cc:62
void DrawCanvas(CanvasContext &context, const ImageArray *pixels, ImDrawList *drawList, float startX, float startY, float frameWidth, float frameHeight)
Definition EditorController.cc:550
static bool PaintPicker(Frame *frame, ToolManager *toolManager, int pixelX, int pixelY)
Definition EditorController.cc:202
uint64_t m_StrokeFrameI
Definition EditorController.h:190
bool m_StrokeActive
Definition EditorController.h:189
void SetUndoByStroke(bool undoByStroke, AnimationPlayer *player)
Enables or disables stroke-grouped undo behavior.
Definition EditorController.cc:51
Wraps an ImageArray with higher-level frame editing operations.
Definition Frame.h:248
2D array of RGB8 color pixels.
Definition Frame.h:126
The FuncDoodle C++ namespace.
Definition Common.h:12
Represents the application's current settings and loaded from imgui.ini.
Definition AppSettings.h:22
A struct holding an RGB8 color.
Definition Frame.h:47
Bundles per-frame canvas state used during rendering and input handling.
Definition EditorController.h:61
ToolManager * ToolManager
Tool state used for painting.
Definition EditorController.h:67
AppSettings & Settings
Application settings affecting canvas behavior.
Definition EditorController.h:79
UniquePtr< Grid > Grid
Optional grid overlay for the canvas.
Definition EditorController.h:71
AnimationPlayer * Player
Player attached to the current project.
Definition EditorController.h:69
int PixelScale
Screen-space size of one pixel.
Definition EditorController.h:73
class Frame * Frame
Frame currently being rendered and edited.
Definition EditorController.h:62
class Frame * PreviousFrame
Previous frame used for preview rendering.
Definition EditorController.h:64
ImVec2 LastHoverMousePos
Last hovered mouse position over the canvas.
Definition EditorController.h:76
uint64_t Index
Timeline index of the active frame.
Definition EditorController.h:66
ImVec2 LastMousePos
Last mouse position used for stroke interpolation.
Definition EditorController.h:74
CanvasContext(AppSettings &settings)
Creates a canvas context bound to application settings.
Definition EditorController.h:87
Rectangular selection defined by two corner points.
Definition Selection.h:51