44#include <unordered_map>
154 int pixelY,
bool mouseDown);
157 int pixelY,
bool mouseDown);
160 int pixelY,
bool mouseClicked);
166 Frame* targetFrame, std::vector<std::pair<int, int>>& changed);
168 const Col& prev,
const Col& next);
171 float startX,
float startY,
float frameWidth,
float frameHeight);
173 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:292
void ApplyToolAt(CanvasContext &context, const ImageArray *pixels, float startX, float startY, float frameWidth, float frameHeight)
Definition EditorController.cc:370
EditorController()
Creates an editor controller.
std::vector< StrokeAction::PixelChange > m_StrokeChanges
Definition EditorController.h:180
static void HandleCanvasInput(CanvasContext &context)
Definition EditorController.cc:340
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:211
void ResetState()
Clears transient editor state tied to the active project.
Definition EditorController.cc:63
bool Paint(Frame *frame, unsigned long 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:21
std::unordered_map< unsigned long long, size_t > m_StrokeIndexByKey
Definition EditorController.h:181
static void FloodFill(int x, int y, Col targetCol, Col fillCol, Frame *targetFrame, std::vector< std::pair< int, int > > &changed)
Definition EditorController.cc:232
bool PaintPencil(Frame *frame, unsigned long frameI, ToolManager *toolManager, AnimationPlayer *player, int pixelX, int pixelY, bool mouseDown)
Definition EditorController.cc:73
void RenderCanvas(CanvasContext &context)
Renders the frame canvas and handles its live interaction.
Definition EditorController.cc:307
SharedPtr< Selection > m_Sel
Definition EditorController.h:182
bool m_UndoByStroke
Definition EditorController.h:177
SquareSelection m_SquareSel
Definition EditorController.h:183
bool PaintEraser(Frame *frame, unsigned long frameI, ToolManager *toolManager, AnimationPlayer *player, int pixelX, int pixelY, bool mouseDown)
Definition EditorController.cc:122
bool PaintBucket(Frame *frame, unsigned long frameI, ToolManager *toolManager, AnimationPlayer *player, int pixelX, int pixelY, bool mouseClicked)
Definition EditorController.cc:165
void EndStroke(AnimationPlayer *player)
Finalizes the active stroke and pushes its undo record.
Definition EditorController.cc:59
void DrawCanvas(CanvasContext &context, const ImageArray *pixels, ImDrawList *drawList, float startX, float startY, float frameWidth, float frameHeight)
Definition EditorController.cc:525
static bool PaintPicker(Frame *frame, ToolManager *toolManager, int pixelX, int pixelY)
Definition EditorController.cc:199
bool m_StrokeActive
Definition EditorController.h:178
void SetUndoByStroke(bool undoByStroke, AnimationPlayer *player)
Enables or disables stroke-grouped undo behavior.
Definition EditorController.cc:48
void RecordStrokeChange(unsigned long frameI, int x, int y, const Col &prev, const Col &next)
Definition EditorController.cc:265
unsigned long m_StrokeFrameI
Definition EditorController.h:179
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
unsigned long Index
Timeline index of the active frame.
Definition EditorController.h:66
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
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