toojpeg
toojpeg copied to clipboard
allow passing data void* to the callback, fix visual studio warning
allow passing data void* to the callback, so the destination can be passed in.
example:
std::vector<uint8_t> dest;
TooJpeg::writeJpeg(
[](unsigned char byte, void* data) -> void {
std::vector<uint8_t>& dest = *reinterpret_cast<std::vector<uint8_t>*>(data);
dest.push_back(byte);
},
&dest,
source.data(), width, height);
also static_cast