diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-09-23 00:33:33 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-09-23 00:33:33 -0500 |
commit | 500e1f9892dd41419663e9f72cf47bab5b2aca0b (patch) | |
tree | a0709693d5317a6b89cdda7ac3143886b93552f4 /src/image.hpp | |
parent | fa4b4097d3283e1d6e6376c70910e245f0b1f6ec (diff) |
Saving work.
Diffstat (limited to 'src/image.hpp')
-rw-r--r-- | src/image.hpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/image.hpp b/src/image.hpp new file mode 100644 index 0000000..9b51be0 --- /dev/null +++ b/src/image.hpp @@ -0,0 +1,40 @@ +#ifndef IMAGE_HPP +#define IMAGE_HPP + +#include "bookmouse_types.hpp" + +#include <cstdint> +#include <vector> +#include <fud_string.hpp> + +// const int foo[] = {O_RDONLY, O_WRONLY, O_RDWR, O_TRUNC, O_APPEND, O_CREAT}; + +namespace bookmouse { + +enum class ImageError +{ + FileError, + JpegError, +}; + +using ImageOutput = std::vector<byte>; +using ImageResult = fud::Result<ImageOutput, ImageError>; + +class Image { + + public: + virtual ~Image() = default; + virtual ImageResult output() const = 0; +}; + +class JpegImage : public Image { + public: + virtual ImageResult output() const override; + + private: + fud::String m_filename; +}; + +} // namespace bookmouse + +#endif |