Page Speed Optimization Libraries
1.13.35.1
|
#include "jpeg_reader.h"
Public Member Functions | |
JpegReader (MessageHandler *handler) | |
jpeg_decompress_struct * | decompress_struct () const |
void | PrepareForRead (const void *image_data, size_t image_length) |
A very thin wrapper that configures a jpeg_decompress_struct for reading from a string. The caller is responsible for configuring a jmp_buf and setting it as the client_data of the jpeg_decompress_struct, like so:
jmp_buf env; if (setjmp(env)) { // error handling } JpegReader reader; jpeg_decompress_struct* jpeg_decompress = reader.decompress_struct(); jpeg_decompress->client_data = static_cast<void*>(&env); reader.PrepareForRead(src); // perform other operations on jpeg_decompress.