Add class for converting Bitmaps to monochrome bytes representation
This commit is contained in:
20
src/graphics/Monochrome.hpp
Normal file
20
src/graphics/Monochrome.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <cstdint>
|
||||
|
||||
#include "graphics/Bitmap.hpp"
|
||||
|
||||
namespace ptprnt::graphics {
|
||||
class Monochrome {
|
||||
public:
|
||||
Monochrome(const std::vector<uint8_t>& grayscale);
|
||||
~Monochrome() = default;
|
||||
|
||||
void setThreshold(uint8_t);
|
||||
void invert(bool shouldInvert);
|
||||
std::vector<uint8_t> get();
|
||||
|
||||
private:
|
||||
const std::vector<uint8_t>& mPixels;
|
||||
uint8_t mThreshhold = 127;
|
||||
bool mShouldInvert = false;
|
||||
};
|
||||
} // namespace ptprnt::graphics
|
Reference in New Issue
Block a user