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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void swap(SkBitmap& other); | 78 void swap(SkBitmap& other); |
79 | 79 |
80 /////////////////////////////////////////////////////////////////////////// | 80 /////////////////////////////////////////////////////////////////////////// |
81 | 81 |
82 const SkImageInfo& info() const { return fInfo; } | 82 const SkImageInfo& info() const { return fInfo; } |
83 | 83 |
84 int width() const { return fInfo.width(); } | 84 int width() const { return fInfo.width(); } |
85 int height() const { return fInfo.height(); } | 85 int height() const { return fInfo.height(); } |
86 SkColorType colorType() const { return fInfo.colorType(); } | 86 SkColorType colorType() const { return fInfo.colorType(); } |
87 SkAlphaType alphaType() const { return fInfo.alphaType(); } | 87 SkAlphaType alphaType() const { return fInfo.alphaType(); } |
88 SkColorSpace* colorSpace() const { return fInfo.colorSpace(); } | |
89 SkColorProfileType profileType() const { return fInfo.profileType(); } | 88 SkColorProfileType profileType() const { return fInfo.profileType(); } |
90 | 89 |
91 /** | 90 /** |
92 * Return the number of bytes per pixel based on the colortype. If the colo
rtype is | 91 * Return the number of bytes per pixel based on the colortype. If the colo
rtype is |
93 * kUnknown_SkColorType, then 0 is returned. | 92 * kUnknown_SkColorType, then 0 is returned. |
94 */ | 93 */ |
95 int bytesPerPixel() const { return fInfo.bytesPerPixel(); } | 94 int bytesPerPixel() const { return fInfo.bytesPerPixel(); } |
96 | 95 |
97 /** | 96 /** |
98 * Return the rowbytes expressed as a number of pixels (like width and heig
ht). | 97 * Return the rowbytes expressed as a number of pixels (like width and heig
ht). |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 | 825 |
827 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { | 826 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { |
828 SkASSERT(fPixels); | 827 SkASSERT(fPixels); |
829 SkASSERT(kIndex_8_SkColorType == this->colorType()); | 828 SkASSERT(kIndex_8_SkColorType == this->colorType()); |
830 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); | 829 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); |
831 SkASSERT(fColorTable); | 830 SkASSERT(fColorTable); |
832 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; | 831 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; |
833 } | 832 } |
834 | 833 |
835 #endif | 834 #endif |
OLD | NEW |