Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
pagespeed::image_compression::JpegReader Class Reference

#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)
 

Detailed Description

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.


The documentation for this class was generated from the following file: