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 * @param masks Unowned pointer to helper class |
| 25 * |
| 26 */ |
| 27 static SkMaskSwizzler* CreateMaskSwizzler(const SkImageInfo& imageInfo, |
| 28 SkMasks* masks, |
| 29 uint32_t bitsPerPixel); |
| 30 |
| 31 /* |
| 32 * |
| 33 * Swizzle the next row |
| 34 * |
| 35 */ |
| 36 SkSwizzler::ResultAlpha next(void* dst, const uint8_t* src); |
| 37 |
| 38 private: |
| 39 |
| 40 /* |
| 41 * |
| 42 * Row procedure used for swizzle |
| 43 * |
| 44 */ |
| 45 typedef SkSwizzler::ResultAlpha (*RowProc)( |
| 46 void* dstRow, const uint8_t* srcRow, int width, |
| 47 SkMasks* masks); |
| 48 |
| 49 /* |
| 50 * |
| 51 * Constructor for mask swizzler |
| 52 * |
| 53 */ |
| 54 SkMaskSwizzler(const SkImageInfo& info, SkMasks* masks, RowProc proc); |
| 55 |
| 56 // Fields |
| 57 const SkImageInfo& fImageInfo; |
| 58 SkMasks* fMasks; // unowned |
| 59 const RowProc fRowProc; |
| 60 }; |
OLD | NEW |