Index: src/codec/SkBmpCodec.h |
diff --git a/src/codec/SkBmpCodec.h b/src/codec/SkBmpCodec.h |
index 71006f73153ea3028529b0c51daa999b498bc86e..c187b31271eebfbeba85c7816c100720c46b7bf2 100644 |
--- a/src/codec/SkBmpCodec.h |
+++ b/src/codec/SkBmpCodec.h |
@@ -11,6 +11,7 @@ |
#include "SkColorTable.h" |
#include "SkImageInfo.h" |
#include "SkMaskSwizzler.h" |
+#include "SkScanlineDecoder.h" |
#include "SkStream.h" |
#include "SkSwizzler.h" |
#include "SkTypes.h" |
@@ -31,6 +32,16 @@ public: |
}; |
/* |
+ * Used to define the input format of the bmp |
+ */ |
+ enum BmpInputFormat { |
+ kStandard_BmpInputFormat, |
+ kRLE_BmpInputFormat, |
+ kBitMask_BmpInputFormat, |
+ kUnknown_BmpInputFormat |
+ }; |
+ |
+ /* |
* Checks the start of the stream to see if the image is a bmp |
*/ |
static bool IsBmp(SkStream*); |
@@ -48,6 +59,13 @@ public: |
*/ |
static SkCodec* NewFromIco(SkStream*); |
+ /* |
+ * Assumes IsBmp was called and returned true |
+ * Creates a bmp scanline decoder |
+ * Takes ownership of the stream |
+ */ |
+ static SkScanlineDecoder* NewSDFromStream(SkStream* stream); |
+ |
protected: |
SkBmpCodec(const SkImageInfo& info, SkStream* stream, uint16_t bitsPerPixel, |
@@ -104,8 +122,23 @@ private: |
*/ |
static SkCodec* NewFromStream(SkStream*, bool inIco); |
- const uint16_t fBitsPerPixel; |
- const RowOrder fRowOrder; |
+ /* |
+ * Calls unique bmp subclass implementations of onStart() |
+ */ |
+ virtual SkCodec::Result onStart(const SkImageInfo& dstInfo, const SkCodec::Options& options, |
+ SkPMColor inputColorPtr[], int* inputColorCount) = 0; |
+ |
+ /* |
+ * Performs the row by row decode |
+ * Unique for each of the bmp subclasses |
+ */ |
+ virtual Result decode(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, |
+ const Options& opts) = 0; |
+ |
+ const uint16_t fBitsPerPixel; |
+ const RowOrder fRowOrder; |
+ |
+ friend class SkBmpScanlineDecoder; |
typedef SkCodec INHERITED; |
}; |