19 #ifndef PAGESPEED_KERNEL_IMAGE_SCANLINE_INTERFACE_H_
20 #define PAGESPEED_KERNEL_IMAGE_SCANLINE_INTERFACE_H_
30 namespace image_compression {
40 virtual bool Reset() = 0;
48 virtual ScanlineStatus InitializeWithStatus(
const void* image_buffer,
49 size_t buffer_length) = 0;
50 inline bool Initialize(
const void* image_buffer,
size_t buffer_length) {
51 return InitializeWithStatus(image_buffer, buffer_length).Success();
57 void** out_scanline_bytes) = 0;
90 PixelFormat pixel_format) = 0;
91 inline bool Init(
const size_t width,
const size_t height,
92 PixelFormat pixel_format) {
96 virtual ScanlineStatus InitializeWriteWithStatus(
const void* config,
98 inline bool InitializeWrite(
const void* config,
100 return InitializeWriteWithStatus(config, out).Success();
106 const void *scanline_bytes) = 0;
107 inline bool WriteNextScanline(
const void *scanline_bytes) {
113 inline bool FinalizeWrite() {
Definition: scanline_status.h:93
virtual bool HasMoreScanLines()=0
Returns true if there are more scanlines to read.
virtual size_t GetBytesPerScanline()=0
Returns number of bytes that required to store a scanline.
virtual PixelFormat GetPixelFormat()=0
Returns the pixel format that need to be used by writer.
Definition: scanline_interface.h:83
virtual bool IsProgressive()=0
virtual ScanlineStatus InitWithStatus(const size_t width, const size_t height, PixelFormat pixel_format)=0
Initialize the basic parameter for writing the image.
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual ScanlineStatus WriteNextScanlineWithStatus(const void *scanline_bytes)=0
Definition: scanline_interface.h:32
virtual ScanlineStatus FinalizeWriteWithStatus()=0
Finalizes write structure once all scanlines are written.
virtual size_t GetImageHeight()=0
Returns the height of the image.
virtual ScanlineStatus ReadNextScanlineWithStatus(void **out_scanline_bytes)=0
bool ReadNextScanline(void **out_scanline_bytes)
Definition: scanline_interface.h:61
virtual size_t GetImageWidth()=0
Returns the width of the image.