summaryrefslogtreecommitdiff
path: root/src/image.hpp
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2024-09-23 00:33:33 -0500
committerDominick Allen <djallen@librehumanitas.org>2024-09-23 00:33:33 -0500
commit500e1f9892dd41419663e9f72cf47bab5b2aca0b (patch)
treea0709693d5317a6b89cdda7ac3143886b93552f4 /src/image.hpp
parentfa4b4097d3283e1d6e6376c70910e245f0b1f6ec (diff)
Saving work.
Diffstat (limited to 'src/image.hpp')
-rw-r--r--src/image.hpp40
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