Page Speed Optimization Libraries
1.13.35.1
|
#include "pixel_format_optimizer.h"
Public Member Functions | |
PixelFormatOptimizer (net_instaweb::MessageHandler *handler) | |
ScanlineStatus | Initialize (ScanlineReaderInterface *reader) |
PixelFormatOptimizer acquires ownership of reader, even in case of failure. | |
virtual ScanlineStatus | ReadNextScanlineWithStatus (void **out_scanline_bytes) |
virtual bool | Reset () |
Resets the resizer to its initial state. Always returns true. | |
virtual size_t | GetBytesPerScanline () |
Returns number of bytes required to store a scanline. | |
virtual bool | HasMoreScanLines () |
virtual size_t | GetImageHeight () |
Returns the height of the image. | |
virtual size_t | GetImageWidth () |
Returns the width of the image. | |
virtual PixelFormat | GetPixelFormat () |
Returns the pixel format of the image. | |
virtual bool | IsProgressive () |
Returns true if the image is encoded in progressive / interlacing format. | |
virtual ScanlineStatus | InitializeWithStatus (const void *image_buffer, size_t buffer_length) |
Public Member Functions inherited from pagespeed::image_compression::ScanlineReaderInterface | |
bool | Initialize (const void *image_buffer, size_t buffer_length) |
bool | ReadNextScanline (void **out_scanline_bytes) |
PixelFormatOptimizer removes an unused channel from the image. This corresponds to changing the pixel format to a more compact one. Currently it only removes opaque alpha channel and changes RGBA_8888 to RGB_888.
To determine if a channel is unused, PixelFormatOptimizer has to examine every pixel in the image. Thus, the entire image may be buffered before the first output scanline can be retrieved. However, as soon as PixelFormatOptimizer finds a pixel with all channels used, it will stop buffering and become ready to serve the first scanline.
|
inlinevirtual |
Returns true if there are more scanlines to read. Returns false if the object has not been initialized or all of the scanlines have been read.
Implements pagespeed::image_compression::ScanlineReaderInterface.
|
virtual |
This method should not be called. If it does get called, in DEBUG mode it will throw a FATAL error and in RELEASE mode it does nothing.
Implements pagespeed::image_compression::ScanlineReaderInterface.
|
virtual |
Reads the next available scanline. Returns the ScanlineStatus of the conversion.
Implements pagespeed::image_compression::ScanlineReaderInterface.