本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
}