blob: 9b51be0de4420bd186e2f62431ba3c8b956b7c42 (
plain)
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
37
38
39
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
|