Xteink-X4-crosspoint-reader/lib/Epub/Epub/converters/ImageDecoderFactory.h
2026-01-27 18:59:08 +00:00

25 lines
697 B
C++

#pragma once
#include <cstdint>
#include <memory>
#include <string>
#include <vector>
#include "ImageToFramebufferDecoder.h"
class JpegToFramebufferConverter;
class PngToFramebufferConverter;
class ImageDecoderFactory {
public:
static void initialize();
// Returns non-owning pointer - factory owns the decoder lifetime
static ImageToFramebufferDecoder* getDecoder(const std::string& imagePath);
static bool isFormatSupported(const std::string& imagePath);
static std::vector<std::string> getSupportedFormats();
private:
static std::unique_ptr<JpegToFramebufferConverter> jpegDecoder;
static std::unique_ptr<PngToFramebufferConverter> pngDecoder;
static bool initialized;
};