@Implementation protected int getPixel(int x, int y) { internalCheckPixelAccess(x, y); if (colors != null) { // Note that getPixel() returns a non-premultiplied ARGB value; if // config is RGB_565, our return value will likely be more precise than // on a physical device, since it needs to map each color component from // 5 or 6 bits to 8 bits. return colors[y * getWidth() + x]; } else { return 0; } }
@Implementation protected void setPixel(int x, int y, int color) { if (isRecycled()) { throw new IllegalStateException("Can't call setPixel() on a recycled bitmap"); } else if (!isMutable()) { throw new IllegalStateException("Bitmap is immutable"); } internalCheckPixelAccess(x, y); if (colors == null) { colors = new int[getWidth() * getHeight()]; } colors[y * getWidth() + x] = color; }
@Implementation public int getPixel(int x, int y) { internalCheckPixelAccess(x, y); if (colors != null) { // Note that getPixel() returns a non-premultiplied ARGB value; if // config is RGB_565, our return value will likely be more precise than // on a physical device, since it needs to map each color component from // 5 or 6 bits to 8 bits. return colors[y * getWidth() + x]; } else { return 0; } }
@Implementation protected int getPixel(int x, int y) { internalCheckPixelAccess(x, y); if (colors != null) { // Note that getPixel() returns a non-premultiplied ARGB value; if // config is RGB_565, our return value will likely be more precise than // on a physical device, since it needs to map each color component from // 5 or 6 bits to 8 bits. return colors[y * getWidth() + x]; } else { return 0; } }
@Implementation public int getPixel(int x, int y) { internalCheckPixelAccess(x, y); if (colors != null) { // Note that getPixel() returns a non-premultiplied ARGB value; if // config is RGB_565, our return value will likely be more precise than // on a physical device, since it needs to map each color component from // 5 or 6 bits to 8 bits. return colors[y * getWidth() + x]; } else { return 0; } }
@Implementation public int getPixel(int x, int y) { internalCheckPixelAccess(x, y); if (colors != null) { // Note that getPixel() returns a non-premultiplied ARGB value; if // config is RGB_565, our return value will likely be more precise than // on a physical device, since it needs to map each color component from // 5 or 6 bits to 8 bits. return colors[y * getWidth() + x]; } else { return 0; } }
@Implementation public void setPixel(int x, int y, int color) { if (isRecycled()) { throw new IllegalStateException("Can't call setPixel() on a recycled bitmap"); } else if (!isMutable()) { throw new IllegalStateException("Bitmap is immutable"); } internalCheckPixelAccess(x, y); if (colors == null) { colors = new int[getWidth() * getHeight()]; } colors[y * getWidth() + x] = color; }
@Implementation protected void setPixel(int x, int y, int color) { if (isRecycled()) { throw new IllegalStateException("Can't call setPixel() on a recycled bitmap"); } else if (!isMutable()) { throw new IllegalStateException("Bitmap is immutable"); } internalCheckPixelAccess(x, y); if (colors == null) { colors = new int[getWidth() * getHeight()]; } colors[y * getWidth() + x] = color; }
@Implementation public void setPixel(int x, int y, int color) { if (isRecycled()) { throw new IllegalStateException("Can't call setPixel() on a recycled bitmap"); } else if (!isMutable()) { throw new IllegalStateException("Bitmap is immutable"); } internalCheckPixelAccess(x, y); if (colors == null) { colors = new int[getWidth() * getHeight()]; } colors[y * getWidth() + x] = color; }
@Implementation public void setPixel(int x, int y, int color) { if (isRecycled()) { throw new IllegalStateException("Can't call setPixel() on a recycled bitmap"); } else if (!isMutable()) { throw new IllegalStateException("Bitmap is immutable"); } internalCheckPixelAccess(x, y); if (colors == null) { colors = new int[getWidth() * getHeight()]; } colors[y * getWidth() + x] = color; }