当前位置: 首页>>代码示例>>Java>>正文


Java CloseableStaticBitmap.getUnderlyingBitmap方法代码示例

本文整理汇总了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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:PipelineDraweeController.java

示例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);
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:PostprocessorProducer.java

示例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();
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:29,代码来源:BitmapPrepareProducer.java

示例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();
}
 
开发者ID:laoqiu,项目名称:react-native-amap,代码行数:29,代码来源:AMapMarker.java


注:本文中的com.facebook.imagepipeline.image.CloseableStaticBitmap.getUnderlyingBitmap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。