26 explicit Canvas(QWidget *parent =
nullptr);
78 Eigen::MatrixXd image_matrix = Eigen::MatrixXd::Zero(1, 784);
The Canvas class represents a custom widget for drawing on a canvas.
Definition canvas.h:17
void mouseReleaseEvent(QMouseEvent *event) override
Handles the mouse release event.
Definition canvas.cpp:54
void clearImage()
Clears the image on the canvas.
Definition canvas.cpp:13
Eigen::MatrixXd getMatrix()
Gets the matrix representation of the image on the canvas.
Definition canvas.cpp:24
bool isDrawing()
Checks if the user is currently drawing on the canvas.
Definition canvas.h:50
void mousePressEvent(QMouseEvent *event) override
Handles the mouse press event.
Definition canvas.cpp:29
void restartCanvas()
Restarts the canvas by clearing the image and resetting the drawing state.
Definition canvas.cpp:19
void mouseMoveEvent(QMouseEvent *event) override
Handles the mouse move event.
Definition canvas.cpp:38