/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkBitmap_DEFINED #define SkBitmap_DEFINED #include "include/core/SkAlphaType.h" #include "include/core/SkColor.h" #include "include/core/SkImageInfo.h" #include "include/core/SkPixmap.h" #include "include/core/SkPoint.h" #include "include/core/SkRect.h" #include "include/core/SkRefCnt.h" #include "include/core/SkSamplingOptions.h" #include "include/core/SkSize.h" #include "include/core/SkTypes.h" #include "include/private/base/SkCPUTypes.h" #include "include/private/base/SkDebug.h" #include <cstddef> #include <cstdint> class SkColorSpace; class SkImage; class SkMatrix; class SkMipmap; class SkPaint; class SkPixelRef; class SkShader; enum SkColorType : int; enum class SkTileMode; struct SkMaskBuilder; /** \class SkBitmap SkBitmap describes a two-dimensional raster pixel array. SkBitmap is built on SkImageInfo, containing integer width and height, SkColorType and SkAlphaType describing the pixel format, and SkColorSpace describing the range of colors. SkBitmap points to SkPixelRef, which describes the physical array of pixels. SkImageInfo bounds may be located anywhere fully inside SkPixelRef bounds. SkBitmap can be drawn using SkCanvas. SkBitmap can be a drawing destination for SkCanvas draw member functions. SkBitmap flexibility as a pixel container limits some optimizations available to the target platform. If pixel array is primarily read-only, use SkImage for better performance. If pixel array is primarily written to, use SkSurface for better performance. Declaring SkBitmap const prevents altering SkImageInfo: the SkBitmap height, width, and so on cannot change. It does not affect SkPixelRef: a caller may write its pixels. Declaring SkBitmap const affects SkBitmap configuration, not its contents. SkBitmap is not thread safe. Each thread must have its own copy of SkBitmap fields, although threads may share the underlying pixel array. */ class SK_API SkBitmap { … }; /////////////////////////////////////////////////////////////////////////////// inline uint32_t* SkBitmap::getAddr32(int x, int y) const { … } inline uint16_t* SkBitmap::getAddr16(int x, int y) const { … } inline uint8_t* SkBitmap::getAddr8(int x, int y) const { … } #endif