2024-07-15 17:47:19 +08:00
|
|
|
#ifndef __IMAGEDECODER_H__
|
|
|
|
#define __IMAGEDECODER_H__
|
|
|
|
|
2024-10-01 00:50:05 +08:00
|
|
|
#include <cstdint>
|
2024-07-15 17:47:19 +08:00
|
|
|
#include <optional>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class ImageDecoder {
|
|
|
|
public:
|
|
|
|
struct Image {
|
|
|
|
uint32_t width;
|
|
|
|
uint32_t height;
|
|
|
|
std::vector<uint8_t> data;
|
|
|
|
};
|
|
|
|
static std::optional<Image> extractJpegYComponent(const std::string &filename);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __IMAGEDECODER_H__
|