22 #ifndef PAGESPEED_KERNEL_IMAGE_IMAGE_FRAME_INTERFACE_H_
23 #define PAGESPEED_KERNEL_IMAGE_IMAGE_FRAME_INTERFACE_H_
31 namespace net_instaweb {
37 namespace image_compression {
55 PixelRgbaChannels bg_color;
74 bool Equals(
const ImageSpec& other)
const;
97 PixelFormat pixel_format;
108 bool Equals(
const FrameSpec& other)
const;
111 #if defined(IF_OK_RUN)
112 #error "Preprocessor macro collision."
120 #define IF_OK_RUN(_STATUS, _CALL) \
121 if (!_STATUS->Success()) { \
125 return _STATUS->Success();
164 image_buffer_ = image_buffer;
165 buffer_length_ = buffer_length;
204 return message_handler_;
208 quirks_mode_ = quirks_mode;
212 virtual QuirksMode quirks_mode()
const {
224 bool Initialize(
const void* image_buffer,
size_t buffer_length,
235 ScanlineStatus* status) {
239 ScanlineStatus* status) {
243 ScanlineStatus* status) {
247 bool set_quirks_mode(QuirksMode quirks_mode,
248 ScanlineStatus* status) {
249 IF_OK_RUN(status, set_quirks_mode(quirks_mode));
253 const void* image_buffer_;
254 size_t buffer_length_;
258 MessageHandler* message_handler_;
261 QuirksMode quirks_mode_;
313 return message_handler_;
328 bool PrepareNextFrame(
const FrameSpec* frame_spec, ScanlineStatus* status) {
340 MessageHandler* message_handler_;
ScanlineStatus Initialize(const void *image_buffer, size_t buffer_length)
Definition: image_frame_interface.h:163
virtual ScanlineStatus GetImageSpec(ImageSpec *image_spec) const =0
virtual bool HasMoreScanlines() const =0
virtual ScanlineStatus GetFrameSpec(FrameSpec *frame_spec) const =0
MessageHandler * message_handler() const
Definition: image_frame_interface.h:312
Definition: scanline_status.h:93
virtual ScanlineStatus FinalizeWrite()=0
Finalizes the image once all the frames have been written.
virtual ScanlineStatus PrepareNextFrame()=0
virtual ScanlineStatus Initialize(const void *config, GoogleString *out)=0
Definition: image_frame_interface.h:146
MessageHandler * message_handler() const
Definition: image_frame_interface.h:203
unsigned int loop_count
Definition: image_frame_interface.h:53
Definition: image_frame_interface.h:279
virtual ScanlineStatus ReadNextScanline(const void **out_scanline_bytes)=0
size_px TruncateXIndex(size_px x) const
virtual ScanlineStatus Reset()=0
Resets the MultipleFrameReader to its initial state.
bool Reset(ScanlineStatus *status)
Definition: image_frame_interface.h:221
bool hint_progressive
Definition: image_frame_interface.h:105
#define IF_OK_RUN(_STATUS, _CALL)
Definition: image_frame_interface.h:120
virtual ScanlineStatus WriteNextScanline(const void *scanline_bytes)=0
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Definition: image_frame_interface.h:87
Definition: image_frame_interface.h:43
Definition: image_frame_interface.h:79
bool CanContainFrame(const FrameSpec &frame_spec) const
Returns true iff frame_spec fits entirely within this ImageSpec.
bool image_size_adjusted
Definition: image_frame_interface.h:60
size_px TruncateYIndex(size_px y) const
Definition: message_handler.h:39
virtual ScanlineStatus Initialize()=0
DisposalMethod
Definition: image_frame_interface.h:80
virtual bool HasMoreFrames() const =0
virtual ScanlineStatus PrepareImage(const ImageSpec *image_spec)=0
virtual ScanlineStatus PrepareNextFrame(const FrameSpec *frame_spec)=0
bool Initialize(const void *config, GoogleString *out, ScanlineStatus *status)
Definition: image_frame_interface.h:321