toojpeg icon indicating copy to clipboard operation
toojpeg copied to clipboard

allow passing data void* to the callback, fix visual studio warning

Open rmawatson opened this issue 2 years ago • 0 comments

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 arguments to rgb2cb/rgb2cr to remove visual studio warning.

rmawatson avatar Jan 30 '23 18:01 rmawatson