blob: 5c8df3e57f2b484abe540a3dc7492302506df7f8 [file] [log] [blame]
/*
* Copyright 2011 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkBitmapRegionDecoder_DEFINED
#define SkBitmapRegionDecoder_DEFINED
#include "SkBitmap.h"
#include "SkRect.h"
#include "SkImageDecoder.h"
#include "SkStream.h"
class SkBitmapRegionDecoder {
public:
SkBitmapRegionDecoder(SkImageDecoder *decoder, SkStream *stream,
int width, int height) {
fDecoder = decoder;
fStream = stream;
fWidth = width;
fHeight = height;
}
virtual ~SkBitmapRegionDecoder() {
delete fDecoder;
fStream->unref();
}
virtual bool decodeRegion(SkBitmap* bitmap, SkIRect rect,
SkBitmap::Config pref, int sampleSize);
virtual int getWidth() { return fWidth; }
virtual int getHeight() { return fHeight; }
virtual SkImageDecoder* getDecoder() { return fDecoder; }
private:
SkImageDecoder *fDecoder;
SkStream *fStream;
int fWidth;
int fHeight;
};
#endif