bsalomon@google.com | d58a1cd | 2011-11-10 20:57:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 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 | |
reed@google.com | 7111d46 | 2014-03-25 16:20:24 +0000 | [diff] [blame] | 8 | #ifndef SkPixelInfo_DEFINED |
| 9 | #define SkPixelInfo_DEFINED |
bsalomon@google.com | d58a1cd | 2011-11-10 20:57:43 +0000 | [diff] [blame] | 10 | |
reed@google.com | 7111d46 | 2014-03-25 16:20:24 +0000 | [diff] [blame] | 11 | #include "SkImageInfo.h" |
bsalomon@google.com | d58a1cd | 2011-11-10 20:57:43 +0000 | [diff] [blame] | 12 | |
reed@google.com | 7111d46 | 2014-03-25 16:20:24 +0000 | [diff] [blame] | 13 | struct SkPixelInfo { |
| 14 | SkColorType fColorType; |
| 15 | SkAlphaType fAlphaType; |
| 16 | size_t fRowBytes; |
| 17 | }; |
bsalomon@google.com | fb0d741 | 2012-02-22 21:25:34 +0000 | [diff] [blame] | 18 | |
reed@google.com | 7111d46 | 2014-03-25 16:20:24 +0000 | [diff] [blame] | 19 | struct SkDstPixelInfo : SkPixelInfo { |
| 20 | void* fPixels; |
| 21 | }; |
bsalomon@google.com | a91e923 | 2012-02-23 15:39:54 +0000 | [diff] [blame] | 22 | |
reed@google.com | 7111d46 | 2014-03-25 16:20:24 +0000 | [diff] [blame] | 23 | struct SkSrcPixelInfo : SkPixelInfo { |
| 24 | const void* fPixels; |
humper@google.com | 05af1af | 2013-01-07 16:47:43 +0000 | [diff] [blame] | 25 | |
reed@google.com | 7111d46 | 2014-03-25 16:20:24 +0000 | [diff] [blame] | 26 | // Guaranteed to work even if src.fPixels and dst.fPixels are the same |
| 27 | // (but not if they overlap partially) |
| 28 | bool convertPixelsTo(SkDstPixelInfo* dst, int width, int height) const; |
| 29 | }; |
commit-bot@chromium.org | 4cd9e21 | 2014-03-07 03:25:16 +0000 | [diff] [blame] | 30 | |
| 31 | #endif |