mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +03:00
25 lines
861 B
C++
25 lines
861 B
C++
#pragma once
|
|
#include <stdint.h>
|
|
|
|
#include <string>
|
|
|
|
#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);
|
|
};
|