4 dedup::dedup(uint32_t max
, uint32_t width
, uint32_t height
)
7 framebuffer
.resize(4 * width
* height
);
9 current
= 0; //First can't be dup.
12 bool dedup::operator()(const uint8_t* buffer
)
15 return false; //Dup detection disabled.
17 //Update buffer if not identical.
18 bool is_dup
= (current
&& !memcmp(&framebuffer
[0], buffer
, framebuffer
.size()));
20 memcpy(&framebuffer
[0], buffer
, framebuffer
.size());
22 //Decrement current if match, otherwise reset to bound
23 current
= is_dup
? (current
- 1) : bound
;