1 #ifndef SkBitmapRegionDecoder_DEFINED 2 #define SkBitmapRegionDecoder_DEFINED 3 4 #include "SkBitmap.h" 5 #include "SkRect.h" 6 #include "SkImageDecoder.h" 7 8 class SkBitmapRegionDecoder { 9 public: 10 SkBitmapRegionDecoder(SkImageDecoder *decoder, int width, int height) { 11 fDecoder = decoder; 12 fWidth = width; 13 fHeight = height; 14 } 15 virtual ~SkBitmapRegionDecoder() { 16 delete fDecoder; 17 } 18 19 virtual bool decodeRegion(SkBitmap* bitmap, SkIRect rect, 20 SkBitmap::Config pref, int sampleSize); 21 22 virtual int getWidth() { return fWidth; } 23 virtual int getHeight() { return fHeight; } 24 25 virtual SkImageDecoder* getDecoder() { return fDecoder; } 26 27 private: 28 SkImageDecoder *fDecoder; 29 int fWidth; 30 int fHeight; 31 }; 32 33 #endif 34