Home
last modified time | relevance | path

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

123456789

/cts/tests/tests/view/src/android/view/cts/
DPixelCopyTest.java240 Bitmap bitmap = Bitmap.createBitmap(100, 100, Config.ARGB_8888); in testGlProducerFullsize() local
241 int result = mCopyHelper.request(activity.getView(), bitmap); in testGlProducerFullsize()
243 assertEquals(100, bitmap.getWidth()); in testGlProducerFullsize()
244 assertEquals(100, bitmap.getHeight()); in testGlProducerFullsize()
245 assertEquals(Config.ARGB_8888, bitmap.getConfig()); in testGlProducerFullsize()
246 assertBitmapQuadColor(bitmap, in testGlProducerFullsize()
255 Bitmap bitmap = result.getBitmap(); in testGlProducerAutoSize() local
256 assertEquals(100, bitmap.getWidth()); in testGlProducerAutoSize()
257 assertEquals(100, bitmap.getHeight()); in testGlProducerAutoSize()
258 assertEquals(Config.ARGB_8888, bitmap.getConfig()); in testGlProducerAutoSize()
[all …]
/cts/tests/tests/graphics/src/android/graphics/cts/
DBitmapShaderTest.java91 private void verifyTile(Bitmap bitmap, int tileX, int tileY) { in verifyTile() argument
96 verifyColor(BORDER_COLOR, bitmap, x + tileX, y + tileY); in verifyTile()
98 verifyColor(CENTER_COLOR, bitmap, x + tileX, y + tileY); in verifyTile()
109 private void verifyColor(int color, Bitmap bitmap, int x, int y) { in verifyColor() argument
110 if (x < bitmap.getWidth() && y < bitmap.getHeight()) { in verifyColor()
111 assertEquals(color, bitmap.getPixel(x, y)); in verifyColor()
118 Bitmap bitmap = Bitmap.createBitmap(2, 1, config); in testClamp() local
119 bitmap.setPixel(0, 0, Color.RED); in testClamp()
120 bitmap.setPixel(1, 0, Color.BLUE); in testClamp()
122 BitmapShader shader = new BitmapShader(bitmap, in testClamp()
[all …]
DBitmapTest.java228 Bitmap bitmap = Bitmap.createBitmap(1, 1, Config.ALPHA_8); in testCompressAlpha8Fails() local
230 bitmap.compress(format, 50, new ByteArrayOutputStream())); in testCompressAlpha8Fails()
241 nCompress(bitmap, nativeCompressFormat(format), 50, stream, storage)); in testCompressAlpha8Fails()
253 Bitmap bitmap = mBitmap.copy(Config.ARGB_8888, false); in testCopy() local
254 WidgetTestUtils.assertEquals(mBitmap, bitmap); in testCopy()
321 Bitmap bitmap = Bitmap.createBitmap(mBitmap.getWidth(), mBitmap.getHeight(), in testCopyPixelsToBuffer() local
324 bitmap.copyPixelsFromBuffer(intBuf1); in testCopyPixelsToBuffer()
326 bitmap.copyPixelsToBuffer(intBuf2); in testCopyPixelsToBuffer()
341 Bitmap bitmap = Bitmap.createBitmap(colors, 10, 10, Config.RGB_565); in testCreateBitmap1() local
342 assertFalse(bitmap.isMutable()); in testCreateBitmap1()
[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()
DVulkanPreTransformTest.java176 Bitmap bitmap = takeScreenshot(width, height); in validatePixelValuesAfterRotation() local
180 diff += pixelDiff(bitmap.getPixel(0, 0), 255, 0, 0); in validatePixelValuesAfterRotation()
181 diff += pixelDiff(bitmap.getPixel(width - 1, 0), 0, 255, 0); in validatePixelValuesAfterRotation()
182 diff += pixelDiff(bitmap.getPixel(0, height - 1), 0, 0, 255); in validatePixelValuesAfterRotation()
183 diff += pixelDiff(bitmap.getPixel(width - 1, height - 1), 255, 255, 0); in validatePixelValuesAfterRotation()
185 diff += pixelDiff(bitmap.getPixel(0, 0), 0, 255, 0); in validatePixelValuesAfterRotation()
186 diff += pixelDiff(bitmap.getPixel(width - 1, 0), 255, 255, 0); in validatePixelValuesAfterRotation()
187 diff += pixelDiff(bitmap.getPixel(0, height - 1), 255, 0, 0); in validatePixelValuesAfterRotation()
188 diff += pixelDiff(bitmap.getPixel(width - 1, height - 1), 0, 0, 255); in validatePixelValuesAfterRotation()
190 diff += pixelDiff(bitmap.getPixel(0, 0), 255, 255, 0); in validatePixelValuesAfterRotation()
[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()
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 …]
DNinePatchTest.java117 Bitmap bitmap = Bitmap.createBitmap(COLOR, 10, 10, Bitmap.Config.ARGB_4444); in testIsNinePatchChunk() local
118 assertFalse(NinePatch.isNinePatchChunk(bitmap.getNinePatchChunk())); in testIsNinePatchChunk()
126 Bitmap bitmap = Bitmap.createBitmap(expected.getWidth(), expected.getHeight(), in testDraw() local
128 Canvas c = new Canvas(bitmap); in testDraw()
131 verifyBitmapWithAlpha(expected, bitmap, ALPHA_OPAQUE); in testDraw()
134 bitmap = Bitmap.createBitmap(expected.getWidth(), expected.getHeight(), in testDraw()
136 c = new Canvas(bitmap); in testDraw()
139 verifyBitmapWithAlpha(expected, bitmap, ALPHA_OPAQUE); in testDraw()
141 bitmap = Bitmap.createBitmap(expected.getWidth(), expected.getHeight(), in testDraw()
143 c = new Canvas(bitmap); in testDraw()
[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 …]
DGainmapTest.java115 private void checkGainmap(Bitmap bitmap) throws Exception { in checkGainmap() argument
116 assertNotNull(bitmap); in checkGainmap()
117 assertTrue("Missing gainmap", bitmap.hasGainmap()); in checkGainmap()
118 if (bitmap.getConfig() == Bitmap.Config.HARDWARE) { in checkGainmap()
119 assertEquals(HardwareBuffer.RGBA_8888, bitmap.getHardwareBuffer().getFormat()); in checkGainmap()
121 assertEquals(Bitmap.Config.ARGB_8888, bitmap.getConfig()); in checkGainmap()
123 assertEquals(ColorSpace.Named.SRGB.ordinal(), bitmap.getColorSpace().getId()); in checkGainmap()
124 Gainmap gainmap = bitmap.getGainmap(); in checkGainmap()
128 if (bitmap.getConfig() == Bitmap.Config.HARDWARE) { in checkGainmap()
144 private void checkFountainGainmap(Bitmap bitmap) throws Exception { in checkFountainGainmap() argument
[all …]
/cts/tests/tests/uirendering/src/android/uirendering/cts/testclasses/
DHardwareBufferRendererTests.kt99 val bitmap = Bitmap.wrapHardwareBuffer(hardwareBuffer, colorSpace)!! in <lambda>() constant
102 assertEquals(TEST_WIDTH, bitmap.width) in <lambda>()
103 assertEquals(TEST_HEIGHT, bitmap.height) in <lambda>()
104 assertEquals(0xFF0000FF.toInt(), bitmap.getPixel(0, 0)) in <lambda>()
108 fun testContentsPreservedSRGB() = preservedContentsTest() { bitmap -> in <lambda>() method
109 assertEquals(Color.RED, bitmap.getPixel(TEST_WIDTH / 2, TEST_HEIGHT / 4)) in <lambda>()
110 assertEquals(Color.BLUE, bitmap.getPixel(TEST_WIDTH / 2, TEST_HEIGHT / 2 + TEST_HEIGHT / 4)) in <lambda>()
117 ) { bitmap -> in <lambda>() method
118 val buffer = ByteBuffer.allocateDirect(bitmap.allocationByteCount).apply { in <lambda>()
119 bitmap.copyPixelsToBuffer(this) in <lambda>()
[all …]
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>()
/cts/tests/tests/uirendering/src/android/uirendering/cts/util/
DBitmapDumper.java75 public static void dumpBitmap(Bitmap bitmap) { in dumpBitmap() argument
76 dumpBitmap(bitmap, TYPE_SINGULAR); in dumpBitmap()
82 public static void dumpBitmap(Bitmap bitmap, String label) { in dumpBitmap() argument
83 if (bitmap == null) { in dumpBitmap()
89 saveBitmap(bitmap, file); in dumpBitmap()
94 private static void logIfBitmapSolidColor(String fileName, Bitmap bitmap) { in logIfBitmapSolidColor() argument
95 int firstColor = bitmap.getPixel(0, 0); in logIfBitmapSolidColor()
96 for (int x = 0; x < bitmap.getWidth(); x++) { in logIfBitmapSolidColor()
97 for (int y = 0; y < bitmap.getHeight(); y++) { in logIfBitmapSolidColor()
98 if (bitmap.getPixel(x, y) != firstColor) { in logIfBitmapSolidColor()
[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/media/common/src/android/media/cts/
DCodecUtils.java154 public static int readBinaryCounterFromBitmap(Bitmap bitmap) { in readBinaryCounterFromBitmap() argument
155 int numDigits = bitmap.getWidth() / 16; in readBinaryCounterFromBitmap()
158 int rgb = bitmap.getPixel(i * 16 + 8, 8); in readBinaryCounterFromBitmap()
174 public static boolean VerifyFrameRotationFromBitmap(Bitmap bitmap, int targetRotation) { in VerifyFrameRotationFromBitmap() argument
176 if (bitmap.getWidth() != 320 || bitmap.getHeight() != 240) { in VerifyFrameRotationFromBitmap()
179 Color left_top = Color.valueOf(bitmap.getPixel(10, 10)); in VerifyFrameRotationFromBitmap()
180 Color right_top = Color.valueOf(bitmap.getPixel(310, 10)); in VerifyFrameRotationFromBitmap()
181 Color left_bottom = Color.valueOf(bitmap.getPixel(10, 230)); in VerifyFrameRotationFromBitmap()
182 Color right_bottom = Color.valueOf(bitmap.getPixel(310, 230)); in VerifyFrameRotationFromBitmap()
195 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/
DLightBarTestBase.java66 protected void dumpBitmap(Bitmap bitmap, String name) { in dumpBitmap() argument
77 bitmap.compress(Bitmap.CompressFormat.PNG, 85, fileStream); in dumpBitmap()
94 final Bitmap bitmap = takeNavigationBarScreenshot(activity); in checkNavigationBarDivider() local
95 int[] pixels = new int[bitmap.getHeight() * bitmap.getWidth()]; in checkNavigationBarDivider()
96 bitmap.getPixels(pixels, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight()); in checkNavigationBarDivider()
102 int x = i % bitmap.getWidth(); in checkNavigationBarDivider()
103 int y = i / bitmap.getWidth(); in checkNavigationBarDivider()
111 for (int col = 0; col < bitmap.getWidth(); col++) { in checkNavigationBarDivider()
125 0.3f, (float) diffCount / (float)bitmap.getWidth(), in checkNavigationBarDivider()
131 dumpBitmap(bitmap, methodName); in checkNavigationBarDivider()
DLightBarTests.java139 Bitmap bitmap = takeStatusBarScreenshot(mActivityRule.getActivity()); in testLightStatusBarIcons() local
140 Stats s = evaluateLightBarBitmap(bitmap, LIGHT_BG_COLOR, 0); in testLightStatusBarIcons()
141 assertStats(bitmap, s, true /* light */); in testLightStatusBarIcons()
167 Bitmap bitmap = takeStatusBarScreenshot(mActivityRule.getActivity()); in testAppearanceCanOverwriteLegacyFlags() local
168 Stats s = evaluateDarkBarBitmap(bitmap, LIGHT_BG_COLOR, 0); in testAppearanceCanOverwriteLegacyFlags()
169 assertStats(bitmap, s, false /* light */); in testAppearanceCanOverwriteLegacyFlags()
195 Bitmap bitmap = takeStatusBarScreenshot(mActivityRule.getActivity()); in testLegacyFlagsCannotOverwriteAppearance() local
196 Stats s = evaluateDarkBarBitmap(bitmap, LIGHT_BG_COLOR, 0); in testLegacyFlagsCannotOverwriteAppearance()
197 assertStats(bitmap, s, false /* light */); in testLegacyFlagsCannotOverwriteAppearance()
215 Bitmap bitmap = takeNavigationBarScreenshot(activity); in testLightNavigationBar() local
[all …]
/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/framework/base/windowmanager/src/android/server/wm/window/
DSnapshotTaskTests.java99 Bitmap bitmap = mWindowManager.snapshotTaskForRecents(mActivity.getTaskId()); in testSetDisablePreviewScreenshots() local
100 if (bitmap != null) { in testSetDisablePreviewScreenshots()
102 bitmap.getWidth() * bitmap.getHeight() - MATCHING_PIXEL_MISMATCH_ALLOWED in testSetDisablePreviewScreenshots()
104 Rect boundToCheck = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); in testSetDisablePreviewScreenshots()
105 int matchingPixels = pixelChecker.getNumMatchingPixels(bitmap, boundToCheck); in testSetDisablePreviewScreenshots()
136 Bitmap bitmap = mWindowManager.snapshotTaskForRecents(mActivity.getTaskId()); in testSetDisablePreviewScreenshots() local
137 assertNotNull(bitmap); in testSetDisablePreviewScreenshots()
138 Rect boundToCheck = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); in testSetDisablePreviewScreenshots()
139 int matchingPixels = pixelChecker.getNumMatchingPixels(bitmap, boundToCheck); in testSetDisablePreviewScreenshots()

123456789