| reed@google.com | 889b09e | 2012-07-27 21:10:42 +0000 | [diff] [blame] | 1 | |
| 2 | #ifndef SkImagePriv_DEFINED |
| 3 | #define SkImagePriv_DEFINED |
| 4 | |
| 5 | #include "SkBitmap.h" |
| 6 | #include "SkImage.h" |
| 7 | |
| 8 | extern SkBitmap::Config SkImageInfoToBitmapConfig(const SkImage::Info&, |
| 9 | bool* isOpaque); |
| 10 | |
| 11 | extern int SkImageBytesPerPixel(SkImage::ColorType); |
| 12 | |
| 13 | extern bool SkBitmapToImageInfo(const SkBitmap&, SkImage::Info*); |
| 14 | extern SkImage* SkNewImageFromPixelRef(const SkImage::Info&, SkPixelRef*, |
| 15 | size_t rowBytes); |
| 16 | |
| 17 | /** |
| 18 | * Examines the bitmap to decide if it can share the existing pixelRef, or |
| 19 | * if it needs to make a deep-copy of the pixels |
| 20 | */ |
| 21 | extern SkImage* SkNewImageFromBitmap(const SkBitmap&); |
| 22 | |
| 23 | static inline size_t SkImageMinRowBytes(const SkImage::Info& info) { |
| 24 | return info.fWidth * SkImageBytesPerPixel(info.fColorType); |
| 25 | } |
| 26 | |
| 27 | #endif |