| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkBitmap_DEFINED | 10 #ifndef SkBitmap_DEFINED |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 The SkBitmap class specifies a raster bitmap. A bitmap has an integer width | 31 The SkBitmap class specifies a raster bitmap. A bitmap has an integer width |
| 32 and height, and a format (config), and a pointer to the actual pixels. | 32 and height, and a format (config), and a pointer to the actual pixels. |
| 33 Bitmaps can be drawn into a SkCanvas, but they are also used to specify the | 33 Bitmaps can be drawn into a SkCanvas, but they are also used to specify the |
| 34 target of a SkCanvas' drawing operations. | 34 target of a SkCanvas' drawing operations. |
| 35 A const SkBitmap exposes getAddr(), which lets a caller write its pixels; | 35 A const SkBitmap exposes getAddr(), which lets a caller write its pixels; |
| 36 the constness is considered to apply to the bitmap's configuration, not | 36 the constness is considered to apply to the bitmap's configuration, not |
| 37 its contents. | 37 its contents. |
| 38 */ | 38 */ |
| 39 class SK_API SkBitmap { | 39 class SK_API SkBitmap { |
| 40 public: | 40 public: |
| 41 class Allocator; | 41 class SK_API Allocator; |
| 42 | 42 |
| 43 enum Config { | 43 enum Config { |
| 44 kNo_Config, //!< bitmap has not been configured | 44 kNo_Config, //!< bitmap has not been configured |
| 45 /** | 45 /** |
| 46 * 1-bit per pixel, (0 is transparent, 1 is opaque) | 46 * 1-bit per pixel, (0 is transparent, 1 is opaque) |
| 47 * Valid as a destination (target of a canvas), but not valid as a src. | 47 * Valid as a destination (target of a canvas), but not valid as a src. |
| 48 * i.e. you can draw into a 1-bit bitmap, but you cannot draw from one. | 48 * i.e. you can draw into a 1-bit bitmap, but you cannot draw from one. |
| 49 */ | 49 */ |
| 50 kA1_Config, | 50 kA1_Config, |
| 51 kA8_Config, //!< 8-bits per pixel, with only alpha specified (0
is transparent, 0xFF is opaque) | 51 kA8_Config, //!< 8-bits per pixel, with only alpha specified (0
is transparent, 0xFF is opaque) |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 | 820 |
| 821 // returns the address of the byte that contains the x coordinate | 821 // returns the address of the byte that contains the x coordinate |
| 822 inline uint8_t* SkBitmap::getAddr1(int x, int y) const { | 822 inline uint8_t* SkBitmap::getAddr1(int x, int y) const { |
| 823 SkASSERT(fPixels); | 823 SkASSERT(fPixels); |
| 824 SkASSERT(fConfig == kA1_Config); | 824 SkASSERT(fConfig == kA1_Config); |
| 825 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight); | 825 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight); |
| 826 return (uint8_t*)fPixels + y * fRowBytes + (x >> 3); | 826 return (uint8_t*)fPixels + y * fRowBytes + (x >> 3); |
| 827 } | 827 } |
| 828 | 828 |
| 829 #endif | 829 #endif |
| OLD | NEW |