19 #ifndef PAGESPEED_KERNEL_IMAGE_GIF_READER_H_
20 #define PAGESPEED_KERNEL_IMAGE_GIF_READER_H_
33 #include "third_party/giflib/lib/gif_lib.h"
35 #ifdef USE_SYSTEM_LIBPNG
38 #include "third_party/libpng/src/png.h"
44 namespace image_compression {
48 class ScopedGifStruct;
64 bool require_opaque)
const;
70 int* out_color_type)
const;
108 return (image_initialized_ && (next_frame_ < image_spec_.num_frames));
112 return (frame_initialized_ && (next_row_ < frame_spec_.height));
124 if (frame_spec == NULL) {
126 SCANLINE_STATUS_INVOCATION_ERROR,
128 "Unexpected NULL pointer.");
130 *frame_spec = frame_spec_;
135 if (image_spec == NULL) {
137 SCANLINE_STATUS_INVOCATION_ERROR,
139 "Unexpected NULL pointer.");
141 *image_spec = image_spec_;
165 ImageFormat image_type,
180 static const int kNoTransparentIndex;
198 ScanlineStatus ProcessExtensionAffectingImage(
bool past_first_frame);
206 bool image_initialized_;
209 bool frame_initialized_;
218 bool has_loop_count_;
230 int frame_transparent_index_;
255 int frame_palette_size_;
264 bool frame_eagerly_read_;
virtual ScanlineStatus Initialize()
Reader for GIF-encoded data.
Definition: gif_reader.h:55
Definition: scanline_status.h:93
virtual bool HasMoreScanlines() const
Definition: gif_reader.h:111
static void ApplyQuirksModeToFirstFrame(QuirksMode quirks_mode, const ImageSpec &image_spec, FrameSpec *frame_spec)
Definition: image_frame_interface.h:146
MessageHandler * message_handler() const
Definition: image_frame_interface.h:203
virtual ScanlineStatus PrepareNextFrame()
Definition: scoped_ptr.h:47
friend class TestGifFrameReader
Used in gif_reader_test.cc and frame_interface_integration_test.cc.
Definition: gif_reader.h:170
virtual bool ReadPng(const GoogleString &body, png_structp png_ptr, png_infop info_ptr, int transforms, bool require_opaque) const
#define PS_LOGGED_STATUS(_LOGGER, _HANDLER, _TYPE, _SOURCE,...)
Definition: scanline_status.h:189
virtual ScanlineStatus Reset()
Resets the MultipleFrameReader to its initial state.
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual ScanlineStatus GetImageSpec(ImageSpec *image_spec) const
Definition: gif_reader.h:134
virtual bool GetAttributes(const GoogleString &body, int *out_width, int *out_height, int *out_bit_depth, int *out_color_type) const
static void ApplyQuirksModeToImage(QuirksMode quirks_mode, bool has_loop_count, const FrameSpec &frame_spec, ImageSpec *image_spec)
Definition: image_frame_interface.h:43
Definition: image_frame_interface.h:79
virtual bool HasMoreFrames() const
Definition: gif_reader.h:107
Definition: gif_reader.h:96
Definition: message_handler.h:39
virtual ScanlineStatus GetFrameSpec(FrameSpec *frame_spec) const
Definition: gif_reader.h:123
DisposalMethod
Definition: image_frame_interface.h:80
Definition: png_optimizer.h:114
virtual ScanlineStatus ReadNextScanline(const void **out_scanline_bytes)
#define PS_LOG_DFATAL(handler,...)
NDEBUG.
Definition: message_handler.h:150
friend MultipleFrameReader * InstantiateImageFrameReader(ImageFormat image_type, MessageHandler *handler, ScanlineStatus *status)