OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkBitmap_DEFINED | 8 #ifndef SkBitmap_DEFINED |
9 #define SkBitmap_DEFINED | 9 #define SkBitmap_DEFINED |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 | 76 |
77 /////////////////////////////////////////////////////////////////////////// | 77 /////////////////////////////////////////////////////////////////////////// |
78 | 78 |
79 const SkImageInfo& info() const { return fInfo; } | 79 const SkImageInfo& info() const { return fInfo; } |
80 | 80 |
81 int width() const { return fInfo.width(); } | 81 int width() const { return fInfo.width(); } |
82 int height() const { return fInfo.height(); } | 82 int height() const { return fInfo.height(); } |
83 SkColorType colorType() const { return fInfo.colorType(); } | 83 SkColorType colorType() const { return fInfo.colorType(); } |
84 SkAlphaType alphaType() const { return fInfo.alphaType(); } | 84 SkAlphaType alphaType() const { return fInfo.alphaType(); } |
85 | 85 |
86 SkIRect shape() const { return fInfo.shape(); } | |
reed1
2014/10/23 14:39:44
We already have getBounds(SkIRect*). I'm fine if w
hal.canary
2014/10/24 18:23:31
Acknowledged.
| |
87 SkISize dimensions() const { return fInfo.dimensions(); } | |
88 | |
86 /** | 89 /** |
87 * Return the number of bytes per pixel based on the colortype. If the colo rtype is | 90 * Return the number of bytes per pixel based on the colortype. If the colo rtype is |
88 * kUnknown_SkColorType, then 0 is returned. | 91 * kUnknown_SkColorType, then 0 is returned. |
89 */ | 92 */ |
90 int bytesPerPixel() const { return fInfo.bytesPerPixel(); } | 93 int bytesPerPixel() const { return fInfo.bytesPerPixel(); } |
91 | 94 |
92 /** | 95 /** |
93 * Return the rowbytes expressed as a number of pixels (like width and heig ht). | 96 * Return the rowbytes expressed as a number of pixels (like width and heig ht). |
94 * If the colortype is kUnknown_SkColorType, then 0 is returned. | 97 * If the colortype is kUnknown_SkColorType, then 0 is returned. |
95 */ | 98 */ |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
874 | 877 |
875 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { | 878 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { |
876 SkASSERT(fPixels); | 879 SkASSERT(fPixels); |
877 SkASSERT(kIndex_8_SkColorType == this->colorType()); | 880 SkASSERT(kIndex_8_SkColorType == this->colorType()); |
878 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height()); | 881 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height()); |
879 SkASSERT(fColorTable); | 882 SkASSERT(fColorTable); |
880 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; | 883 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; |
881 } | 884 } |
882 | 885 |
883 #endif | 886 #endif |
OLD | NEW |