Lines Matching defs:SkBitmap

24 /** \class SkBitmap
25 SkBitmap describes a two-dimensional raster pixel array. SkBitmap is built on
28 SkBitmap points to SkPixelRef, which describes the physical array of pixels.
31 SkBitmap can be drawn using SkCanvas. SkBitmap can be a drawing destination for SkCanvas
32 draw methods. SkBitmap flexibility as a pixel container limits some optimizations
38 Declaring SkBitmap const prevents altering SkImageInfo: the SkBitmap height, width,
40 pixels. Declaring SkBitmap const affects SkBitmap configuration, not its contents.
42 SkBitmap is not thread safe. Each thread must have its own copy of SkBitmap fields,
45 class SK_API SkBitmap {
49 /** Creates an empty SkBitmap without pixels, with kUnknown_SkColorType,
51 set to (0, 0). SkBitmap is not volatile.
54 after SkBitmap has been created.
56 @return empty SkBitmap
58 SkBitmap();
60 /** Copies settings from src to returned SkBitmap. Shares pixels if src has pixels
63 @param src SkBitmap to copy SkImageInfo, and share SkPixelRef
66 SkBitmap(const SkBitmap& src);
68 /** Copies settings from src to returned SkBitmap. Moves ownership of src pixels to
69 SkBitmap.
71 @param src SkBitmap to copy SkImageInfo, and reassign SkPixelRef
74 SkBitmap(SkBitmap&& src);
78 ~SkBitmap();
80 /** Copies settings from src to returned SkBitmap. Shares pixels if src has pixels
83 @param src SkBitmap to copy SkImageInfo, and share SkPixelRef
86 SkBitmap& operator=(const SkBitmap& src);
88 /** Copies settings from src to returned SkBitmap. Moves ownership of src pixels to
89 SkBitmap.
91 @param src SkBitmap to copy SkImageInfo, and reassign SkPixelRef
94 SkBitmap& operator=(SkBitmap&& src);
98 @param other SkBitmap exchanged with original
100 void swap(SkBitmap& other);
102 /** Returns a constant reference to the SkPixmap holding the SkBitmap pixel
105 @return reference to SkPixmap describing this SkBitmap
207 If true, SkBitmap has no effect when drawn or drawn into.
272 Most immutable SkBitmap checks trigger an assert only on debug builds.
278 /** Sets internal flag to mark SkBitmap as immutable. Once set, pixels can not change.
282 Writing to immutable SkBitmap pixels triggers an assert on debug builds.
305 /** Sets if pixels should be read from SkPixelRef on every access. SkBitmap are not
307 accessed repeatedly. Marking temporary SkBitmap as volatile provides a hint to
308 SkBaseDevice that the SkBitmap pixels should not be cached. This can
316 /** Resets to its initial state; all fields are set to zero, as if SkBitmap had
317 been initialized by SkBitmap().
323 its memory if SkBitmap is the sole owner.
341 @param bm SkBitmap to check
344 static bool ComputeIsOpaque(const SkBitmap& bm) {
411 /** \enum SkBitmap::AllocFlags
547 Use to create SkBitmap that matches SkPMColor, the native pixel arrangement on
548 the platform. SkBitmap drawn to output device skips converting its pixel format.
569 Use to create SkBitmap that matches SkPMColor, the native pixel arrangement on
570 the platform. SkBitmap drawn to output device skips converting its pixel format.
615 Caller must ensure that pixels are valid for the lifetime of SkBitmap and SkPixelRef.
634 Caller must ensure that pixmap is valid for the lifetime of SkBitmap and SkPixelRef.
652 of SkBitmap and SkPixelRef.
686 @param allocator instance of SkBitmap::Allocator instantiation
698 @param allocator instance of SkBitmap::Allocator instantiation
713 /** Returns origin of pixels within SkPixelRef. SkBitmap bounds is always contained
714 by SkPixelRef bounds, which may be the same size or larger. Multiple SkBitmap
715 can share the same SkPixelRef, where each SkBitmap has different bounds.
717 The returned origin added to SkBitmap dimensions equals or is smaller than the
726 /** Replaces pixelRef and origin in SkBitmap. dx and dy specify the offset
741 /** Returns true if SkBitmap is can be drawn.
894 /** Shares SkPixelRef with dst. Pixels are not copied; SkBitmap and dst point
908 @param dst SkBitmap set to subset
912 bool extractSubset(SkBitmap* dst, const SkIRect& subset) const;
914 /** Copies SkRect of pixels from SkBitmap pixels to dstPixels. Copy starts at (srcX, srcY),
915 and does not exceed SkBitmap (width(), height()).
924 Pixels are copied only if pixel conversion is possible. If SkBitmap colorType() is
926 If SkBitmap colorType() is kGray_8_SkColorType, dstInfo.colorSpace() must match.
927 If SkBitmap alphaType() is kOpaque_SkAlphaType, dstInfo.alphaType() must
928 match. If SkBitmap colorSpace() is nullptr, dstInfo.colorSpace() must match. Returns
952 /** Copies a SkRect of pixels from SkBitmap to dstPixels. Copy starts at (srcX, srcY),
953 and does not exceed SkBitmap (width(), height()).
962 Pixels are copied only if pixel conversion is possible. If SkBitmap colorType() is
964 If SkBitmap colorType() is kGray_8_SkColorType, dstInfo.colorSpace() must match.
965 If SkBitmap alphaType() is kOpaque_SkAlphaType, dstInfo.alphaType() must
966 match. If SkBitmap colorSpace() is nullptr, dstInfo.colorSpace() must match. Returns
986 /** Copies a SkRect of pixels from SkBitmap to dst. Copy starts at (srcX, srcY), and
987 does not exceed SkBitmap (width(), height()).
996 Pixels are copied only if pixel conversion is possible. If SkBitmap colorType() is
998 If SkBitmap colorType() is kGray_8_SkColorType, dst SkColorSpace must match.
999 If SkBitmap alphaType() is kOpaque_SkAlphaType, dst SkAlphaType must
1000 match. If SkBitmap colorSpace() is nullptr, dst SkColorSpace must match. Returns
1014 /** Copies a SkRect of pixels from SkBitmap to dst. Copy starts at (0, 0), and
1015 does not exceed SkBitmap (width(), height()).
1024 Pixels are copied only if pixel conversion is possible. If SkBitmap colorType() is
1026 If SkBitmap colorType() is kGray_8_SkColorType, dst SkColorSpace must match.
1027 If SkBitmap alphaType() is kOpaque_SkAlphaType, dst SkAlphaType must
1028 match. If SkBitmap colorSpace() is nullptr, dst SkColorSpace must match. Returns
1048 Pixels are copied only if pixel conversion is possible. If SkBitmap colorType() is
1050 If SkBitmap colorType() is kGray_8_SkColorType, src SkColorSpace must match.
1051 If SkBitmap alphaType() is kOpaque_SkAlphaType, src SkAlphaType must
1052 match. If SkBitmap colorSpace() is nullptr, src SkColorSpace must match. Returns
1062 @return true if src pixels are copied to SkBitmap
1078 Pixels are copied only if pixel conversion is possible. If SkBitmap colorType() is
1080 If SkBitmap colorType() is kGray_8_SkColorType, src SkColorSpace must match.
1081 If SkBitmap alphaType() is kOpaque_SkAlphaType, src SkAlphaType must
1082 match. If SkBitmap colorSpace() is nullptr, src SkColorSpace must match. Returns
1086 @return true if src pixels are copied to SkBitmap
1102 Pixels are copied only if pixel conversion is possible. If SkBitmap colorType() is
1104 If SkBitmap colorType() is kGray_8_SkColorType, src SkColorSpace must match.
1105 If SkBitmap alphaType() is kOpaque_SkAlphaType, src SkAlphaType must
1106 match. If SkBitmap colorSpace() is nullptr, src SkColorSpace must match. Returns
1120 @return true if src pixels are copied to SkBitmap
1154 bool extractAlpha(SkBitmap* dst) const {
1162 generates mask alpha from SkBitmap. Uses HeapAllocator to reserve memory for dst
1163 SkPixelRef. Sets offset to top-left position for dst for alignment with SkBitmap;
1171 bool extractAlpha(SkBitmap* dst, const SkPaint* paint,
1180 generates mask alpha from SkBitmap. allocator may reference a custom allocation
1182 position for dst for alignment with SkBitmap; (0, 0) unless SkMaskFilter generates
1191 bool extractAlpha(SkBitmap* dst, const SkPaint* paint, Allocator* allocator,
1194 /** Copies SkBitmap pixel address, row bytes, and SkImageInfo to pixmap, if address
1198 pixmap contents become invalid on any future change to SkBitmap.
1201 @return true if SkBitmap has direct access to pixels
1210 /** \class SkBitmap::Allocator
1220 @param bitmap SkBitmap containing SkImageInfo as input, and SkPixelRef as output
1223 virtual bool allocPixelRef(SkBitmap* bitmap) = 0;
1228 /** \class SkBitmap::HeapAllocator
1229 Subclass of SkBitmap::Allocator that returns a SkPixelRef that allocates its pixel
1230 memory from the heap. This is the default SkBitmap::Allocator invoked by
1240 @param bitmap SkBitmap containing SkImageInfo as input, and SkPixelRef as output
1243 bool allocPixelRef(SkBitmap* bitmap) override;
1247 Creates string representation of SkBitmap. The representation is read by
1276 inline uint32_t* SkBitmap::getAddr32(int x, int y) const {
1281 inline uint16_t* SkBitmap::getAddr16(int x, int y) const {
1286 inline uint8_t* SkBitmap::getAddr8(int x, int y) const {