8#ifndef SkBitmap_DEFINED
9#define SkBitmap_DEFINED
149 int width()
const {
return fPixmap.width(); }
158 int height()
const {
return fPixmap.height(); }
210 bool empty()
const {
return fPixmap.info().isEmpty(); }
219 bool isNull()
const {
return nullptr == fPixelRef; }
227 return this->
empty() || this->isNull();
238 size_t rowBytes()
const {
return fPixmap.rowBytes(); }
283 void*
getPixels()
const {
return fPixmap.writable_addr(); }
303 bool isImmutable()
const;
395 SkIPoint origin = this->pixelRefOrigin();
429 bool setInfo(
const SkImageInfo& imageInfo,
size_t rowBytes = 0);
435 kZeroPixels_AllocFlag = 1 << 0,
491 [[nodiscard]]
bool tryAllocPixels(
const SkImageInfo&
info,
size_t rowBytes);
528 return this->tryAllocPixels(
info,
info.minRowBytes());
566 [[nodiscard]]
bool tryAllocN32Pixels(
int width,
int height,
bool isOpaque =
false);
585 void allocN32Pixels(
int width,
int height,
bool isOpaque =
false);
609 bool installPixels(
const SkImageInfo&
info,
void* pixels,
size_t rowBytes,
628 return this->installPixels(
info, pixels, rowBytes,
nullptr,
nullptr);
646 bool installPixels(
const SkPixmap& pixmap);
665 void setPixels(
void* pixels);
675 return this->tryAllocPixels((
Allocator*)
nullptr);
698 [[nodiscard]]
bool tryAllocPixels(
Allocator* allocator);
759 return this->getPixels() !=
nullptr;
772 uint32_t getGenerationID()
const;
779 void notifyPixelsChanged()
const;
804 void eraseColor(
SkColor c)
const;
855 this->
erase(c, area);
875 return this->pixmap().getColor(
x,
y);
904 return this->pixmap().getAlphaf(
x,
y);
922 void* getAddr(
int x,
int y)
const;
936 inline uint32_t* getAddr32(
int x,
int y)
const;
950 inline uint16_t* getAddr16(
int x,
int y)
const;
964 inline uint8_t* getAddr8(
int x,
int y)
const;
1015 bool readPixels(
const SkImageInfo& dstInfo,
void* dstPixels,
size_t dstRowBytes,
1016 int srcX,
int srcY)
const;
1046 bool readPixels(
const SkPixmap&
dst,
int srcX,
int srcY)
const;
1069 return this->readPixels(
dst, 0, 0);
1100 bool writePixels(
const SkPixmap&
src,
int dstX,
int dstY);
1123 return this->writePixels(
src, 0, 0);
1135 return this->extractAlpha(
dst,
nullptr,
nullptr,
nullptr);
1185 bool peekPixels(
SkPixmap* pixmap)
const;
1191 const SkMatrix* localMatrix =
nullptr)
const;
1197 const SkMatrix* lm =
nullptr)
const;
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static void erase(SkSurface *surface)
static bool SkAlphaTypeIsOpaque(SkAlphaType at)
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
static void releaseProc(const void *ptr, void *context)
#define INHERITED(method,...)
void swap(sk_sp< T > &a, sk_sp< T > &b)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
bool extractAlpha(SkBitmap *dst) const
void eraseARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) const
int shiftPerPixel() const
SkPixelRef * pixelRef() const
SkAlphaType alphaType() const
bool writePixels(const SkPixmap &src)
bool installPixels(const SkImageInfo &info, void *pixels, size_t rowBytes)
SkISize dimensions() const
void eraseArea(const SkIRect &area, SkColor c) const
SkColor getColor(int x, int y) const
size_t computeByteSize() const
uint8_t * getAddr8(int x, int y) const
const SkPixmap & pixmap() const
SkColor4f getColor4f(int x, int y) const
bool extractAlpha(SkBitmap *dst, const SkPaint *paint, SkIPoint *offset) const
SkColorType colorType() const
bool drawsNothing() const
SkIRect getSubset() const
const SkImageInfo & info() const
bool readPixels(const SkPixmap &dst) const
int bytesPerPixel() const
float getAlphaf(int x, int y) const
bool tryAllocPixels(const SkImageInfo &info)
static bool ComputeIsOpaque(const SkBitmap &bm)
uint32_t * getAddr32(int x, int y) const
int rowBytesAsPixels() const
uint16_t * getAddr16(int x, int y) const
uint16_t * writable_addr16(int x, int y) const
bool computeIsOpaque() const
uint32_t * writable_addr32(int x, int y) const
const void * addr() const
uint8_t * writable_addr8(int x, int y) const
EMSCRIPTEN_KEEPALIVE void empty()
FlutterSemanticsFlag flags
Optional< SkRect > bounds
SkSamplingOptions sampling
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
constexpr int32_t y() const
constexpr int32_t x() const
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)