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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 void swap(SkBitmap& other); | 65 void swap(SkBitmap& other); |
66 | 66 |
67 /////////////////////////////////////////////////////////////////////////// | 67 /////////////////////////////////////////////////////////////////////////// |
68 | 68 |
69 const SkImageInfo& info() const { return fInfo; } | 69 const SkImageInfo& info() const { return fInfo; } |
70 | 70 |
71 int width() const { return fInfo.width(); } | 71 int width() const { return fInfo.width(); } |
72 int height() const { return fInfo.height(); } | 72 int height() const { return fInfo.height(); } |
73 SkColorType colorType() const { return fInfo.colorType(); } | 73 SkColorType colorType() const { return fInfo.colorType(); } |
74 SkAlphaType alphaType() const { return fInfo.alphaType(); } | 74 SkAlphaType alphaType() const { return fInfo.alphaType(); } |
| 75 SkColorProfileType profileType() const { return fInfo.profileType(); } |
75 | 76 |
76 /** | 77 /** |
77 * Return the number of bytes per pixel based on the colortype. If the colo
rtype is | 78 * Return the number of bytes per pixel based on the colortype. If the colo
rtype is |
78 * kUnknown_SkColorType, then 0 is returned. | 79 * kUnknown_SkColorType, then 0 is returned. |
79 */ | 80 */ |
80 int bytesPerPixel() const { return fInfo.bytesPerPixel(); } | 81 int bytesPerPixel() const { return fInfo.bytesPerPixel(); } |
81 | 82 |
82 /** | 83 /** |
83 * Return the rowbytes expressed as a number of pixels (like width and heig
ht). | 84 * Return the rowbytes expressed as a number of pixels (like width and heig
ht). |
84 * If the colortype is kUnknown_SkColorType, then 0 is returned. | 85 * If the colortype is kUnknown_SkColorType, then 0 is returned. |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 | 810 |
810 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { | 811 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { |
811 SkASSERT(fPixels); | 812 SkASSERT(fPixels); |
812 SkASSERT(kIndex_8_SkColorType == this->colorType()); | 813 SkASSERT(kIndex_8_SkColorType == this->colorType()); |
813 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); | 814 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); |
814 SkASSERT(fColorTable); | 815 SkASSERT(fColorTable); |
815 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; | 816 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; |
816 } | 817 } |
817 | 818 |
818 #endif | 819 #endif |
OLD | NEW |