OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #ifndef SkScaledBitmapSampler_DEFINED | 8 #ifndef SkScaledBitmapSampler_DEFINED |
9 #define SkScaledBitmapSampler_DEFINED | 9 #define SkScaledBitmapSampler_DEFINED |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 kRGB, // 3 bytes per pixel | 29 kRGB, // 3 bytes per pixel |
30 kRGBX, // 4 byes per pixel (ignore 4th) | 30 kRGBX, // 4 byes per pixel (ignore 4th) |
31 kRGBA, // 4 bytes per pixel | 31 kRGBA, // 4 bytes per pixel |
32 kRGB_565 // 2 bytes per pixel | 32 kRGB_565 // 2 bytes per pixel |
33 }; | 33 }; |
34 | 34 |
35 // Given a dst bitmap (with pixels already allocated) and a src-config, | 35 // Given a dst bitmap (with pixels already allocated) and a src-config, |
36 // prepares iterator to process the src colors and write them into dst. | 36 // prepares iterator to process the src colors and write them into dst. |
37 // Returns false if the request cannot be fulfulled. | 37 // Returns false if the request cannot be fulfulled. |
38 bool begin(SkBitmap* dst, SrcConfig sc, bool doDither, | 38 bool begin(SkBitmap* dst, SrcConfig sc, bool doDither, |
39 const SkPMColor* = NULL); | 39 const SkPMColor* = NULL, bool requireUnPremul = false); |
40 // call with row of src pixels, for y = 0...scaledHeight-1. | 40 // call with row of src pixels, for y = 0...scaledHeight-1. |
41 // returns true if the row had non-opaque alpha in it | 41 // returns true if the row had non-opaque alpha in it |
42 bool next(const uint8_t* SK_RESTRICT src); | 42 bool next(const uint8_t* SK_RESTRICT src); |
43 | 43 |
44 private: | 44 private: |
45 int fScaledWidth; | 45 int fScaledWidth; |
46 int fScaledHeight; | 46 int fScaledHeight; |
47 | 47 |
48 int fX0; // first X coord to sample | 48 int fX0; // first X coord to sample |
49 int fY0; // first Y coord (scanline) to sample | 49 int fY0; // first Y coord (scanline) to sample |
(...skipping 10 matching lines...) Expand all Loading... |
60 size_t fDstRowBytes; | 60 size_t fDstRowBytes; |
61 int fCurrY; // used for dithering | 61 int fCurrY; // used for dithering |
62 int fSrcPixelSize; // 1, 3, 4 | 62 int fSrcPixelSize; // 1, 3, 4 |
63 RowProc fRowProc; | 63 RowProc fRowProc; |
64 | 64 |
65 // optional reference to the src colors if the src is a palette model | 65 // optional reference to the src colors if the src is a palette model |
66 const SkPMColor* fCTable; | 66 const SkPMColor* fCTable; |
67 }; | 67 }; |
68 | 68 |
69 #endif | 69 #endif |
OLD | NEW |