Add JPG image support (#23)
## Summary - Add basic JPG image support - Map JPG back to 2-bit BMP output - Can be used to later render the BMP file from disk or directly pass to output if wanted - Give the 3 passes over the data needed to render grayscale content, putting it on disk is preferred to outputting it multiple times ## Additional Context - WIP, looking forward to BMP support from https://github.com/daveallie/crosspoint-reader/pull/16 - Addresses some of #11
This commit is contained in:
15
lib/JpegToBmpConverter/JpegToBmpConverter.h
Normal file
15
lib/JpegToBmpConverter/JpegToBmpConverter.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <FS.h>
|
||||
|
||||
class ZipFile;
|
||||
|
||||
class JpegToBmpConverter {
|
||||
static void writeBmpHeader(Print& bmpOut, int width, int height);
|
||||
static uint8_t grayscaleTo2Bit(uint8_t grayscale);
|
||||
static unsigned char jpegReadCallback(unsigned char* pBuf, unsigned char buf_size,
|
||||
unsigned char* pBytes_actually_read, void* pCallback_data);
|
||||
|
||||
public:
|
||||
static bool jpegFileToBmpStream(File& jpegFile, Print& bmpOut);
|
||||
};
|
||||
Reference in New Issue
Block a user