diff options
author | 2009-07-08 20:09:23 +0000 | |
---|---|---|
committer | 2009-07-08 20:09:23 +0000 | |
commit | 1134426f6b1c4130e8dbe4c38a4aa976fbb18b4b (patch) | |
tree | df7c4a1592d7c9627571211e4c7be5265467b9c7 /src/images/SkScaledBitmapSampler.h | |
parent | 40443b2371ecc61e04ad496f69919dc1e30036f5 (diff) |
respect preferred config when png is index-based
git-svn-id: http://skia.googlecode.com/svn/trunk@261 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/images/SkScaledBitmapSampler.h')
-rw-r--r-- | src/images/SkScaledBitmapSampler.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/images/SkScaledBitmapSampler.h b/src/images/SkScaledBitmapSampler.h index 0bb99242a7..84a75ba544 100644 --- a/src/images/SkScaledBitmapSampler.h +++ b/src/images/SkScaledBitmapSampler.h @@ -2,6 +2,7 @@ #define SkScaledBitmapSampler_DEFINED #include "SkTypes.h" +#include "SkColor.h" class SkBitmap; @@ -26,7 +27,8 @@ public: // Given a dst bitmap (with pixels already allocated) and a src-config, // prepares iterator to process the src colors and write them into dst. // Returns false if the request cannot be fulfulled. - bool begin(SkBitmap* dst, SrcConfig sc, bool doDither); + bool begin(SkBitmap* dst, SrcConfig sc, bool doDither, + const SkPMColor* = NULL); // call with row of src pixels, for y = 0...scaledHeight-1. // returns true if the row had non-opaque alpha in it bool next(const uint8_t* SK_RESTRICT src); @@ -39,17 +41,21 @@ private: int fY0; // first Y coord (scanline) to sample int fDX; // step between X samples int fDY; // step between Y samples - + typedef bool (*RowProc)(void* SK_RESTRICT dstRow, const uint8_t* SK_RESTRICT src, - int width, int deltaSrc, int y); - + int width, int deltaSrc, int y, + const SkPMColor[]); + // setup state char* fDstRow; // points into bitmap's pixels int fDstRowBytes; int fCurrY; // used for dithering int fSrcPixelSize; // 1, 3, 4 RowProc fRowProc; + + // optional reference to the src colors if the src is a palette model + const SkPMColor* fCTable; }; #endif |