#pragma once #include #include #include "ImageToFramebufferDecoder.h" class JpegToFramebufferConverter final : public ImageToFramebufferDecoder { public: static bool getDimensionsStatic(const std::string& imagePath, ImageDimensions& out); bool decodeToFramebuffer(const std::string& imagePath, GfxRenderer& renderer, const RenderConfig& config) override; bool getDimensions(const std::string& imagePath, ImageDimensions& dims) const override { return getDimensionsStatic(imagePath, dims); } bool supportsFormat(const std::string& extension) const override; const char* getFormatName() const override { return "JPEG"; } private: static unsigned char jpegReadCallback(unsigned char* pBuf, unsigned char buf_size, unsigned char* pBytes_actually_read, void* pCallback_data); };