Page Speed Optimization Libraries  1.12.34.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
net_instaweb::spriter::ImageLibraryInterface Class Referenceabstract

#include "image_library_interface.h"

Inheritance diagram for net_instaweb::spriter::ImageLibraryInterface:
net_instaweb::spriter::LibpngImageLibrary net_instaweb::spriter::MockImageLibraryInterface

Classes

class  Canvas
 
class  Delegate
 
class  Image
 Images are immutable rectangular regions of pixels. More...
 

Public Types

typedef GoogleString FilePath
 

Public Member Functions

virtual ImageReadFromFile (const FilePath &path)=0
 
virtual CanvasCreateCanvas (int width, int height)=0
 
 ImageLibraryInterface (Delegate *delegate)
 

Static Public Member Functions

static ImageLibraryInterfaceImageLibraryInterfaceFactory (const GoogleString &library_name)
 Use this factory method to get a usable image library object.
 

Protected Member Functions

 ImageLibraryInterface (const FilePath &base_input_path, const FilePath &base_output_path, Delegate *delegate)
 Use ImageLibraryInterfaceFactory() to access an image library.
 
const FilePathbase_input_path ()
 Used by subclasses:
 
const FilePathbase_output_path ()
 
const Delegatedelegate ()
 

Detailed Description

Class ImageLibraryInterface provides an abstract interface to manipulate images. This interface hides the details of any particular image processing library. This makes it easy to port to an environment where a different image processing library is preferred.

Subclasses create methods that act on two types of objects:

Member Typedef Documentation

Todo:
TODO(skerner): Chromium's base lib has a class FilePath that handles paths in a cross-platform way. Use it.

Constructor & Destructor Documentation

net_instaweb::spriter::ImageLibraryInterface::ImageLibraryInterface ( Delegate delegate)
inlineexplicit

Constructor for custom subclasses. Prefer to use ImageLibraryInterfaceFactory() if possible.

Member Function Documentation

virtual Image* net_instaweb::spriter::ImageLibraryInterface::ReadFromFile ( const FilePath path)
pure virtual

Read an image from disk. Return NULL (after calling delegate method) on error. Caller owns the returned pointer.

Implemented in net_instaweb::spriter::LibpngImageLibrary.


The documentation for this class was generated from the following file: