Deep Learning Visualizer
Interactive visualization of basic applications of deep learning
Loading...
Searching...
No Matches
pixel_grid_presenter.h
Go to the documentation of this file.
1#pragma once
2
7#include "models/mnist.h"
8#include "shared/constants.h"
10#include <array>
11#include <functional>
12#include <memory>
13
14namespace presenters {
15
20public:
21 pixel_grid_presenter(std::unique_ptr<models::mnist> model,
22 std::unique_ptr<views::pixel_grid_view> view,
24
25 void render();
26
27 void handle_key_event(engine::input::key key, engine::input::action action);
28
29 void handle_mouse_event(engine::input::mouse mouse,
30 engine::input::action action);
31
32 void handle_cursor_event(const Eigen::Vector2f &cursor_position);
33
34private:
35 std::unique_ptr<models::mnist> model_;
36 std::unique_ptr<views::pixel_grid_view> view_;
37 std::reference_wrapper<engine::input::event_bus> bus_;
38
39 std::array<float, shared::TOTAL_PIXELS> drawn_image_{};
40 bool mouse_pressed_{false};
41};
42
43} // namespace presenters
An event dispatcher for input events.
Definition event_bus.h:15
A presenter for the interactive MNIST pixel grid prediction.
Definition pixel_grid_presenter.h:19
Defines input event related enums.
Constants used across many files.