-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPixelTest.h
More file actions
36 lines (27 loc) · 707 Bytes
/
PixelTest.h
File metadata and controls
36 lines (27 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* PixelTest.h
*
* Created on: Apr 11, 2020
* Author: ans
*/
#ifndef PIXELTEST_H_
#define PIXELTEST_H_
#pragma once
#include <functional> // std::function
struct PixelTest {
using InitFunction = std::function<void(unsigned int, unsigned int)>;
using FrameFunction = std::function<void()>;
using TestFunction = std::function<bool(unsigned int, unsigned int)>;
InitFunction init;
FrameFunction frame;
TestFunction test;
/*
* NOTE: Debugging will turn the pixels
* RED for which the test fails,
* instead of not drawing them.
*/
bool debugging;
PixelTest() : debugging(false) {}
operator bool() const { return init && frame && test; }
};
#endif /* PIXELTEST_H_ */