pixelmatix / AnimatedGIFs

MIT License
62 stars 34 forks source link

don't have a sd card module #22

Open tarbear123 opened 5 years ago

tarbear123 commented 5 years ago

i don't have a sd card module, where do i put my gifs in the animated gif's example?

tarbear123 commented 5 years ago

hello?

jasoncoon commented 5 years ago

SD card is required.

mhungerford commented 5 years ago

Its a tiny amount of work to bake them into the firmware... I do this on my system so I don't need an SD-Card at all. I currently have around 12 gifs I switch between.

I created a MemFile.h that provides FileInfo read/seek/position/size/close/name using gifs converted to arrays using bin2h, so sizeof array and having FileInfo private members a fileaddr pointer, fileoffset count, filesize value. Then use this to create FilenameFunctions.cpp with fileOpenFile, fileSeekCallback, filePositionCallback, fileReadCallback, fileReadBlockCallback, which get provided to the gif decoder using the setFileReadCallback/setFileSeekCallback/etc.

My fileOpenFile takes the array pointer and sizeof(array).

Total its 80 lines of code.

mhungerford commented 5 years ago

//FilenameFunctions.cpp

include "MemFile.h"

FileInfo file;

bool fileOpenFile(const char name, const void address, uint32_t size) { file.reload(name, address, size); }

bool fileSeekCallback(unsigned long position) { return file.seek(position); }

unsigned long filePositionCallback(void) { return file.position(); }

int fileReadCallback(void) { return file.read(); }

int fileReadBlockCallback(void * buffer, int numberOfBytes) { return file.read(buffer, numberOfBytes); }

tarbear123 commented 5 years ago

//FilenameFunctions.cpp

include "MemFile.h"

FileInfo file;

bool fileOpenFile(const char name, const void address, uint32_t size) { file.reload(name, address, size); }

bool fileSeekCallback(unsigned long position) { return file.seek(position); }

unsigned long filePositionCallback(void) { return file.position(); }

int fileReadCallback(void) { return file.read(); }

int fileReadBlockCallback(void * buffer, int numberOfBytes) { return file.read(buffer, numberOfBytes); }

screenshot 21

is this how you create a new library in atom and where do you put your GIF's?

tarbear123 commented 5 years ago

hello?