19 #ifndef NET_INSTAWEB_SPRITER_IMAGE_LIBRARY_INTERFACE_H_
20 #define NET_INSTAWEB_SPRITER_IMAGE_LIBRARY_INTERFACE_H_
22 #include "net/instaweb/spriter/public/image_spriter.pb.h"
29 namespace net_instaweb {
51 virtual void OnError(
const GoogleString& error)
const = 0;
59 virtual bool GetDimensions(
int* out_width,
int* out_height)
const = 0;
78 virtual bool DrawImage(
const Image* image,
int x,
int y) = 0;
79 virtual bool WriteToFile(
80 const FilePath& write_path, ImageFormat format) = 0;
89 virtual Canvas* CreateCanvas(
int width,
int height) = 0;
109 const FilePath& base_output_path() {
return base_output_path_; }
110 const Delegate* delegate() {
return delegate_; }
123 const Delegate* delegate_;
Definition: image_library_interface.h:41
static ImageLibraryInterface * ImageLibraryInterfaceFactory(const GoogleString &library_name)
Use this factory method to get a usable image library object.
Images are immutable rectangular regions of pixels.
Definition: image_library_interface.h:56
Image(ImageLibraryInterface *lib)
Only methods of ImageLibraryInterface may create images.
Definition: image_library_interface.h:63
virtual Image * ReadFromFile(const FilePath &path)=0
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Definition: image_library_interface.h:76
const FilePath & base_input_path()
Used by subclasses:
Definition: image_library_interface.h:108
virtual bool GetDimensions(int *out_width, int *out_height) const =0
Get the width and height of an image.
GoogleString FilePath
Definition: image_library_interface.h:45
ImageLibraryInterface(Delegate *delegate)
Definition: image_library_interface.h:93
Definition: image_library_interface.h:49