SkBitmap bitmap; // ...set up the bitmap... uint8_t* pixels = bitmap.getAddr8(0, 0); // Access the first pixel's red component uint8_t red = pixels[0];
SkBitmap bitmap; // ...set up the bitmap... int rowBytes = bitmap.rowBytes(); uint8_t* rowStart = bitmap.getAddr8(0, 0); for (int y = 0; y < bitmap.height(); ++y) { uint8_t* rowPixels = rowStart; // ...process the row... rowStart += rowBytes; }This example retrieves a pointer to the first row of pixel data using getAddr8(), then iterates over each row of the bitmap and processes its pixels. Note that the row stride (in bytes) can be accessed using the rowBytes() method. The SkBitmap class is part of the Skia Graphics Library, which is typically distributed as part of the Android Open Source Project (AOSP) and can also be downloaded separately as a package library.