Home
last modified time | relevance | path

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

12345678910>>...12

/frameworks/base/opengl/java/android/opengl/
DGLUtils.java40 public static int getInternalFormat(Bitmap bitmap) { in getInternalFormat() argument
41 if (bitmap == null) { in getInternalFormat()
44 if (bitmap.isRecycled()) { in getInternalFormat()
47 int result = native_getInternalFormat(bitmap.getNativeInstance()); in getInternalFormat()
62 public static int getType(Bitmap bitmap) { in getType() argument
63 if (bitmap == null) { in getType()
66 if (bitmap.isRecycled()) { in getType()
69 int result = native_getType(bitmap.getNativeInstance()); in getType()
99 Bitmap bitmap, int border) { in texImage2D() argument
100 if (bitmap == null) { in texImage2D()
[all …]
/frameworks/base/core/jni/android/graphics/
DBitmap.cpp47 explicit BitmapWrapper(Bitmap* bitmap) in BitmapWrapper() argument
48 : mBitmap(bitmap) { } in BitmapWrapper()
64 Bitmap& bitmap() { in bitmap() function in android::BitmapWrapper
159 return mBitmapWrapper->bitmap().pixels(); in pixels()
170 namespace bitmap { namespace
195 jobject createBitmap(JNIEnv* env, Bitmap* bitmap, in createBitmap() argument
202 assert_premultiplied(bitmap->info(), isPremultiplied); in createBitmap()
203 bool fromMalloc = bitmap->pixelStorageType() == PixelStorageType::Heap; in createBitmap()
204 BitmapWrapper* bitmapWrapper = new BitmapWrapper(bitmap); in createBitmap()
206 bitmapWrapper->bitmap().setImmutable(); in createBitmap()
[all …]
DBitmap.h28 namespace bitmap {
36 jobject createBitmap(JNIEnv* env, Bitmap* bitmap,
43 Bitmap& toBitmap(JNIEnv* env, jobject bitmap);
47 void imageInfo(JNIEnv* env, jobject bitmap, AndroidBitmapInfo* info);
49 void* lockPixels(JNIEnv* env, jobject bitmap);
51 bool unlockPixels(JNIEnv* env, jobject bitmap);
/frameworks/base/packages/WallpaperCropper/src/com/android/gallery3d/common/
DBitmapUtils.java116 Bitmap bitmap, float scale, boolean recycle) { in resizeBitmapByScale() argument
117 int width = Math.round(bitmap.getWidth() * scale); in resizeBitmapByScale()
118 int height = Math.round(bitmap.getHeight() * scale); in resizeBitmapByScale()
119 if (width == bitmap.getWidth() in resizeBitmapByScale()
120 && height == bitmap.getHeight()) return bitmap; in resizeBitmapByScale()
121 Bitmap target = Bitmap.createBitmap(width, height, getConfig(bitmap)); in resizeBitmapByScale()
125 canvas.drawBitmap(bitmap, 0, 0, paint); in resizeBitmapByScale()
126 if (recycle) bitmap.recycle(); in resizeBitmapByScale()
130 private static Bitmap.Config getConfig(Bitmap bitmap) { in getConfig() argument
131 Bitmap.Config config = bitmap.getConfig(); in getConfig()
[all …]
/frameworks/base/tests/Camera2Tests/SmartCamera/SimpleCamera/tests/src/androidx/media/filterfw/samples/simplecamera/
DFaceSquareFilterTest.java62 Bitmap bitmap = BitmapFactory.decodeStream(assetMgr.open("XZZ019.jpg")); in testFaceSquareFilter() local
63 image.setBitmap(bitmap); in testFaceSquareFilter()
79 int[] pixels = new int[bitmap.getByteCount()]; in testFaceSquareFilter()
80 bitmap.getPixels(pixels, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), in testFaceSquareFilter()
81 bitmap.getHeight()); in testFaceSquareFilter()
87 int top = (faceRect.top+HEIGHT_OFFSET)*bitmap.getHeight()/FACE_X_RANGE; in testFaceSquareFilter()
88 int bottom = (faceRect.bottom+HEIGHT_OFFSET)*bitmap.getHeight()/FACE_X_RANGE; in testFaceSquareFilter()
89 int left = (faceRect.left+WIDTH_OFFSET)*bitmap.getWidth()/FACE_X_RANGE; in testFaceSquareFilter()
90 int right = (faceRect.right+WIDTH_OFFSET)*bitmap.getWidth()/FACE_X_RANGE; in testFaceSquareFilter()
94 } else if (top > bitmap.getHeight()) { in testFaceSquareFilter()
[all …]
/frameworks/base/libs/hwui/
DReadback.cpp38 CopyResult Readback::copySurfaceInto(Surface& surface, const Rect& srcRect, SkBitmap* bitmap) { in copySurfaceInto() argument
72 return copyImageInto(image, texTransform, srcRect, bitmap); in copySurfaceInto()
75 CopyResult Readback::copyHWBitmapInto(Bitmap* hwBitmap, SkBitmap* bitmap) { in copyHWBitmapInto() argument
83 return copyImageInto(hwBitmap->makeImage(), transform, srcRect, bitmap); in copyHWBitmapInto()
86 CopyResult Readback::copyLayerInto(DeferredLayerUpdater* deferredLayer, SkBitmap* bitmap) { in copyLayerInto() argument
95 const SkRect dstRect = SkRect::MakeIWH(bitmap->width(), bitmap->height()); in copyLayerInto()
99 if (copyLayerInto(layer, nullptr, &dstRect, bitmap)) { in copyLayerInto()
107 const Rect& srcRect, SkBitmap* bitmap) { in copyImageInto() argument
121 if (bitmap->colorType() == kRGBA_F16_SkColorType && in copyImageInto()
122 !grContext->colorTypeSupportedAsSurface(bitmap->colorType())) { in copyImageInto()
[all …]
DHardwareBitmapUploader.cpp73 bool uploadHardwareBitmap(const SkBitmap& bitmap, const FormatInfo& format, in uploadHardwareBitmap() argument
77 bool result = onUploadHardwareBitmap(bitmap, format, graphicBuffer); in uploadHardwareBitmap()
95 virtual bool onUploadHardwareBitmap(const SkBitmap& bitmap, const FormatInfo& format,
167 bool onUploadHardwareBitmap(const SkBitmap& bitmap, const FormatInfo& format, in onUploadHardwareBitmap() argument
186 ATRACE_FORMAT("CPU -> gralloc transfer (%dx%d)", bitmap.width(), bitmap.height()); in onUploadHardwareBitmap()
196 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, bitmap.width(), bitmap.height(), in onUploadHardwareBitmap()
197 format.format, format.type, bitmap.getPixels()); in onUploadHardwareBitmap()
265 bool onUploadHardwareBitmap(const SkBitmap& bitmap, const FormatInfo& format, in onUploadHardwareBitmap() argument
272 bitmap.pixmap(), reinterpret_cast<AHardwareBuffer*>(graphicBuffer.get())); in onUploadHardwareBitmap()
350 SkBitmap bitmap; in makeHwCompatible() local
[all …]
/frameworks/base/packages/SystemUI/src/com/android/systemui/glwallpaper/
DImageProcessHelper.java69 void start(Bitmap bitmap) { in start() argument
70 new ThresholdComputeTask(mHandler).execute(bitmap); in start()
87 Bitmap bitmap = bitmaps[0]; in doInBackground() local
88 if (bitmap != null) { in doInBackground()
90 return new Threshold().compute(bitmap); in doInBackground()
93 + bitmap.getColorSpace(), e); in doInBackground()
109 public float compute(Bitmap bitmap) { in compute() argument
110 Bitmap grayscale = toGrayscale(bitmap); in compute()
121 private Bitmap toGrayscale(Bitmap bitmap) { in toGrayscale() argument
122 int width = bitmap.getWidth(); in toGrayscale()
[all …]
/frameworks/opt/setupwizard/library/recyclerview/test/instrumentation/src/com/android/setupwizardlib/test/
DDividerItemDecorationTest.java69 Bitmap bitmap = drawDecoration(decoration, true, true); in testShouldDrawDividerBelowWithEitherCondition() local
80 assertBitmapEquals(expectedBitmap, bitmap); in testShouldDrawDividerBelowWithEitherCondition()
82 bitmap.recycle(); in testShouldDrawDividerBelowWithEitherCondition()
83 bitmap = drawDecoration(decoration, false, true); in testShouldDrawDividerBelowWithEitherCondition()
85 assertBitmapEquals(expectedBitmap, bitmap); in testShouldDrawDividerBelowWithEitherCondition()
87 bitmap.recycle(); in testShouldDrawDividerBelowWithEitherCondition()
88 bitmap = drawDecoration(decoration, true, false); in testShouldDrawDividerBelowWithEitherCondition()
93 assertBitmapEquals(expectedBitmap, bitmap); in testShouldDrawDividerBelowWithEitherCondition()
95 bitmap.recycle(); in testShouldDrawDividerBelowWithEitherCondition()
96 bitmap = drawDecoration(decoration, false, false); in testShouldDrawDividerBelowWithEitherCondition()
[all …]
/frameworks/opt/photoviewer/src/com/android/ex/photo/loaders/
DPhotoBitmapLoader.java58 if (result.bitmap != null) { in loadInBackground()
59 result.bitmap.setDensity(DisplayMetrics.DENSITY_MEDIUM); in loadInBackground()
77 Bitmap bitmap = result != null ? result.bitmap : null; in deliverResult() local
81 if (bitmap != null) { in deliverResult()
82 onReleaseResources(bitmap); in deliverResult()
87 mBitmap = bitmap; in deliverResult()
98 if (oldBitmap != null && oldBitmap != bitmap && !oldBitmap.isRecycled()) { in deliverResult()
113 result.bitmap = mBitmap; in onStartLoading()
142 onReleaseResources(result.bitmap); in onCanceled()
168 protected void onReleaseResources(Bitmap bitmap) { in onReleaseResources() argument
[all …]
/frameworks/base/packages/WallpaperCropper/src/com/android/gallery3d/glrenderer/
DUploadedTexture.java124 Bitmap bitmap = sBorderLines.get(key); in getBorderLine() local
125 if (bitmap == null) { in getBorderLine()
126 bitmap = vertical in getBorderLine()
129 sBorderLines.put(key.clone(), bitmap); in getBorderLine() local
131 return bitmap; in getBorderLine()
166 protected abstract void onFreeBitmap(Bitmap bitmap); in onFreeBitmap() argument
193 Bitmap bitmap = getBitmap(); in updateContent() local
194 int format = GLUtils.getInternalFormat(bitmap); in updateContent()
195 int type = GLUtils.getType(bitmap); in updateContent()
196 canvas.texSubImage2D(this, mBorder, mBorder, bitmap, format, type); in updateContent()
[all …]
DBitmapTexture.java31 public BitmapTexture(Bitmap bitmap) { in BitmapTexture() argument
32 this(bitmap, false); in BitmapTexture()
35 public BitmapTexture(Bitmap bitmap, boolean hasBorder) { in BitmapTexture() argument
37 Utils.assertTrue(bitmap != null && !bitmap.isRecycled()); in BitmapTexture()
38 mContentBitmap = bitmap; in BitmapTexture()
42 protected void onFreeBitmap(Bitmap bitmap) { in onFreeBitmap() argument
/frameworks/base/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/
DFrameImage2D.java60 public void setBitmap(Bitmap bitmap) { in setBitmap() argument
61 bitmap = convertToFrameType(bitmap, mBackingStore.getFrameType()); in setBitmap()
62 validateBitmapSize(bitmap, mBackingStore.getDimensions()); in setBitmap()
64 backing.setData(bitmap); in setBitmap()
116 private static Bitmap convertToFrameType(Bitmap bitmap, FrameType type) { in convertToFrameType() argument
117 Bitmap.Config config = bitmap.getConfig(); in convertToFrameType()
118 Bitmap result = bitmap; in convertToFrameType()
122 result = bitmap.copy(Bitmap.Config.ARGB_8888, false); in convertToFrameType()
136 private void validateBitmapSize(Bitmap bitmap, int[] dimensions) { in validateBitmapSize() argument
137 if (bitmap.getWidth() != dimensions[0] || bitmap.getHeight() != dimensions[1]) { in validateBitmapSize()
[all …]
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/
DGlifPatternDrawable.java107 Bitmap bitmap = null; in draw() local
109 bitmap = bitmapCache.get(); in draw()
111 if (bitmap != null) { in draw()
112 final int bitmapWidth = bitmap.getWidth(); in draw()
113 final int bitmapHeight = bitmap.getHeight(); in draw()
117 bitmap = null; in draw()
120 bitmap = null; in draw()
124 if (bitmap == null) { in draw()
128 bitmap = createBitmapCache(drawableWidth, drawableHeight); in draw()
129 bitmapCache = new SoftReference<>(bitmap); in draw()
[all …]
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/util/
DBitmapSerializeUtils.java43 public static void readBitmapPixels(Bitmap bitmap, ParcelFileDescriptor source) { in readBitmapPixels() argument
44 nativeReadBitmapPixels(bitmap, source.getFd()); in readBitmapPixels()
53 public static void writeBitmapPixels(Bitmap bitmap, ParcelFileDescriptor destination) { in writeBitmapPixels() argument
54 nativeWriteBitmapPixels(bitmap, destination.getFd()); in writeBitmapPixels()
57 private static native void nativeReadBitmapPixels(Bitmap bitmap, int fd); in nativeReadBitmapPixels() argument
59 private static native void nativeWriteBitmapPixels(Bitmap bitmap, int fd); in nativeWriteBitmapPixels() argument
/frameworks/base/libs/hwui/pipeline/skia/
DSkiaRecordingCanvas.cpp188 void SkiaRecordingCanvas::drawBitmap(Bitmap& bitmap, float left, float top, const SkPaint* paint) { in drawBitmap() argument
189 sk_sp<SkImage> image = bitmap.makeImage(); in drawBitmap()
190 mRecorder.drawImage(image, left, top, filterBitmap(paint), bitmap.palette()); in drawBitmap()
194 if (!bitmap.isImmutable() && image.get() && !image->unique()) { in drawBitmap()
199 void SkiaRecordingCanvas::drawBitmap(Bitmap& bitmap, const SkMatrix& matrix, const SkPaint* paint) { in drawBitmap() argument
203 sk_sp<SkImage> image = bitmap.makeImage(); in drawBitmap()
204 mRecorder.drawImage(image, 0, 0, filterBitmap(paint), bitmap.palette()); in drawBitmap()
205 if (!bitmap.isImmutable() && image.get() && !image->unique()) { in drawBitmap()
210 void SkiaRecordingCanvas::drawBitmap(Bitmap& bitmap, float srcLeft, float srcTop, float srcRight, in drawBitmap() argument
216 sk_sp<SkImage> image = bitmap.makeImage(); in drawBitmap()
[all …]
/frameworks/base/core/java/com/android/internal/graphics/palette/
DPalette.java103 public static Palette.Builder from(Bitmap bitmap) { in from() argument
104 return new Palette.Builder(bitmap); in from()
120 public static Palette generate(Bitmap bitmap) { in generate() argument
121 return from(bitmap).generate(); in generate()
128 public static Palette generate(Bitmap bitmap, int numColors) { in generate() argument
129 return from(bitmap).maximumColorCount(numColors).generate(); in generate()
137 Bitmap bitmap, Palette.PaletteAsyncListener listener) { in generateAsync() argument
138 return from(bitmap).generate(listener); in generateAsync()
146 final Bitmap bitmap, final int numColors, final Palette.PaletteAsyncListener listener) { in generateAsync() argument
147 return from(bitmap).maximumColorCount(numColors).generate(listener); in generateAsync()
[all …]
/frameworks/base/tests/UiBench/src/com/android/test/uibench/leanback/
DBitmapLoader.java94 Bitmap bitmap = Bitmap.createBitmap(mWidth, mHeight, Bitmap.Config.ARGB_8888); in doInBackground() local
95 Canvas canvas = new Canvas(bitmap); in doInBackground()
99 bitmap.prepareToDraw(); in doInBackground()
100 return bitmap; in doInBackground()
111 protected void onPostExecute(Bitmap bitmap) { in onPostExecute() argument
114 sLruCache.put(mId, bitmap); in onPostExecute()
115 mImageView.setImageBitmap(bitmap); in onPostExecute()
122 Bitmap bitmap = getLruCache(context).get(id); in loadBitmap() local
123 if (bitmap != null) { in loadBitmap()
124 view.setImageBitmap(bitmap); in loadBitmap()
/frameworks/base/core/java/android/app/
DSharedElementCallback.java183 Bitmap bitmap = TransitionUtils.createDrawableBitmap(d, imageView); in onCaptureSharedElementSnapshot() local
184 if (bitmap != null) { in onCaptureSharedElementSnapshot()
186 if (bitmap.getConfig() != Bitmap.Config.HARDWARE) { in onCaptureSharedElementSnapshot()
187 bundle.putParcelable(BUNDLE_SNAPSHOT_BITMAP, bitmap); in onCaptureSharedElementSnapshot()
189 GraphicBuffer graphicBuffer = bitmap.createGraphicBufferHandle(); in onCaptureSharedElementSnapshot()
191 ColorSpace cs = bitmap.getColorSpace(); in onCaptureSharedElementSnapshot()
239 Bitmap bitmap = bundle.getParcelable(BUNDLE_SNAPSHOT_BITMAP); in onCreateSnapshotView() local
240 if (buffer == null && bitmap == null) { in onCreateSnapshotView()
243 if (bitmap == null) { in onCreateSnapshotView()
249 bitmap = Bitmap.wrapHardwareBuffer(HardwareBuffer.createFromGraphicBuffer(buffer), in onCreateSnapshotView()
[all …]
DWallpaperColors.java134 Bitmap bitmap = Bitmap.createBitmap(optimalSize.getWidth(), optimalSize.getHeight(), in fromDrawable() local
136 final Canvas bmpCanvas = new Canvas(bitmap); in fromDrawable()
137 drawable.setBounds(0, 0, bitmap.getWidth(), bitmap.getHeight()); in fromDrawable()
140 final WallpaperColors colors = WallpaperColors.fromBitmap(bitmap); in fromDrawable()
141 bitmap.recycle(); in fromDrawable()
154 public static WallpaperColors fromBitmap(@NonNull Bitmap bitmap) { in fromBitmap() argument
155 if (bitmap == null) { in fromBitmap()
159 final int bitmapArea = bitmap.getWidth() * bitmap.getHeight(); in fromBitmap()
163 Size optimalSize = calculateOptimalSize(bitmap.getWidth(), bitmap.getHeight()); in fromBitmap()
164 bitmap = Bitmap.createScaledBitmap(bitmap, optimalSize.getWidth(), in fromBitmap()
[all …]
/frameworks/rs/tests/java_api/Refocus/src/com/android/rs/test/
DRGBZ.java41 private Bitmap bitmap; field in RGBZ
61 bitmap = setAlphaChannel(preview, depthBitmap); in RGBZ()
80 bitmap = setAlphaChannel(preview, depthBitmap); in RGBZ()
89 bitmap = setAlphaChannel(preview, depthBitmap); in RGBZ()
128 return bitmap; in getBitmap()
154 return bitmap.getWidth(); in getWidth()
161 return bitmap.getHeight(); in getHeight()
183 public Bitmap setAlphaChannel(Bitmap bitmap, Bitmap depthBitmap) { in setAlphaChannel() argument
184 if (bitmap == null) { in setAlphaChannel()
185 return bitmap; in setAlphaChannel()
[all …]
/frameworks/opt/bitmap/src/com/android/bitmap/drawable/
DCircularBitmapDrawable.java17 package com.android.bitmap.drawable;
32 import com.android.bitmap.BitmapCache;
105 Bitmap bitmap = placeholder.getBitmap(); in onDrawPlaceholderOrProgress() local
107 mRect.set(0, 0, bitmap.getWidth(), bitmap.getHeight()); in onDrawPlaceholderOrProgress()
108 onDrawCircularBitmap(bitmap, canvas, mRect, bounds, alpha); in onDrawPlaceholderOrProgress()
122 protected void onDrawCircularBitmap(final Bitmap bitmap, final Canvas canvas, in onDrawCircularBitmap() argument
124 onDrawCircularBitmap(bitmap, canvas, src, dst, 1f); in onDrawCircularBitmap()
131 protected void onDrawCircularBitmap(final Bitmap bitmap, final Canvas canvas, in onDrawCircularBitmap() argument
135 if (shader == null || mShaderBitmap != bitmap) { in onDrawCircularBitmap()
136 shader = new BitmapShader(bitmap, TileMode.CLAMP, TileMode.CLAMP); in onDrawCircularBitmap()
[all …]
/frameworks/base/core/tests/coretests/src/android/content/
DContentResolverTest.java71 final Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); in initImage() local
72 final Canvas canvas = new Canvas(bitmap); in initImage()
81 bitmap.compress(Bitmap.CompressFormat.PNG, 90, mImage.getOutputStream()); in initImage()
88 private static void assertImageAspectAndContents(Bitmap bitmap) { in assertImageAspectAndContents() argument
91 final int after = (100 * bitmap.getWidth()) / bitmap.getHeight(); in assertImageAspectAndContents()
95 final int halfX = bitmap.getWidth() / 2; in assertImageAspectAndContents()
96 final int halfY = bitmap.getHeight() / 2; in assertImageAspectAndContents()
97 assertEquals(Color.BLUE, bitmap.getPixel(halfX - 10, halfY - 10)); in assertImageAspectAndContents()
98 assertEquals(Color.RED, bitmap.getPixel(halfX + 10, halfY - 10)); in assertImageAspectAndContents()
99 assertEquals(Color.RED, bitmap.getPixel(halfX - 10, halfY + 10)); in assertImageAspectAndContents()
[all …]
/frameworks/base/graphics/java/android/graphics/
DBitmapShader.java47 public BitmapShader(@NonNull Bitmap bitmap, @NonNull TileMode tileX, @NonNull TileMode tileY) { in BitmapShader() argument
48 this(bitmap, tileX.nativeInt, tileY.nativeInt); in BitmapShader()
51 private BitmapShader(Bitmap bitmap, int tileX, int tileY) { in BitmapShader() argument
52 if (bitmap == null) { in BitmapShader()
55 if (bitmap == mBitmap && tileX == mTileX && tileY == mTileY) { in BitmapShader()
58 mBitmap = bitmap; in BitmapShader()
/frameworks/base/core/java/com/android/internal/app/
DSimpleIconFactory.java181 Bitmap bitmap = createIconBitmap(icon, scale[0]); in createUserBadgedIconBitmap() local
183 mCanvas.setBitmap(bitmap); in createUserBadgedIconBitmap()
184 recreateIcon(Bitmap.createBitmap(bitmap), mCanvas); in createUserBadgedIconBitmap()
190 BitmapDrawable drawable = new FixedSizeBitmapDrawable(bitmap); in createUserBadgedIconBitmap()
198 result = bitmap; in createUserBadgedIconBitmap()
233 Bitmap bitmap = createIconBitmap(icon, scale); in createAppBadgedIconBitmap() local
234 bitmap = maskBitmapToCircle(bitmap); in createAppBadgedIconBitmap()
235 icon = new BitmapDrawable(mContext.getResources(), bitmap); in createAppBadgedIconBitmap()
239 bitmap = createIconBitmap(icon, scale); in createAppBadgedIconBitmap()
241 mCanvas.setBitmap(bitmap); in createAppBadgedIconBitmap()
[all …]

12345678910>>...12