本文整理汇总了Java中com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory类的典型用法代码示例。如果您正苦于以下问题:Java PlatformBitmapFactory类的具体用法?Java PlatformBitmapFactory怎么用?Java PlatformBitmapFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlatformBitmapFactory类属于com.facebook.imagepipeline.bitmaps包,在下文中一共展示了PlatformBitmapFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: BitmapAnimationBackend
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
public BitmapAnimationBackend(
PlatformBitmapFactory platformBitmapFactory,
BitmapFrameCache bitmapFrameCache,
AnimationInformation animationInformation,
BitmapFrameRenderer bitmapFrameRenderer,
@Nullable BitmapFramePreparationStrategy bitmapFramePreparationStrategy,
@Nullable BitmapFramePreparer bitmapFramePreparer) {
mPlatformBitmapFactory = platformBitmapFactory;
mBitmapFrameCache = bitmapFrameCache;
mAnimationInformation = animationInformation;
mBitmapFrameRenderer = bitmapFrameRenderer;
mBitmapFramePreparationStrategy = bitmapFramePreparationStrategy;
mBitmapFramePreparer = bitmapFramePreparer;
mPaint = new Paint(Paint.FILTER_BITMAP_FLAG | Paint.DITHER_FLAG);
updateBitmapDimensions();
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:BitmapAnimationBackend.java
示例2: ExperimentalBitmapAnimationDrawableFactory
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
public ExperimentalBitmapAnimationDrawableFactory(
AnimatedDrawableBackendProvider animatedDrawableBackendProvider,
ScheduledExecutorService scheduledExecutorServiceForUiThread,
ExecutorService executorServiceForFramePreparing,
MonotonicClock monotonicClock,
PlatformBitmapFactory platformBitmapFactory,
CountingMemoryCache<CacheKey, CloseableImage> backingCache,
Supplier<Integer> cachingStrategySupplier,
Supplier<Integer> numberOfFramesToPrepareSupplier) {
mAnimatedDrawableBackendProvider = animatedDrawableBackendProvider;
mScheduledExecutorServiceForUiThread = scheduledExecutorServiceForUiThread;
mExecutorServiceForFramePreparing = executorServiceForFramePreparing;
mMonotonicClock = monotonicClock;
mPlatformBitmapFactory = platformBitmapFactory;
mBackingCache = backingCache;
mCachingStrategySupplier = cachingStrategySupplier;
mNumberOfFramesToPrepareSupplier = numberOfFramesToPrepareSupplier;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:ExperimentalBitmapAnimationDrawableFactory.java
示例3: CountingMemoryCache
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
public CountingMemoryCache(
ValueDescriptor<V> valueDescriptor,
CacheTrimStrategy cacheTrimStrategy,
Supplier<MemoryCacheParams> memoryCacheParamsSupplier,
PlatformBitmapFactory platformBitmapFactory,
boolean isExternalCreatedBitmapLogEnabled) {
mValueDescriptor = valueDescriptor;
mExclusiveEntries = new CountingLruMap<>(wrapValueDescriptor(valueDescriptor));
mCachedEntries = new CountingLruMap<>(wrapValueDescriptor(valueDescriptor));
mCacheTrimStrategy = cacheTrimStrategy;
mMemoryCacheParamsSupplier = memoryCacheParamsSupplier;
mMemoryCacheParams = mMemoryCacheParamsSupplier.get();
mLastCacheParamsCheck = SystemClock.uptimeMillis();
if (isExternalCreatedBitmapLogEnabled) {
platformBitmapFactory.setCreationListener(
new PlatformBitmapFactory.BitmapCreationObserver() {
@Override
public void onBitmapCreated(
Bitmap bitmap,
Object callerContext) {
mOtherEntries.put(bitmap, callerContext);
}
});
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:CountingMemoryCache.java
示例4: getAnimatedFactory
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
public static AnimatedFactory getAnimatedFactory(
PlatformBitmapFactory platformBitmapFactory,
ExecutorSupplier executorSupplier,
CountingMemoryCache<CacheKey, CloseableImage> backingCache) {
if (!sImplLoaded) {
try {
final Class<?> clazz =
Class.forName("com.facebook.fresco.animation.factory.AnimatedFactoryV2Impl");
final Constructor<?> constructor = clazz.getConstructor(
PlatformBitmapFactory.class,
ExecutorSupplier.class,
CountingMemoryCache.class);
sImpl = (AnimatedFactory) constructor.newInstance(
platformBitmapFactory,
executorSupplier,
backingCache);
} catch (Throwable e) {
// Head in the sand
}
if (sImpl != null) {
sImplLoaded = true;
}
}
return sImpl;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:AnimatedFactoryProvider.java
示例5: process
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
/**
* Clients should override this method only if the post-processed bitmap has to be of a different
* size than the source bitmap. If the post-processed bitmap is of the same size, clients should
* override one of the other two methods.
*
* <p> The source bitmap must not be modified as it may be shared by the other clients. The
* implementation must create a new bitmap that is safe to be modified and return a reference
* to it. Clients should use <code>bitmapFactory</code> to create a new bitmap.
*
* @param sourceBitmap The source bitmap.
* @param bitmapFactory The factory to create a destination bitmap.
* @return a reference to the newly created bitmap
*/
@Override
public CloseableReference<Bitmap> process(
Bitmap sourceBitmap,
PlatformBitmapFactory bitmapFactory) {
final Bitmap.Config sourceBitmapConfig = sourceBitmap.getConfig();
CloseableReference<Bitmap> destBitmapRef =
bitmapFactory.createBitmapInternal(
sourceBitmap.getWidth(),
sourceBitmap.getHeight(),
sourceBitmapConfig != null ? sourceBitmapConfig : FALLBACK_BITMAP_CONFIGURATION);
try {
process(destBitmapRef.get(), sourceBitmap);
return CloseableReference.cloneOrNull(destBitmapRef);
} finally {
CloseableReference.closeSafely(destBitmapRef);
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:31,代码来源:BasePostprocessor.java
示例6: createProducerFactory
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
ProducerFactory createProducerFactory(
Context context,
ByteArrayPool byteArrayPool,
ImageDecoder imageDecoder,
ProgressiveJpegConfig progressiveJpegConfig,
boolean downsampleEnabled,
boolean resizeAndRotateEnabledForNetwork,
boolean decodeCancellationEnabled,
Supplier<Boolean> experimentalSmartResizingEnabled,
ExecutorSupplier executorSupplier,
PooledByteBufferFactory pooledByteBufferFactory,
MemoryCache<CacheKey, CloseableImage> bitmapMemoryCache,
MemoryCache<CacheKey, PooledByteBuffer> encodedMemoryCache,
BufferedDiskCache defaultBufferedDiskCache,
BufferedDiskCache smallImageBufferedDiskCache,
MediaVariationsIndex mediaVariationsIndex,
CacheKeyFactory cacheKeyFactory,
PlatformBitmapFactory platformBitmapFactory,
int bitmapPrepareToDrawMinSizeBytes,
int bitmapPrepareToDrawMaxSizeBytes,
boolean bitmapPrepareToDrawForPrefetch);
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:ImagePipelineExperiments.java
示例7: process
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
@Override
public CloseableReference<Bitmap> process(
Bitmap sourceBitmap,
PlatformBitmapFactory bitmapFactory) {
final CloseableReference<Bitmap> bitmapRef = bitmapFactory.createBitmap(
sourceBitmap.getWidth() / SCALE_RATIO,
sourceBitmap.getHeight() / SCALE_RATIO);
try {
final Bitmap destBitmap = bitmapRef.get();
final Canvas canvas = new Canvas(destBitmap);
canvas.drawBitmap(
sourceBitmap,
null,
new Rect(0, 0, destBitmap.getWidth(), destBitmap.getHeight()),
mPaint);
NativeBlurFilter.iterativeBoxBlur(destBitmap, mIterations, mBlurRadius / SCALE_RATIO);
return CloseableReference.cloneOrNull(bitmapRef);
} finally {
CloseableReference.closeSafely(bitmapRef);
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:ScalingBlurPostprocessor.java
示例8: process
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
@Override
public CloseableReference<Bitmap> process(Bitmap sourceBitmap, PlatformBitmapFactory bitmapFactory) {
float scale = 1.0f * width / sourceBitmap.getWidth();
Log.e("ReScalePostprocessor", "scale:" + scale);
scaledWidth = (int) (sourceBitmap.getWidth() * scale);
scaledHeight = (int) (sourceBitmap.getHeight() * scale);
listener.onProcessFinished(scaledWidth, scaledHeight);
Matrix matrix = new Matrix();
matrix.postScale(scale, scale);
Bitmap bitmap = Bitmap.createBitmap(sourceBitmap, 0, 0, sourceBitmap.getWidth(), sourceBitmap.getHeight(), matrix, true);
CloseableReference<Bitmap> bitmapRef = bitmapFactory.createBitmap(bitmap);
try {
return CloseableReference.cloneOrNull(bitmapRef);
} finally {
CloseableReference.closeSafely(bitmapRef);
}
}
开发者ID:Bleoo,项目名称:WindowImageView,代码行数:21,代码来源:ReScalePostprocessor.java
示例9: process
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
@Override
public CloseableReference<Bitmap> process(Bitmap sourceBitmap, PlatformBitmapFactory bitmapFactory) {
CloseableReference<Bitmap> bitmapRef;
if (isFull) {
bitmapRef = bitmapFactory.createBitmap(
sourceBitmap.getWidth() / 2,
sourceBitmap.getHeight());
} else {
bitmapRef = bitmapFactory.createBitmap(
sourceBitmap.getWidth(),
sourceBitmap.getHeight());
}
try {
Bitmap destBitmap = bitmapRef.get();
Canvas canvas2d = new Canvas(destBitmap);
canvas2d.drawBitmap(sourceBitmap,
new Rect(0, 0, sourceBitmap.getWidth() / 2, sourceBitmap.getHeight()),
new Rect(0, 0, destBitmap.getWidth(), destBitmap.getHeight()), null);
return CloseableReference.cloneOrNull(bitmapRef);
} finally {
CloseableReference.closeSafely(bitmapRef);
}
}
开发者ID:senierr,项目名称:ModuleFrame,代码行数:26,代码来源:SBSPostProcessor.java
示例10: process
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
@Override
public CloseableReference<Bitmap> process(
Bitmap sourceBitmap,
PlatformBitmapFactory bitmapFactory) {
final CloseableReference<Bitmap> bitmapRef =
bitmapFactory.createBitmap(
sourceBitmap.getWidth() / mScaleRatio, sourceBitmap.getHeight() / mScaleRatio);
try {
final Bitmap destBitmap = bitmapRef.get();
final Canvas canvas = new Canvas(destBitmap);
canvas.drawBitmap(
sourceBitmap,
null,
new Rect(0, 0, destBitmap.getWidth(), destBitmap.getHeight()),
mPaint);
NativeBlurFilter.iterativeBoxBlur(
destBitmap, mIterations, Math.max(1, mBlurRadius / mScaleRatio));
return CloseableReference.cloneOrNull(bitmapRef);
} finally {
CloseableReference.closeSafely(bitmapRef);
}
}
开发者ID:facebook,项目名称:fresco,代码行数:27,代码来源:ScalingBlurPostprocessor.java
示例11: DefaultBitmapFramePreparer
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
public DefaultBitmapFramePreparer(
PlatformBitmapFactory platformBitmapFactory,
BitmapFrameRenderer bitmapFrameRenderer,
Bitmap.Config bitmapConfig,
ExecutorService executorService) {
mPlatformBitmapFactory = platformBitmapFactory;
mBitmapFrameRenderer = bitmapFrameRenderer;
mBitmapConfig = bitmapConfig;
mExecutorService = executorService;
mPendingFrameDecodeJobs = new SparseArray<>();
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:DefaultBitmapFramePreparer.java
示例12: AnimatedFactoryV2Impl
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
@DoNotStrip
public AnimatedFactoryV2Impl(
PlatformBitmapFactory platformBitmapFactory,
ExecutorSupplier executorSupplier,
CountingMemoryCache<CacheKey, CloseableImage> backingCache) {
mPlatformBitmapFactory = platformBitmapFactory;
mExecutorSupplier = executorSupplier;
mBackingCache = backingCache;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:AnimatedFactoryV2Impl.java
示例13: get
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
public static CountingMemoryCache<CacheKey, CloseableImage> get(
Supplier<MemoryCacheParams> bitmapMemoryCacheParamsSupplier,
MemoryTrimmableRegistry memoryTrimmableRegistry,
PlatformBitmapFactory platformBitmapFactory,
boolean isExternalCreatedBitmapLogEnabled) {
return get(
bitmapMemoryCacheParamsSupplier,
memoryTrimmableRegistry,
platformBitmapFactory,
isExternalCreatedBitmapLogEnabled,
new BitmapMemoryCacheTrimStrategy());
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:BitmapCountingMemoryCacheFactory.java
示例14: setUp
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
PowerMockito.mockStatic(SystemClock.class);
PowerMockito.when(SystemClock.uptimeMillis()).thenReturn(0L);
mValueDescriptor =
new ValueDescriptor<Integer>() {
@Override
public int getSizeInBytes(Integer value) {
return value;
}
};
mParams = new MemoryCacheParams(
CACHE_MAX_SIZE,
CACHE_MAX_COUNT,
CACHE_EVICTION_QUEUE_MAX_SIZE,
CACHE_EVICTION_QUEUE_MAX_COUNT,
CACHE_ENTRY_MAX_SIZE);
when(mParamsSupplier.get()).thenReturn(mParams);
mPlatformBitmapFactory = Mockito.mock(PlatformBitmapFactory.class);
mBitmapReference = CloseableReference.of(mBitmap, FAKE_BITMAP_RESOURCE_RELEASER);
mCache = new CountingMemoryCache<>(
mValueDescriptor,
mCacheTrimStrategy,
mParamsSupplier,
mPlatformBitmapFactory,
true);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:29,代码来源:CountingMemoryCacheTest.java
示例15: testOnBitmapCreated
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
@Test
public void testOnBitmapCreated() throws Exception {
mPlatformBitmapFactory = mock(PlatformBitmapFactory.class, CALLS_REAL_METHODS);
mCache = new CountingMemoryCache<>(
mValueDescriptor,
mCacheTrimStrategy,
mParamsSupplier,
mPlatformBitmapFactory,
true);
assertEquals("other entries count mismatch", 0, mCache.mOtherEntries.size());
mPlatformBitmapFactory.addBitmapReference(mBitmapReference.get(), null);
assertEquals("other entries count mismatch" ,1, mCache.mOtherEntries.size());
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:CountingMemoryCacheTest.java
示例16: setup
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
@Before
public void setup() {
PowerMockito.mockStatic(WebPImage.class);
mWebPImageMock = mock(WebPImage.class);
mMockAnimatedDrawableBackendProvider = mock(AnimatedDrawableBackendProvider.class);
mMockBitmapFactory = mock(PlatformBitmapFactory.class);
mAnimatedImageFactory = new AnimatedImageFactoryImpl(
mMockAnimatedDrawableBackendProvider,
mMockBitmapFactory);
((AnimatedImageFactoryImpl) mAnimatedImageFactory).sWebpAnimatedImageDecoder = mWebPImageMock;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:AnimatedImageFactoryWebPImplTest.java
示例17: get
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
public static CountingMemoryCache<CacheKey, PooledByteBuffer> get(
Supplier<MemoryCacheParams> encodedMemoryCacheParamsSupplier,
MemoryTrimmableRegistry memoryTrimmableRegistry,
PlatformBitmapFactory platformBitmapFactory) {
ValueDescriptor<PooledByteBuffer> valueDescriptor =
new ValueDescriptor<PooledByteBuffer>() {
@Override
public int getSizeInBytes(PooledByteBuffer value) {
return value.size();
}
};
CountingMemoryCache.CacheTrimStrategy trimStrategy = new NativeMemoryCacheTrimStrategy();
CountingMemoryCache<CacheKey, PooledByteBuffer> countingCache =
new CountingMemoryCache<>(
valueDescriptor,
trimStrategy,
encodedMemoryCacheParamsSupplier,
platformBitmapFactory,
false);
memoryTrimmableRegistry.registerMemoryTrimmable(countingCache);
return countingCache;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:EncodedCountingMemoryCacheFactory.java
示例18: PostprocessorProducer
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
public PostprocessorProducer(
Producer<CloseableReference<CloseableImage>> inputProducer,
PlatformBitmapFactory platformBitmapFactory,
Executor executor) {
mInputProducer = Preconditions.checkNotNull(inputProducer);
mBitmapFactory = platformBitmapFactory;
mExecutor = Preconditions.checkNotNull(executor);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:PostprocessorProducer.java
示例19: buildPlatformBitmapFactory
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
/**
* Provide the implementation of the PlatformBitmapFactory for the current platform
* using the provided PoolFactory
*
* @param poolFactory The PoolFactory
* @param platformDecoder The PlatformDecoder
* @return The PlatformBitmapFactory implementation
*/
public static PlatformBitmapFactory buildPlatformBitmapFactory(
PoolFactory poolFactory,
PlatformDecoder platformDecoder) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return new ArtBitmapFactory(poolFactory.getBitmapPool());
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
return new HoneycombBitmapFactory(
new EmptyJpegGenerator(poolFactory.getPooledByteBufferFactory()),
platformDecoder);
} else {
return new GingerbreadBitmapFactory();
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:ImagePipelineFactory.java
示例20: getPlatformBitmapFactory
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory; //导入依赖的package包/类
public PlatformBitmapFactory getPlatformBitmapFactory() {
if (mPlatformBitmapFactory == null) {
mPlatformBitmapFactory = buildPlatformBitmapFactory(
mConfig.getPoolFactory(),
getPlatformDecoder());
}
return mPlatformBitmapFactory;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:ImagePipelineFactory.java
注:本文中的com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论