Home
last modified time | relevance | path

Searched refs:bitmap (Results 1 – 25 of 171) sorted by relevance

1234567

/cts/tests/tests/view/src/android/view/cts/
DPixelCopyTest.java204 Bitmap bitmap = Bitmap.createBitmap(100, 100, Config.ARGB_8888); in testGlProducerFullsize() local
205 int result = mCopyHelper.request(activity.getView(), bitmap); in testGlProducerFullsize()
207 assertEquals(100, bitmap.getWidth()); in testGlProducerFullsize()
208 assertEquals(100, bitmap.getHeight()); in testGlProducerFullsize()
209 assertEquals(Config.ARGB_8888, bitmap.getConfig()); in testGlProducerFullsize()
210 assertBitmapQuadColor(bitmap, in testGlProducerFullsize()
217 Bitmap bitmap = Bitmap.createBitmap(100, 100, Config.ARGB_8888); in testGlProducerCropTopLeft() local
218 int result = mCopyHelper.request(activity.getView(), new Rect(0, 0, 50, 50), bitmap); in testGlProducerCropTopLeft()
220 assertBitmapQuadColor(bitmap, in testGlProducerCropTopLeft()
227 Bitmap bitmap = Bitmap.createBitmap(100, 100, Config.ARGB_8888); in testGlProducerCropCenter() local
[all …]
/cts/tests/tests/graphics/src/android/graphics/cts/
DBitmapTest.java225 Bitmap bitmap = Bitmap.createBitmap(1, 1, Config.ALPHA_8); in testCompressAlpha8Fails() local
227 bitmap.compress(format, 50, new ByteArrayOutputStream())); in testCompressAlpha8Fails()
238 nCompress(bitmap, nativeCompressFormat(format), 50, stream, storage)); in testCompressAlpha8Fails()
250 Bitmap bitmap = mBitmap.copy(Config.ARGB_8888, false); in testCopy() local
251 WidgetTestUtils.assertEquals(mBitmap, bitmap); in testCopy()
318 Bitmap bitmap = Bitmap.createBitmap(mBitmap.getWidth(), mBitmap.getHeight(), in testCopyPixelsToBuffer() local
321 bitmap.copyPixelsFromBuffer(intBuf1); in testCopyPixelsToBuffer()
323 bitmap.copyPixelsToBuffer(intBuf2); in testCopyPixelsToBuffer()
338 Bitmap bitmap = Bitmap.createBitmap(colors, 10, 10, Config.RGB_565); in testCreateBitmap1() local
339 assertFalse(bitmap.isMutable()); in testCreateBitmap1()
[all …]
DVulkanPreTransformTest.java168 Bitmap bitmap = takeScreenshot(width, height); in validatePixelValuesAfterRotation() local
172 diff += pixelDiff(bitmap.getPixel(0, 0), 255, 0, 0); in validatePixelValuesAfterRotation()
173 diff += pixelDiff(bitmap.getPixel(width - 1, 0), 0, 255, 0); in validatePixelValuesAfterRotation()
174 diff += pixelDiff(bitmap.getPixel(0, height - 1), 0, 0, 255); in validatePixelValuesAfterRotation()
175 diff += pixelDiff(bitmap.getPixel(width - 1, height - 1), 255, 255, 0); in validatePixelValuesAfterRotation()
177 diff += pixelDiff(bitmap.getPixel(0, 0), 0, 255, 0); in validatePixelValuesAfterRotation()
178 diff += pixelDiff(bitmap.getPixel(width - 1, 0), 255, 255, 0); in validatePixelValuesAfterRotation()
179 diff += pixelDiff(bitmap.getPixel(0, height - 1), 255, 0, 0); in validatePixelValuesAfterRotation()
180 diff += pixelDiff(bitmap.getPixel(width - 1, height - 1), 0, 0, 255); in validatePixelValuesAfterRotation()
182 diff += pixelDiff(bitmap.getPixel(0, 0), 255, 255, 0); in validatePixelValuesAfterRotation()
[all …]
DBitmapShaderTest.java76 private void verifyTile(Bitmap bitmap, int tileX, int tileY) { in verifyTile() argument
81 verifyColor(BORDER_COLOR, bitmap, x + tileX, y + tileY); in verifyTile()
83 verifyColor(CENTER_COLOR, bitmap, x + tileX, y + tileY); in verifyTile()
94 private void verifyColor(int color, Bitmap bitmap, int x, int y) { in verifyColor() argument
95 if (x < bitmap.getWidth() && y < bitmap.getHeight()) { in verifyColor()
96 assertEquals(color, bitmap.getPixel(x, y)); in verifyColor()
102 Bitmap bitmap = Bitmap.createBitmap(2, 1, Config.ARGB_8888); in testClamp() local
103 bitmap.setPixel(0, 0, Color.RED); in testClamp()
104 bitmap.setPixel(1, 0, Color.BLUE); in testClamp()
106 BitmapShader shader = new BitmapShader(bitmap, in testClamp()
[all …]
DMediaVulkanGpuTest.java39 Bitmap bitmap = BitmapFactory.decodeStream(assets.open("test_video_frame.png")); in getFramePixels() local
40 int[] framePixels = new int[bitmap.getWidth() * bitmap.getHeight()]; in getFramePixels()
41 bitmap.getPixels(framePixels, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), in getFramePixels()
42 bitmap.getHeight()); in getFramePixels()
DEmbossMaskFilterTest.java62 Bitmap bitmap = Bitmap.createBitmap(BITMAP_WIDTH, BITMAP_HEIGHT, Config.ARGB_8888); in testEmbossMaskFilter() local
63 bitmap.eraseColor(Color.BLACK); in testEmbossMaskFilter()
65 Canvas c = new Canvas(bitmap); in testEmbossMaskFilter()
73 assertTrue(brightness(bitmap, top) > brightness(bitmap, bottom)); in testEmbossMaskFilter()
74 assertTrue(brightness(bitmap, left) > brightness(bitmap, right)); in testEmbossMaskFilter()
78 assertEquals(0, brightness(bitmap, top)); in testEmbossMaskFilter()
80 assertEquals(0, brightness(bitmap, bottom)); in testEmbossMaskFilter()
82 assertEquals(0, brightness(bitmap, left)); in testEmbossMaskFilter()
84 assertEquals(0, brightness(bitmap, right)); in testEmbossMaskFilter()
DPictureTest.java65 Bitmap bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Bitmap.Config.ARGB_8888); in testSaveRestoreBalance() local
66 Canvas drawDest = new Canvas(bitmap); in testSaveRestoreBalance()
82 Bitmap bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Bitmap.Config.ARGB_8888); in verifyBalance() local
83 Canvas canvas = new Canvas(bitmap); in verifyBalance()
113 Bitmap bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Bitmap.Config.ARGB_8888); in testPicture() local
114 canvas = new Canvas(bitmap); in testPicture()
117 verifyBitmap(bitmap); in testPicture()
120 bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Bitmap.Config.ARGB_8888); in testPicture()
121 canvas = new Canvas(bitmap); in testPicture()
124 verifyBitmap(bitmap); in testPicture()
[all …]
DComposeShaderTest.java56 Bitmap bitmap = Bitmap.createBitmap(SIZE, SIZE, Config.ARGB_8888); in testPorterDuff() local
57 Canvas canvas = new Canvas(bitmap); in testPorterDuff()
67 int pixel = bitmap.getPixel(x, y); in testPorterDuff()
89 Bitmap bitmap = Bitmap.createBitmap(SIZE, SIZE, Config.ARGB_8888); in testBlendMode() local
90 Canvas canvas = new Canvas(bitmap); in testBlendMode()
100 int pixel = bitmap.getPixel(x, y); in testBlendMode()
128 Bitmap bitmap = Bitmap.createBitmap(1, 1, Config.ARGB_8888); in testXfermode() local
129 Canvas canvas = new Canvas(bitmap); in testXfermode()
135 assertEquals(Color.WHITE, bitmap.getPixel(0, 0)); in testXfermode()
157 Bitmap bitmap = Bitmap.createBitmap(10, 10, Config.ARGB_8888); in testChildLocalMatrix() local
[all …]
DColorMatrixColorFilterTest.java53 Bitmap bitmap = Bitmap.createBitmap(1, 1, Config.ARGB_8888); in testColorMatrixColorFilter() local
54 Canvas canvas = new Canvas(bitmap); in testColorMatrixColorFilter()
60 ColorUtils.verifyColor(Color.CYAN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
63 ColorUtils.verifyColor(Color.GREEN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
66 ColorUtils.verifyColor(Color.RED, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
70 ColorUtils.verifyColor(Color.WHITE, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
81 bitmap.eraseColor(Color.TRANSPARENT); in testColorMatrixColorFilter()
86 ColorUtils.verifyColor(Color.argb(128, 255, 0, 64), bitmap.getPixel(0, 0), 2); in testColorMatrixColorFilter()
90 ColorUtils.verifyColor(Color.CYAN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
97 ColorUtils.verifyColor(Color.CYAN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
[all …]
DLightingColorFilterTest.java45 Bitmap bitmap = Bitmap.createBitmap(1, 1, Config.ARGB_8888); in testLightingColorFilter() local
46 Canvas canvas = new Canvas(bitmap); in testLightingColorFilter()
53 verifyColor(Color.MAGENTA, bitmap.getPixel(0, 0)); in testLightingColorFilter()
58 verifyColor(Color.BLUE, bitmap.getPixel(0, 0)); in testLightingColorFilter()
63 verifyColor(Color.CYAN, bitmap.getPixel(0, 0)); in testLightingColorFilter()
66 bitmap.eraseColor(Color.TRANSPARENT); in testLightingColorFilter()
70 verifyColor(Color.GREEN, bitmap.getPixel(0, 0)); in testLightingColorFilter()
76 verifyColor(Color.MAGENTA, bitmap.getPixel(0, 0)); in testLightingColorFilter()
83 verifyColor(Color.argb(255, 30, 30, 30), bitmap.getPixel(0, 0)); in testLightingColorFilter()
86 bitmap.eraseColor(Color.TRANSPARENT); in testLightingColorFilter()
[all …]
DNinePatchTest.java107 Bitmap bitmap = Bitmap.createBitmap(COLOR, 10, 10, Bitmap.Config.ARGB_4444); in testIsNinePatchChunk() local
108 assertFalse(NinePatch.isNinePatchChunk(bitmap.getNinePatchChunk())); in testIsNinePatchChunk()
116 Bitmap bitmap = Bitmap.createBitmap(expected.getWidth(), expected.getHeight(), in testDraw() local
118 Canvas c = new Canvas(bitmap); in testDraw()
121 verifyBitmapWithAlpha(expected, bitmap, ALPHA_OPAQUE); in testDraw()
124 bitmap = Bitmap.createBitmap(expected.getWidth(), expected.getHeight(), in testDraw()
126 c = new Canvas(bitmap); in testDraw()
129 verifyBitmapWithAlpha(expected, bitmap, ALPHA_OPAQUE); in testDraw()
131 bitmap = Bitmap.createBitmap(expected.getWidth(), expected.getHeight(), in testDraw()
133 c = new Canvas(bitmap); in testDraw()
[all …]
/cts/tests/tests/uirendering/src/android/uirendering/cts/bitmapverifiers/
DGoldenImageVerifier.java43 public boolean verify(Bitmap bitmap) { in verify() argument
45 if (bitmap.getWidth() > mWidth || bitmap.getHeight() > mHeight) { in verify()
46 bitmap = Bitmap.createBitmap(bitmap, 0, 0, mWidth, mHeight); in verify()
48 return super.verify(bitmap); in verify()
52 public boolean verify(int[] bitmap, int offset, int stride, int width, int height) { in verify() argument
53 boolean success = mBitmapComparer.verifySame(mGoldenBitmapArray, bitmap, offset, stride, in verify()
57 int[] differences = new PassFailVisualizer().getDifferences(mGoldenBitmapArray, bitmap); in verify()
DBitmapVerifier.java30 public boolean verify(Bitmap bitmap) { in verify() argument
31 int width = bitmap.getWidth(); in verify()
32 int height = bitmap.getHeight(); in verify()
34 bitmap.getPixels(pixels, 0, width, 0, 0, width, height); in verify()
41 public abstract boolean verify(int[] bitmap, int offset, int stride, int width, int height); in verify() argument
/cts/tests/tests/view/src/android/view/cts/util/
DBitmapDumper.java101 public static void dumpBitmap(Bitmap bitmap, String testName, String className) { in dumpBitmap() argument
102 if (bitmap == null) { in dumpBitmap()
108 saveBitmap(bitmap, capture); in dumpBitmap()
115 private static void logIfBitmapSolidColor(String fileName, Bitmap bitmap) { in logIfBitmapSolidColor() argument
116 int firstColor = bitmap.getPixel(0, 0); in logIfBitmapSolidColor()
117 for (int x = 0; x < bitmap.getWidth(); x++) { in logIfBitmapSolidColor()
118 for (int y = 0; y < bitmap.getHeight(); y++) { in logIfBitmapSolidColor()
119 if (bitmap.getPixel(x, y) != firstColor) { in logIfBitmapSolidColor()
128 private static void saveBitmap(Bitmap bitmap, File file) { in saveBitmap() argument
129 if (bitmap == null) { in saveBitmap()
[all …]
/cts/tests/tests/uirendering/src/android/uirendering/cts/testclasses/
DRgba16fTests.java49 Bitmap bitmap = BitmapFactory.decodeStream(in); in testTransferFunctions()
51 width / (float) bitmap.getWidth(), in testTransferFunctions()
52 height / (float) bitmap.getHeight()); in testTransferFunctions()
53 canvas.drawBitmap(bitmap, 0, 0, null); in testTransferFunctions()
70 Bitmap bitmap = BitmapFactory.decodeStream(in); in testAlpha()
72 width / (float) bitmap.getWidth(), in testAlpha()
73 height / (float) bitmap.getHeight()); in testAlpha()
77 canvas.drawBitmap(bitmap, 0, 0, p); in testAlpha()
94 Bitmap bitmap = BitmapFactory.decodeStream(in); in testMasked()
104 p.setShader(new BitmapShader(bitmap, in testMasked()
[all …]
DNinePatchTests.kt52 val bitmap = ImageDecoder.decodeBitmap(this) in <lambda>() constant
53 NinePatch(bitmap, bitmap.ninePatchChunk) in <lambda>()
64 np.bitmap.recycle() in <lambda>()
70 val bitmap = ImageDecoder.decodeBitmap(this) { in <lambda>() constant
74 NinePatch(bitmap, bitmap.ninePatchChunk) in <lambda>()
90 for (bitmap in arrayOf(filtered, unfiltered, noPaint, np.bitmap)) { in <lambda>() constant
91 bitmap.recycle() in <lambda>()
DColorSpaceTests.java81 Bitmap bitmap = loadAsset("green-p3.png", RGB_565); in testDrawDisplayP3Config565() local
83 .addCanvasClient("Draw_DisplayP3_565", (c, w, h) -> drawAsset(c, bitmap), true) in testDrawDisplayP3Config565()
113 Bitmap bitmap = loadAsset("orange-prophotorgb.png", RGB_565); in testDrawProPhotoRGBConfig565() local
116 (c, w, h) -> drawAsset(c, bitmap), true) in testDrawProPhotoRGBConfig565()
141 private void drawAsset(@NonNull Canvas canvas, Bitmap bitmap) { in drawAsset() argument
145 canvas.drawBitmap(bitmap, 0, 0, null); in drawAsset()
150 p.setShader(new BitmapShader(bitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT)); in drawAsset()
165 canvas.drawBitmap(bitmap, 0, 0, p); in drawAsset()
171 Bitmap bitmap; in loadAsset() local
177 bitmap = BitmapFactory.decodeStream(in, null, opts); in loadAsset()
[all …]
/cts/tests/tests/media/src/android/media/cts/
DCodecUtils.java159 public static int readBinaryCounterFromBitmap(Bitmap bitmap) { in readBinaryCounterFromBitmap() argument
160 int numDigits = bitmap.getWidth() / 16; in readBinaryCounterFromBitmap()
163 int rgb = bitmap.getPixel(i * 16 + 8, 8); in readBinaryCounterFromBitmap()
179 public static boolean VerifyFrameRotationFromBitmap(Bitmap bitmap, int targetRotation) { in VerifyFrameRotationFromBitmap() argument
181 if (bitmap.getWidth() != 320 || bitmap.getHeight() != 240) { in VerifyFrameRotationFromBitmap()
184 Color left_top = Color.valueOf(bitmap.getPixel(10, 10)); in VerifyFrameRotationFromBitmap()
185 Color right_top = Color.valueOf(bitmap.getPixel(310, 10)); in VerifyFrameRotationFromBitmap()
186 Color left_bottom = Color.valueOf(bitmap.getPixel(10, 230)); in VerifyFrameRotationFromBitmap()
187 Color right_bottom = Color.valueOf(bitmap.getPixel(310, 230)); in VerifyFrameRotationFromBitmap()
200 if (bitmap.getWidth() != 240 || bitmap.getHeight() != 320) { in VerifyFrameRotationFromBitmap()
[all …]
/cts/tests/tests/renderscript/src/android/renderscript/cts/refocus/
DRGBZ.java42 private Bitmap bitmap; field in RGBZ
61 bitmap = setAlphaChannel(preview, depthBitmap); in RGBZ()
80 bitmap = setAlphaChannel(preview, depthBitmap); in RGBZ()
95 return bitmap; in getBitmap()
121 return bitmap.getWidth(); in getWidth()
128 return bitmap.getHeight(); in getHeight()
150 public Bitmap setAlphaChannel(Bitmap bitmap, Bitmap depthBitmap) { in setAlphaChannel() argument
151 if (bitmap == null) { in setAlphaChannel()
152 return bitmap; in setAlphaChannel()
154 Bitmap result = bitmap.copy(Bitmap.Config.ARGB_8888, true); in setAlphaChannel()
[all …]
/cts/tests/tests/systemui/src/android/systemui/cts/
DLightBarTests.java98 Bitmap bitmap = takeStatusBarScreenshot(mActivityRule.getActivity()); in testLightStatusBarIcons() local
99 Stats s = evaluateLightBarBitmap(bitmap, LIGHT_BG_COLOR, 0); in testLightStatusBarIcons()
100 assertStats(bitmap, s, true /* light */); in testLightStatusBarIcons()
125 Bitmap bitmap = takeStatusBarScreenshot(mActivityRule.getActivity()); in testAppearanceCanOverwriteLegacyFlags() local
126 Stats s = evaluateDarkBarBitmap(bitmap, LIGHT_BG_COLOR, 0); in testAppearanceCanOverwriteLegacyFlags()
127 assertStats(bitmap, s, false /* light */); in testAppearanceCanOverwriteLegacyFlags()
152 Bitmap bitmap = takeStatusBarScreenshot(mActivityRule.getActivity()); in testLegacyFlagsCannotOverwriteAppearance() local
153 Stats s = evaluateDarkBarBitmap(bitmap, LIGHT_BG_COLOR, 0); in testLegacyFlagsCannotOverwriteAppearance()
154 assertStats(bitmap, s, false /* light */); in testLegacyFlagsCannotOverwriteAppearance()
172 Bitmap bitmap = takeNavigationBarScreenshot(activity); in testLightNavigationBar() local
[all …]
DLightBarTestBase.java71 protected void dumpBitmap(Bitmap bitmap, String name) { in dumpBitmap() argument
82 bitmap.compress(Bitmap.CompressFormat.PNG, 85, fileStream); in dumpBitmap()
99 final Bitmap bitmap = takeNavigationBarScreenshot(activity); in checkNavigationBarDivider() local
100 int[] pixels = new int[bitmap.getHeight() * bitmap.getWidth()]; in checkNavigationBarDivider()
101 bitmap.getPixels(pixels, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight()); in checkNavigationBarDivider()
107 int x = i % bitmap.getWidth(); in checkNavigationBarDivider()
108 int y = i / bitmap.getWidth(); in checkNavigationBarDivider()
118 for (int col = 0; col < bitmap.getWidth(); col++) { in checkNavigationBarDivider()
132 0.3f, (float) diffCount / (float)bitmap.getWidth(), in checkNavigationBarDivider()
138 dumpBitmap(bitmap, methodName); in checkNavigationBarDivider()
/cts/tests/tests/uirendering27/src/android/uirendering/cts/bitmapverifiers/
DBitmapVerifier.java30 public boolean verify(Bitmap bitmap) { in verify() argument
31 int width = bitmap.getWidth(); in verify()
32 int height = bitmap.getHeight(); in verify()
34 bitmap.getPixels(pixels, 0, width, 0, 0, width, height); in verify()
41 public abstract boolean verify(int[] bitmap, int offset, int stride, int width, int height); in verify() argument
/cts/tests/tests/uirendering/src/android/uirendering/cts/util/
DBitmapDumper.java151 public static void dumpBitmap(Bitmap bitmap, String testName, String className) { in dumpBitmap() argument
152 if (bitmap == null) { in dumpBitmap()
157 saveBitmap(bitmap, capture); in dumpBitmap()
163 private static void logIfBitmapSolidColor(String fileName, Bitmap bitmap) { in logIfBitmapSolidColor() argument
164 int firstColor = bitmap.getPixel(0, 0); in logIfBitmapSolidColor()
165 for (int x = 0; x < bitmap.getWidth(); x++) { in logIfBitmapSolidColor()
166 for (int y = 0; y < bitmap.getHeight(); y++) { in logIfBitmapSolidColor()
167 if (bitmap.getPixel(x, y) != firstColor) { in logIfBitmapSolidColor()
176 private static void saveBitmap(Bitmap bitmap, File file) { in saveBitmap() argument
177 if (bitmap == null) { in saveBitmap()
[all …]
/cts/tests/tests/uirendering/src/android/uirendering/cts/testinfrastructure/
DResourceModifier.java50 public final Bitmap bitmap; field in ResourceModifier
55 bitmap = BitmapFactory.decodeResource(resources, R.drawable.sunset1); in ResourceModifier()
56 int texWidth = bitmap.getWidth(); in ResourceModifier()
57 int texHeight = bitmap.getHeight(); in ResourceModifier()
62 repeatShader = new BitmapShader(bitmap, Shader.TileMode.REPEAT, in ResourceModifier()
65 translatedShader = new BitmapShader(bitmap, Shader.TileMode.REPEAT, in ResourceModifier()
72 scaledShader = new BitmapShader(bitmap, Shader.TileMode.MIRROR, in ResourceModifier()
98 final float width = bitmap.getWidth() / 8.0f; in ResourceModifier()
99 final float height = bitmap.getHeight() / 8.0f; in ResourceModifier()
/cts/tests/tests/security/src/android/security/cts/
DDecodeTest.java38 Bitmap bitmap = BitmapFactory.decodeStream(exploitImage); in test_android_bug_34778578() local
39 assertNull(bitmap); in test_android_bug_34778578()
51 Bitmap bitmap = BitmapFactory.decodeStream(exploitImage); in test_android_bug_67381469() local
52 assertNull(bitmap); in test_android_bug_67381469()

1234567