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

Reader for GIF-encoded data. More...

#include "gif_reader.h"

Inheritance diagram for pagespeed::image_compression::GifReader:

Public Member Functions

 GifReader (MessageHandler *handler)
virtual bool ReadPng (const GoogleString &body, png_structp png_ptr, png_infop info_ptr, int transforms, bool require_opaque) const
virtual bool GetAttributes (const GoogleString &body, int *out_width, int *out_height, int *out_bit_depth, int *out_color_type) const
- Public Member Functions inherited from pagespeed::image_compression::PngReaderInterface
bool ReadPng (const GoogleString &body, png_structp png_ptr, png_infop info_ptr, int transforms) const

Additional Inherited Members

- Static Public Member Functions inherited from pagespeed::image_compression::PngReaderInterface
static bool GetBackgroundColor (png_structp png_ptr, png_infop info_ptr, unsigned char *red, unsigned char *green, unsigned char *blue, MessageHandler *handler)
static bool IsAlphaChannelOpaque (png_structp png_ptr, png_infop info_ptr, MessageHandler *handler)

Detailed Description

Reader for GIF-encoded data.

Member Function Documentation

virtual bool pagespeed::image_compression::GifReader::GetAttributes ( const GoogleString body,
int *  out_width,
int *  out_height,
int *  out_bit_depth,
int *  out_color_type 
) const

Get just the attributes of the given image. out_bit_depth is the number of bits per channel. out_color_type is one of the PNG_COLOR_TYPE_* declared in png.h.

TODO(bmcquade): consider merging this with ImageAttributes.

Implements pagespeed::image_compression::PngReaderInterface.

virtual bool pagespeed::image_compression::GifReader::ReadPng ( const GoogleString body,
png_structp  png_ptr,
png_infop  info_ptr,
int  transforms,
bool  require_opaque 
) const

Parse the contents of body, convert to a PNG, and populate the PNG structures with the PNG representation. If 'require_opaque' is true, returns an image without an alpha channel if the original image has no transparent pixels, and fails otherwise. Returns true on success, false on failure.

Implements pagespeed::image_compression::PngReaderInterface.

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