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


Java ImageRequest.getPostprocessor方法代码示例

本文整理汇总了Java中com.facebook.imagepipeline.request.ImageRequest.getPostprocessor方法的典型用法代码示例。如果您正苦于以下问题:Java ImageRequest.getPostprocessor方法的具体用法?Java ImageRequest.getPostprocessor怎么用?Java ImageRequest.getPostprocessor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.imagepipeline.request.ImageRequest的用法示例。


在下文中一共展示了ImageRequest.getPostprocessor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCacheKey

import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
private CacheKey getCacheKey() {
  final ImageRequest imageRequest = getImageRequest();
  final CacheKeyFactory cacheKeyFactory = mImagePipeline.getCacheKeyFactory();
  CacheKey cacheKey = null;
  if (cacheKeyFactory != null && imageRequest != null) {
    if (imageRequest.getPostprocessor() != null) {
      cacheKey = cacheKeyFactory.getPostprocessedBitmapCacheKey(
          imageRequest,
          getCallerContext());
    } else {
      cacheKey = cacheKeyFactory.getBitmapCacheKey(
          imageRequest,
          getCallerContext());
    }
  }
  return cacheKey;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:PipelineDraweeControllerBuilder.java

示例2: getPostprocessedBitmapCacheKey

import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
@Override
public CacheKey getPostprocessedBitmapCacheKey(ImageRequest request, Object callerContext) {
  final Postprocessor postprocessor = request.getPostprocessor();
  final CacheKey postprocessorCacheKey;
  final String postprocessorName;
  if (postprocessor != null) {
    postprocessorCacheKey = postprocessor.getPostprocessorCacheKey();
    postprocessorName = postprocessor.getClass().getName();
  } else {
    postprocessorCacheKey = null;
    postprocessorName = null;
  }
  return new BitmapMemoryCacheKey(
      getCacheKeySourceUri(request.getSourceUri()).toString(),
      request.getResizeOptions(),
      request.getRotationOptions(),
      request.getImageDecodeOptions(),
      postprocessorCacheKey,
      postprocessorName,
      callerContext);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:DefaultCacheKeyFactory.java

示例3: getDecodedImageProducerSequence

import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
/**
 * Returns a sequence that can be used for a request for a decoded image.
 *
 * @param imageRequest the request that will be submitted
 * @return the sequence that should be used to process the request
 */
public Producer<CloseableReference<CloseableImage>> getDecodedImageProducerSequence(
    ImageRequest imageRequest) {
  Producer<CloseableReference<CloseableImage>> pipelineSequence =
      getBasicDecodedImageSequence(imageRequest);

  if (imageRequest.getPostprocessor() != null) {
    pipelineSequence = getPostprocessorSequence(pipelineSequence);
  }

  if (mUseBitmapPrepareToDraw) {
    pipelineSequence = getBitmapPrepareSequence(pipelineSequence);
  }

  return pipelineSequence;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:ProducerSequenceFactory.java

示例4: getPostprocessedBitmapCacheKey

import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
@Override
public CacheKey getPostprocessedBitmapCacheKey(ImageRequest request, Object callerContext) {
    final Postprocessor postprocessor = request.getPostprocessor();
    final CacheKey postprocessorCacheKey;
    final String postprocessorName;
    if (postprocessor != null) {
        postprocessorCacheKey = postprocessor.getPostprocessorCacheKey();
        postprocessorName = postprocessor.getClass().getName();
    } else {
        postprocessorCacheKey = null;
        postprocessorName = null;
    }
    return new BitmapMemoryCacheKey(
            getCacheKeySourceUri(request.getSourceUri()),
            request.getResizeOptions(),
            request.getRotationOptions(),
            request.getImageDecodeOptions(),
            postprocessorCacheKey,
            postprocessorName,
            callerContext);
}
 
开发者ID:senierr,项目名称:ModuleFrame,代码行数:22,代码来源:DefaultCacheKeyFactory.java

示例5: produceResults

import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
@Override
public void produceResults(
    final Consumer<CloseableReference<CloseableImage>> consumer,
    final ProducerContext producerContext) {

  final ProducerListener listener = producerContext.getListener();
  final String requestId = producerContext.getId();
  final ImageRequest imageRequest = producerContext.getImageRequest();
  final Object callerContext = producerContext.getCallerContext();

  // If there's no postprocessor or the postprocessor doesn't require caching, forward results.
  final Postprocessor postprocessor = imageRequest.getPostprocessor();
  if (postprocessor == null || postprocessor.getPostprocessorCacheKey() == null) {
    mInputProducer.produceResults(consumer, producerContext);
    return;
  }
  listener.onProducerStart(requestId, getProducerName());
  final CacheKey cacheKey =
      mCacheKeyFactory.getPostprocessedBitmapCacheKey(imageRequest, callerContext);
  CloseableReference<CloseableImage> cachedReference = mMemoryCache.get(cacheKey);
  if (cachedReference != null) {
    listener.onProducerFinishWithSuccess(
        requestId,
        getProducerName(),
        listener.requiresExtraMap(requestId) ? ImmutableMap.of(VALUE_FOUND, "true") : null);
    listener.onUltimateProducerReached(requestId, PRODUCER_NAME, true);
    consumer.onProgressUpdate(1.0f);
    consumer.onNewResult(cachedReference, Consumer.IS_LAST);
    cachedReference.close();
  } else {
    final boolean isRepeatedProcessor = postprocessor instanceof RepeatedPostprocessor;
    Consumer<CloseableReference<CloseableImage>> cachedConsumer = new CachedPostprocessorConsumer(
        consumer,
        cacheKey,
        isRepeatedProcessor,
        mMemoryCache);
    listener.onProducerFinishWithSuccess(
        requestId,
        getProducerName(),
        listener.requiresExtraMap(requestId) ? ImmutableMap.of(VALUE_FOUND, "false") : null);
    mInputProducer.produceResults(cachedConsumer, producerContext);
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:44,代码来源:PostprocessedBitmapMemoryCacheProducer.java


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