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


Java SimpleProgressiveJpegConfig.DynamicValueConfig方法代码示例

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


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