Chromium Code Reviews| Index: src/codec/SkMaskSwizzler.h |
| diff --git a/src/codec/SkMaskSwizzler.h b/src/codec/SkMaskSwizzler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6cb790607c9a1b885b3bff2fa80e9d8d2e149712 |
| --- /dev/null |
| +++ b/src/codec/SkMaskSwizzler.h |
| @@ -0,0 +1,59 @@ |
| +/* |
| + * Copyright 2015 Google Inc. |
| + * |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#include "SkMasks.h" |
| +#include "SkSwizzler.h" |
| +#include "SkTypes.h" |
| + |
| +/* |
| + * |
| + * Used to swizzle images whose pixel components are extracted by bit masks |
| + * Currently only used by bmp |
| + * |
| + */ |
| +class SkMaskSwizzler { |
| +public: |
| + |
| + /* |
| + * |
| + * Create a new swizzler |
| + * |
| + */ |
| + static SkMaskSwizzler* CreateMaskSwizzler(const SkImageInfo& imageInfo, |
| + 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!
|
| + uint32_t bitsPerPixel); |
| + |
| + /* |
| + * |
| + * Swizzle the next row |
| + * |
| + */ |
| + SkSwizzler::ResultAlpha next(void* dst, const uint8_t* src); |
| + |
| +private: |
| + |
| + /* |
| + * |
| + * Row procedure used for swizzle |
| + * |
| + */ |
| + typedef SkSwizzler::ResultAlpha (*RowProc)( |
| + void* dstRow, const uint8_t* srcRow, int width, |
| + SkMasks* masks); |
| + |
| + /* |
| + * |
| + * Constructor for mask swizzler |
| + * |
| + */ |
| + SkMaskSwizzler(const SkImageInfo& info, SkMasks* masks, RowProc proc); |
| + |
| + // Fields |
| + const SkImageInfo& fImageInfo; |
| + SkMasks* fMasks; |
| + const RowProc fRowProc; |
| +}; |