Bitmap

Class of android.graphics · Bitmap.java · Android's reference

public final class Bitmap implements android.os.Parcelable

Pixels in host memory, ARGB as ints (unpremultiplied, as getPixel returns them). The renderer uploads a bitmap when a frame draws it and its generation changed. Drawing into it with a Canvas records a display list.

Nested types

Page 1 2

Fields

public static final int DENSITY_NONE = 0 source
public static final android.os.Parcelable.Creator<Bitmap> CREATOR source

Methods

public static int[] takeFreed() source

The IDs of the bitmaps gone since the last call

public int[] takePixels() source

The pixels to upload (all of them), or null when the app set none since the last call

public int id() source

The bitmap's number for the renderer, and its pixels' generation.

public int generation() source
public int[] pixels() source
public DisplayList drawingOrNull() source

What canvases drew into the bitmap since the renderer last took it, or null

public static Bitmap createBitmap(int width, int height, Config config) source
public static Bitmap createBitmap(int width, int height, Config config, boolean hasAlpha) source
public static Bitmap createBitmap(int width, int height, Config config, boolean hasAlpha, ColorSpace colorSpace) source
public static Bitmap createBitmap(android.util.DisplayMetrics display, int width, int height, Config config) source
public static Bitmap createBitmap(android.util.DisplayMetrics display, int width, int height, Config config, boolean hasAlpha, ColorSpace colorSpace) source
public static Bitmap createBitmap(int[] colors, int width, int height, Config config) source
public static Bitmap createBitmap(int[] colors, int offset, int stride, int width, int height, Config config) source
public static Bitmap createBitmap(Bitmap src) source
public static Bitmap createBitmap(Bitmap src, int x, int y, int width, int height) source
public static Bitmap createBitmap(Bitmap src, int x, int y, int width, int height, Matrix m, boolean filter) source

A part of src through a matrix, drawn on the GPU as Android's Skia draws it

public static Bitmap createScaledBitmap(Bitmap src, int dstWidth, int dstHeight, boolean filter) source
public static Bitmap createBitmap(Picture source) source
public static Bitmap createBitmap(Picture source, int width, int height, Config config) source
public int getWidth() source
public int getHeight() source
public int getScaledWidth(int targetDensity) source
public int getScaledHeight(int targetDensity) source
public int getScaledWidth(Canvas canvas) source
public int getScaledHeight(Canvas canvas) source
public int getDensity() source
public void setDensity(int density) source
public final Config getConfig() source
public int getRowBytes() source
public final int getByteCount() source
public final int getAllocationByteCount() source
public final boolean hasAlpha() source
public void setHasAlpha(boolean hasAlpha) source
public final boolean hasMipMap() source
public final void setHasMipMap(boolean hasMipMap) empty body source

Page 1 2


Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.