Home
last modified time | relevance | path

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

123456

/cts/tests/tests/view/src/android/view/cts/
DPixelCopyTest.java186 Bitmap bitmap = Bitmap.createBitmap(100, 100, Config.ARGB_8888); in testGlProducerFullsize() local
187 int result = mCopyHelper.request(activity.getView(), bitmap); in testGlProducerFullsize()
189 assertEquals(100, bitmap.getWidth()); in testGlProducerFullsize()
190 assertEquals(100, bitmap.getHeight()); in testGlProducerFullsize()
191 assertEquals(Config.ARGB_8888, bitmap.getConfig()); in testGlProducerFullsize()
192 assertBitmapQuadColor(bitmap, in testGlProducerFullsize()
199 Bitmap bitmap = Bitmap.createBitmap(100, 100, Config.ARGB_8888); in testGlProducerCropTopLeft() local
200 int result = mCopyHelper.request(activity.getView(), new Rect(0, 0, 50, 50), bitmap); in testGlProducerCropTopLeft()
202 assertBitmapQuadColor(bitmap, in testGlProducerCropTopLeft()
209 Bitmap bitmap = Bitmap.createBitmap(100, 100, Config.ARGB_8888); in testGlProducerCropCenter() local
[all …]
/cts/tests/tests/graphics/src/android/graphics/cts/
DBitmapTest.java146 Bitmap bitmap = mBitmap.copy(Config.ARGB_8888, false); in testCopy() local
147 WidgetTestUtils.assertEquals(mBitmap, bitmap); in testCopy()
214 Bitmap bitmap = Bitmap.createBitmap(mBitmap.getWidth(), mBitmap.getHeight(), in testCopyPixelsToBuffer() local
217 bitmap.copyPixelsFromBuffer(intBuf1); in testCopyPixelsToBuffer()
219 bitmap.copyPixelsToBuffer(intBuf2); in testCopyPixelsToBuffer()
234 Bitmap bitmap = Bitmap.createBitmap(colors, 10, 10, Config.RGB_565); in testCreateBitmap1() local
235 assertFalse(bitmap.isMutable()); in testCreateBitmap1()
236 Bitmap ret = Bitmap.createBitmap(bitmap); in testCreateBitmap1()
443 Bitmap bitmap; in testCreateBitmap_displayMetrics_mutable() local
444 bitmap = Bitmap.createBitmap(metrics, 10, 10, Config.ARGB_8888); in testCreateBitmap_displayMetrics_mutable()
[all …]
DVulkanPreTransformTest.java172 Bitmap bitmap = takeScreenshot(); in validatePixelValuesAfterRotation() local
174 int width = bitmap.getWidth(); in validatePixelValuesAfterRotation()
175 int height = bitmap.getHeight(); in validatePixelValuesAfterRotation()
178 diff += pixelDiff(bitmap.getPixel(0, 0), 255, 0, 0); in validatePixelValuesAfterRotation()
179 diff += pixelDiff(bitmap.getPixel(width - 1, 0), 0, 255, 0); in validatePixelValuesAfterRotation()
180 diff += pixelDiff(bitmap.getPixel(0, height - 1), 0, 0, 255); in validatePixelValuesAfterRotation()
181 diff += pixelDiff(bitmap.getPixel(width - 1, height - 1), 255, 255, 0); in validatePixelValuesAfterRotation()
183 diff += pixelDiff(bitmap.getPixel(0, 0), 0, 255, 0); in validatePixelValuesAfterRotation()
184 diff += pixelDiff(bitmap.getPixel(width - 1, 0), 255, 255, 0); in validatePixelValuesAfterRotation()
185 diff += pixelDiff(bitmap.getPixel(0, height - 1), 255, 0, 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 …]
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 …]
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 …]
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 …]
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()
DColorMatrixColorFilterTest.java53 Bitmap bitmap = Bitmap.createBitmap(1, 1, Config.ARGB_8888); in testColorMatrixColorFilter() local
54 Canvas canvas = new Canvas(bitmap); in testColorMatrixColorFilter()
59 ColorUtils.verifyColor(Color.CYAN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
62 ColorUtils.verifyColor(Color.GREEN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
65 ColorUtils.verifyColor(Color.RED, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
69 ColorUtils.verifyColor(Color.WHITE, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
80 bitmap.eraseColor(Color.TRANSPARENT); in testColorMatrixColorFilter()
85 ColorUtils.verifyColor(Color.argb(128, 255, 0, 64), bitmap.getPixel(0, 0), 2); in testColorMatrixColorFilter()
89 ColorUtils.verifyColor(Color.CYAN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
96 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 …]
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()
DRadialGradientTest.java55 Bitmap bitmap = Bitmap.createBitmap(3, 1, Config.ARGB_8888); in testZeroScaleMatrix() local
56 bitmap.eraseColor(Color.BLACK); in testZeroScaleMatrix()
57 Canvas canvas = new Canvas(bitmap); in testZeroScaleMatrix()
63 ColorUtils.verifyColor(Color.BLACK, bitmap.getPixel(0, 0), 1); in testZeroScaleMatrix()
64 ColorUtils.verifyColor(Color.BLACK, bitmap.getPixel(1, 0), 1); in testZeroScaleMatrix()
65 ColorUtils.verifyColor(Color.BLACK, bitmap.getPixel(2, 0), 1); in testZeroScaleMatrix()
75 Bitmap bitmap = Bitmap.createBitmap(100, 100, Config.RGBA_F16); in testColorLong() local
76 bitmap.eraseColor(Color.TRANSPARENT); in testColorLong()
77 Canvas canvas = new Canvas(bitmap); in testColorLong()
83 final ColorSpace bitmapColorSpace = bitmap.getColorSpace(); in testColorLong()
[all …]
DPaintFlagsDrawFilterTest.java93 private void verifyUnderline(Bitmap bitmap) { in verifyUnderline() argument
98 int pixel = bitmap.getPixel(x, y); in verifyUnderline()
170 private void verifyContainsNonBW(Bitmap bitmap) { in verifyContainsNonBW() argument
171 for (int i = 0; i < bitmap.getWidth(); ++i) { in verifyContainsNonBW()
172 for (int j = 0; j < bitmap.getHeight(); ++j) { in verifyContainsNonBW()
173 int color = bitmap.getPixel(i, j); in verifyContainsNonBW()
186 private void verifyContainsOnlyBlackAndWhite(Bitmap bitmap) { in verifyContainsOnlyBlackAndWhite() argument
187 for (int i = 0; i < bitmap.getWidth(); ++i) { in verifyContainsOnlyBlackAndWhite()
188 for (int j = 0; j < bitmap.getHeight(); ++j) { in verifyContainsOnlyBlackAndWhite()
189 int color = bitmap.getPixel(i, j); in verifyContainsOnlyBlackAndWhite()
/cts/tests/tests/media/src/android/media/cts/
DMediaMetadataRetrieverTest.java396 Bitmap bitmap = r.getFrameAtIndex(testCases[i][0], params); in testGetFrameAtIndex()
398 bitmaps.add(bitmap); in testGetFrameAtIndex()
477 private void verifyVideoFrame(Bitmap bitmap, int[] testCase) { in verifyVideoFrame() argument
479 assertTrue("Failed to get bitmap for " + testCase[0], bitmap != null); in verifyVideoFrame()
481 testCase[1], CodecUtils.readBinaryCounterFromBitmap(bitmap)); in verifyVideoFrame()
484 CodecUtils.saveBitmapToFile(bitmap, "test_" + testCase[0] + ".jpg"); in verifyVideoFrame()
514 Bitmap bitmap = retriever.getScaledFrameAtTime( in testGetScaledFrameAtTime() local
522 Bitmap bitmap = retriever.getScaledFrameAtTime( in testGetScaledFrameAtTime() local
530 Bitmap bitmap = retriever.getScaledFrameAtTime( in testGetScaledFrameAtTime() local
538 Bitmap bitmap = retriever.getScaledFrameAtTime( in testGetScaledFrameAtTime() local
[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 …]
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/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/systemui/src/android/systemui/cts/
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()
DLightBarTests.java98 Bitmap bitmap = takeStatusBarScreenshot(mActivityRule.getActivity()); in testLightStatusBarIcons() local
99 Stats s = evaluateLightBarBitmap(bitmap, Color.RED /* background */, 0); in testLightStatusBarIcons()
100 assertLightStats(bitmap, s); in testLightStatusBarIcons()
120 Bitmap bitmap = takeNavigationBarScreenshot(activity); in testLightNavigationBar() local
121 Stats s = evaluateLightBarBitmap(bitmap, Color.RED /* background */, activity.getBottom()); in testLightNavigationBar()
122 assertLightStats(bitmap, s); in testLightNavigationBar()
154 private void assertLightStats(Bitmap bitmap, Stats s) { in assertLightStats() argument
175 dumpBitmap(bitmap, mTestName.getMethodName()); in assertLightStats()
215 private Stats evaluateLightBarBitmap(Bitmap bitmap, int background, int shiftY) { in evaluateLightBarBitmap() argument
231 int[] pixels = new int[bitmap.getHeight() * bitmap.getWidth()]; in evaluateLightBarBitmap()
[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/widget/src/android/widget/cts/util/
DTestUtils.java69 final Bitmap bitmap = Bitmap.createBitmap(bitmapWidth, bitmapHeight, in getCombinedBackgroundBitmap() local
72 final Canvas canvas = new Canvas(bitmap); in getCombinedBackgroundBitmap()
116 return bitmap; in getCombinedBackgroundBitmap()
150 Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), in assertRegionPixelsOfColor() local
153 Canvas canvas = new Canvas(bitmap); in assertRegionPixelsOfColor()
158 assertAllPixelsOfColor(failMessagePrefix, bitmap, region, in assertRegionPixelsOfColor()
161 bitmap.recycle(); in assertRegionPixelsOfColor()
178 Bitmap bitmap = Bitmap.createBitmap(drawableWidth, drawableHeight, in assertAllPixelsOfColor() local
181 Canvas canvas = new Canvas(bitmap); in assertAllPixelsOfColor()
194 assertAllPixelsOfColor(failMessagePrefix, bitmap, in assertAllPixelsOfColor()
[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/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/app/src/android/app/cts/
DTaskDescriptionTest.java66 final Bitmap bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); in testBitmapConstructor() local
67 bitmap.eraseColor(0); in testBitmapConstructor()
68 activity.setTaskDescription(new TaskDescription(TEST_LABEL, bitmap, TEST_COLOR)); in testBitmapConstructor()
69 assertTaskDescription(activity, TEST_LABEL, TEST_NO_DATA, bitmap); in testBitmapConstructor()
71 activity.setTaskDescription(new TaskDescription(TEST_LABEL, bitmap)); in testBitmapConstructor()
72 assertTaskDescription(activity, TEST_LABEL, TEST_NO_DATA, bitmap); in testBitmapConstructor()
99 private void assertTaskDescription(Activity activity, String label, int resId, Bitmap bitmap) { in assertTaskDescription() argument
107 if (bitmap != null) { in assertTaskDescription()

123456