本文整理汇总了Java中com.facebook.imagepipeline.decoder.SimpleProgressiveJpegConfig.DynamicValueConfig方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleProgressiveJpegConfig.DynamicValueConfig方法的具体用法?Java SimpleProgressiveJpegConfig.DynamicValueConfig怎么用?Java SimpleProgressiveJpegConfig.DynamicValueConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.facebook.imagepipeline.decoder.SimpleProgressiveJpegConfig
的用法示例。
在下文中一共展示了SimpleProgressiveJpegConfig.DynamicValueConfig方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import com.facebook.imagepipeline.decoder.SimpleProgressiveJpegConfig; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
mProgressiveJpegConfig = new SimpleProgressiveJpegConfig(
new SimpleProgressiveJpegConfig.DynamicValueConfig() {
public List<Integer> getScansToDecode() {
return Arrays.asList(PREVIEW_SCAN, GOOD_ENOUGH_SCAN);
}
public int getGoodEnoughScanNumber() {
return GOOD_ENOUGH_SCAN;
}
});
PowerMockito.mockStatic(ProgressiveJpegParser.class);
PowerMockito.whenNew(ProgressiveJpegParser.class).withAnyArguments()
.thenReturn(mProgressiveJpegParser);
PowerMockito.mockStatic(JobScheduler.class);
PowerMockito.whenNew(JobScheduler.class).withAnyArguments()
.thenReturn(mJobScheduler);
when(mExperimentalResizingEnabledSupplier.get()).thenReturn(false);
mDecodeProducer =
new DecodeProducer(
mByteArrayPool,
mExecutor,
mImageDecoder,
mProgressiveJpegConfig,
false, /* Set downsampleEnabled to false */
false, /* Set resizeAndRotateForNetwork to false */
false, /* We don't cancel when the request is cancelled */
mInputProducer,
mExperimentalResizingEnabledSupplier); /* No experimental resizing */
PooledByteBuffer pooledByteBuffer = mockPooledByteBuffer(IMAGE_SIZE);
mByteBufferRef = CloseableReference.of(pooledByteBuffer);
mEncodedImage = new EncodedImage(mByteBufferRef);
mEncodedImage.setImageFormat(DefaultImageFormats.JPEG);
mEncodedImage.setWidth(IMAGE_WIDTH);
mEncodedImage.setHeight(IMAGE_HEIGHT);
mEncodedImage.setRotationAngle(IMAGE_ROTATION_ANGLE);
mEncodedImage.setExifOrientation(IMAGE_EXIF_ORIENTATION);
}