本文整理汇总了Java中com.facebook.imagepipeline.image.CloseableStaticBitmap.getUnderlyingBitmap方法的典型用法代码示例。如果您正苦于以下问题:Java CloseableStaticBitmap.getUnderlyingBitmap方法的具体用法?Java CloseableStaticBitmap.getUnderlyingBitmap怎么用?Java CloseableStaticBitmap.getUnderlyingBitmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.facebook.imagepipeline.image.CloseableStaticBitmap
的用法示例。
在下文中一共展示了CloseableStaticBitmap.getUnderlyingBitmap方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDrawable
import com.facebook.imagepipeline.image.CloseableStaticBitmap; //导入方法依赖的package包/类
@Override
public Drawable createDrawable(CloseableImage closeableImage) {
if (closeableImage instanceof CloseableStaticBitmap) {
CloseableStaticBitmap closeableStaticBitmap = (CloseableStaticBitmap) closeableImage;
Drawable bitmapDrawable =
new BitmapDrawable(mResources, closeableStaticBitmap.getUnderlyingBitmap());
if (!hasTransformableRotationAngle(closeableStaticBitmap)
&& !hasTransformableExifOrientation(closeableStaticBitmap)) {
// Return the bitmap drawable directly as there's nothing to transform in it
return bitmapDrawable;
} else {
return new OrientedDrawable(
bitmapDrawable,
closeableStaticBitmap.getRotationAngle(),
closeableStaticBitmap.getExifOrientation());
}
} else if (mAnimatedDrawableFactory != null
&& mAnimatedDrawableFactory.supportsImageType(closeableImage)) {
return mAnimatedDrawableFactory.createDrawable(closeableImage);
}
return null;
}
示例2: postprocessInternal
import com.facebook.imagepipeline.image.CloseableStaticBitmap; //导入方法依赖的package包/类
private CloseableReference<CloseableImage> postprocessInternal(CloseableImage sourceImage) {
CloseableStaticBitmap staticBitmap = (CloseableStaticBitmap) sourceImage;
Bitmap sourceBitmap = staticBitmap.getUnderlyingBitmap();
CloseableReference<Bitmap> bitmapRef = mPostprocessor.process(sourceBitmap, mBitmapFactory);
int rotationAngle = staticBitmap.getRotationAngle();
int exifOrientation = staticBitmap.getExifOrientation();
try {
return CloseableReference.<CloseableImage>of(
new CloseableStaticBitmap(
bitmapRef, sourceImage.getQualityInfo(), rotationAngle, exifOrientation));
} finally {
CloseableReference.closeSafely(bitmapRef);
}
}
示例3: internalPrepareBitmap
import com.facebook.imagepipeline.image.CloseableStaticBitmap; //导入方法依赖的package包/类
private void internalPrepareBitmap(CloseableReference<CloseableImage> newResult) {
if (newResult == null || !newResult.isValid()) {
return;
}
final CloseableImage closeableImage = newResult.get();
if (closeableImage == null || closeableImage.isClosed()) {
return;
}
if (closeableImage instanceof CloseableStaticBitmap) {
final CloseableStaticBitmap staticBitmap = (CloseableStaticBitmap) closeableImage;
final Bitmap bitmap = staticBitmap.getUnderlyingBitmap();
if (bitmap == null) {
return;
}
final int bitmapByteCount = bitmap.getRowBytes() * bitmap.getHeight();
if (bitmapByteCount < mMinBitmapSizeBytes) {
return;
}
if (bitmapByteCount > mMaxBitmapSizeBytes) {
return;
}
bitmap.prepareToDraw();
}
}
示例4: onFinalImageSet
import com.facebook.imagepipeline.image.CloseableStaticBitmap; //导入方法依赖的package包/类
@Override
public void onFinalImageSet(
String id,
@Nullable final ImageInfo imageInfo,
@Nullable Animatable animatable) {
CloseableReference<CloseableImage> imageReference = null;
try {
imageReference = dataSource.getResult();
if (imageReference != null) {
CloseableImage image = imageReference.get();
if (image != null && image instanceof CloseableStaticBitmap) {
CloseableStaticBitmap closeableStaticBitmap = (CloseableStaticBitmap) image;
Bitmap bitmap = closeableStaticBitmap.getUnderlyingBitmap();
if (bitmap != null) {
bitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true);
iconBitmap = bitmap;
iconBitmapDescriptor = BitmapDescriptorFactory.fromBitmap(bitmap);
}
}
}
} finally {
dataSource.close();
if (imageReference != null) {
CloseableReference.closeSafely(imageReference);
}
}
update();
}