Lines Matching refs:SkBitmap

20 class SkBitmap;
29 /** \class SkBitmap
30 SkBitmap describes a two-dimensional raster pixel array. SkBitmap is built on
33 SkBitmap points to SkPixelRef, which describes the physical array of pixels.
36 SkBitmap can be drawn using SkCanvas. SkBitmap can be a drawing destination for SkCanvas
37 draw member functions. SkBitmap flexibility as a pixel container limits some
43 Declaring SkBitmap const prevents altering SkImageInfo: the SkBitmap height, width,
45 pixels. Declaring SkBitmap const affects SkBitmap configuration, not its contents.
47 SkBitmap is not thread safe. Each thread must have its own copy of SkBitmap fields,
50 class SK_API SkBitmap {
54 /** Creates an empty SkBitmap without pixels, with kUnknown_SkColorType,
59 after SkBitmap has been created.
61 @return empty SkBitmap
65 SkBitmap();
67 /** Copies settings from src to returned SkBitmap. Shares pixels if src has pixels
70 @param src SkBitmap to copy SkImageInfo, and share SkPixelRef
75 SkBitmap(const SkBitmap& src);
77 /** Copies settings from src to returned SkBitmap. Moves ownership of src pixels to
78 SkBitmap.
80 @param src SkBitmap to copy SkImageInfo, and reassign SkPixelRef
85 SkBitmap(SkBitmap&& src);
89 ~SkBitmap();
91 /** Copies settings from src to returned SkBitmap. Shares pixels if src has pixels
94 @param src SkBitmap to copy SkImageInfo, and share SkPixelRef
99 SkBitmap& operator=(const SkBitmap& src);
101 /** Copies settings from src to returned SkBitmap. Moves ownership of src pixels to
102 SkBitmap.
104 @param src SkBitmap to copy SkImageInfo, and reassign SkPixelRef
109 SkBitmap& operator=(SkBitmap&& src);
113 @param other SkBitmap exchanged with original
117 void swap(SkBitmap& other);
119 /** Returns a constant reference to the SkPixmap holding the SkBitmap pixel
122 @return reference to SkPixmap describing this SkBitmap
213 If true, SkBitmap has no effect when drawn or drawn into.
278 Most immutable SkBitmap checks trigger an assert only on debug builds.
286 /** Sets internal flag to mark SkBitmap as immutable. Once set, pixels can not change.
290 Writing to immutable SkBitmap pixels triggers an assert on debug builds.
309 /** Resets to its initial state; all fields are set to zero, as if SkBitmap had
310 been initialized by SkBitmap().
316 its memory if SkBitmap is the sole owner.
336 @param bm SkBitmap to check
339 static bool ComputeIsOpaque(const SkBitmap& bm) {
412 /** \enum SkBitmap::AllocFlags
539 Use to create SkBitmap that matches SkPMColor, the native pixel arrangement on
540 the platform. SkBitmap drawn to output device skips converting its pixel format.
557 Use to create SkBitmap that matches SkPMColor, the native pixel arrangement on
558 the platform. SkBitmap drawn to output device skips converting its pixel format.
601 Caller must ensure that pixels are valid for the lifetime of SkBitmap and SkPixelRef.
620 Caller must ensure that pixmap is valid for the lifetime of SkBitmap and SkPixelRef.
640 of SkBitmap and SkPixelRef.
676 @param allocator instance of SkBitmap::Allocator instantiation
688 @param allocator instance of SkBitmap::Allocator instantiation
703 /** Returns origin of pixels within SkPixelRef. SkBitmap bounds is always contained
704 by SkPixelRef bounds, which may be the same size or larger. Multiple SkBitmap
705 can share the same SkPixelRef, where each SkBitmap has different bounds.
707 The returned origin added to SkBitmap dimensions equals or is smaller than the
718 /** Replaces pixelRef and origin in SkBitmap. dx and dy specify the offset
735 /** Returns true if SkBitmap is can be drawn.
899 /** Shares SkPixelRef with dst. Pixels are not copied; SkBitmap and dst point
912 @param dst SkBitmap set to subset
918 bool extractSubset(SkBitmap* dst, const SkIRect& subset) const;
920 /** Copies a SkRect of pixels from SkBitmap to dstPixels. Copy starts at (srcX, srcY),
921 and does not exceed SkBitmap (width(), height()).
930 Pixels are copied only if pixel conversion is possible. If SkBitmap colorType() is
932 If SkBitmap colorType() is kGray_8_SkColorType, dstInfo.colorSpace() must match.
933 If SkBitmap alphaType() is kOpaque_SkAlphaType, dstInfo.alphaType() must
934 match. If SkBitmap colorSpace() is nullptr, dstInfo.colorSpace() must match. Returns
951 /** Copies a SkRect of pixels from SkBitmap to dst. Copy starts at (srcX, srcY), and
952 does not exceed SkBitmap (width(), height()).
961 Pixels are copied only if pixel conversion is possible. If SkBitmap colorType() is
963 If SkBitmap colorType() is kGray_8_SkColorType, dst SkColorSpace must match.
964 If SkBitmap alphaType() is kOpaque_SkAlphaType, dst SkAlphaType must
965 match. If SkBitmap colorSpace() is nullptr, dst SkColorSpace must match. Returns
981 /** Copies a SkRect of pixels from SkBitmap to dst. Copy starts at (0, 0), and
982 does not exceed SkBitmap (width(), height()).
991 Pixels are copied only if pixel conversion is possible. If SkBitmap colorType() is
993 If SkBitmap colorType() is kGray_8_SkColorType, dst SkColorSpace must match.
994 If SkBitmap alphaType() is kOpaque_SkAlphaType, dst SkAlphaType must
995 match. If SkBitmap colorSpace() is nullptr, dst SkColorSpace must match. Returns
1015 Pixels are copied only if pixel conversion is possible. If SkBitmap colorType() is
1017 If SkBitmap colorType() is kGray_8_SkColorType, src SkColorSpace must match.
1018 If SkBitmap alphaType() is kOpaque_SkAlphaType, src SkAlphaType must
1019 match. If SkBitmap colorSpace() is nullptr, src SkColorSpace must match. Returns
1029 @return true if src pixels are copied to SkBitmap
1045 Pixels are copied only if pixel conversion is possible. If SkBitmap colorType() is
1047 If SkBitmap colorType() is kGray_8_SkColorType, src SkColorSpace must match.
1048 If SkBitmap alphaType() is kOpaque_SkAlphaType, src SkAlphaType must
1049 match. If SkBitmap colorSpace() is nullptr, src SkColorSpace must match. Returns
1053 @return true if src pixels are copied to SkBitmap
1067 bool extractAlpha(SkBitmap* dst) const {
1075 generates mask alpha from SkBitmap. Uses HeapAllocator to reserve memory for dst
1076 SkPixelRef. Sets offset to top-left position for dst for alignment with SkBitmap;
1084 bool extractAlpha(SkBitmap* dst, const SkPaint* paint,
1093 generates mask alpha from SkBitmap. allocator may reference a custom allocation
1095 position for dst for alignment with SkBitmap; (0, 0) unless SkMaskFilter generates
1104 bool extractAlpha(SkBitmap* dst, const SkPaint* paint, Allocator* allocator,
1107 /** Copies SkBitmap pixel address, row bytes, and SkImageInfo to pixmap, if address
1111 pixmap contents become invalid on any future change to SkBitmap.
1114 @return true if SkBitmap has direct access to pixels
1148 /** \class SkBitmap::Allocator
1158 @param bitmap SkBitmap containing SkImageInfo as input, and SkPixelRef as output
1161 virtual bool allocPixelRef(SkBitmap* bitmap) = 0;
1166 /** \class SkBitmap::HeapAllocator
1167 Subclass of SkBitmap::Allocator that returns a SkPixelRef that allocates its pixel
1168 memory from the heap. This is the default SkBitmap::Allocator invoked by
1178 @param bitmap SkBitmap containing SkImageInfo as input, and SkPixelRef as output
1183 bool allocPixelRef(SkBitmap* bitmap) override;
1197 inline uint32_t* SkBitmap::getAddr32(int x, int y) const {
1202 inline uint16_t* SkBitmap::getAddr16(int x, int y) const {
1207 inline uint8_t* SkBitmap::getAddr8(int x, int y) const {