OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2015 Google Inc. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #include "SkMasks.h" | |
9 #include "SkSwizzler.h" | |
10 #include "SkTypes.h" | |
11 | |
12 /* | |
13 * | |
14 * Used to swizzle images whose pixel components are extracted by bit masks | |
15 * Currently only used by bmp | |
16 * | |
17 */ | |
18 class SkMaskSwizzler { | |
19 public: | |
20 | |
21 /* | |
22 * | |
23 * Create a new swizzler | |
24 * | |
25 */ | |
26 static SkMaskSwizzler* CreateMaskSwizzler(const SkImageInfo& imageInfo, | |
27 SkMasks* masks, | |
scroggo
2015/03/11 19:22:45
Who owns masks?
msarett
2015/03/11 20:03:11
SkBmpCodec owns masks. I will make that clear!
| |
28 uint32_t bitsPerPixel); | |
29 | |
30 /* | |
31 * | |
32 * Swizzle the next row | |
33 * | |
34 */ | |
35 SkSwizzler::ResultAlpha next(void* dst, const uint8_t* src); | |
36 | |
37 private: | |
38 | |
39 /* | |
40 * | |
41 * Row procedure used for swizzle | |
42 * | |
43 */ | |
44 typedef SkSwizzler::ResultAlpha (*RowProc)( | |
45 void* dstRow, const uint8_t* srcRow, int width, | |
46 SkMasks* masks); | |
47 | |
48 /* | |
49 * | |
50 * Constructor for mask swizzler | |
51 * | |
52 */ | |
53 SkMaskSwizzler(const SkImageInfo& info, SkMasks* masks, RowProc proc); | |
54 | |
55 // Fields | |
56 const SkImageInfo& fImageInfo; | |
57 SkMasks* fMasks; | |
58 const RowProc fRowProc; | |
59 }; | |
OLD | NEW |