类com.bumptech.glide.load.ResourceDecoder源码实例Demo

下面列出了怎么用com.bumptech.glide.load.ResourceDecoder的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: giffun   文件: CacheLoader.java

public <Z> Resource<Z> load(Key key, ResourceDecoder<File, Z> decoder, int width, int height) {
    File fromCache = diskCache.get(key);
    if (fromCache == null) {
        return null;
    }

    Resource<Z> result = null;
    try {
        result = decoder.decode(fromCache, width, height);
    } catch (IOException e) {
        if (Log.isLoggable(TAG, Log.DEBUG)) {
            Log.d(TAG, "Exception decoding image from cache", e);
        }
    }
    if (result == null) {
        if (Log.isLoggable(TAG, Log.DEBUG)) {
            Log.d(TAG, "Failed to decode image from cache or not present in cache");
        }
        diskCache.delete(key);
    }
    return result;
}
 

GifBitmapWrapperResourceDecoder(ResourceDecoder<ImageVideoWrapper, Bitmap> bitmapDecoder,
        ResourceDecoder<InputStream, GifDrawable> gifDecoder, BitmapPool bitmapPool, ImageTypeParser parser,
        BufferedStreamFactory streamFactory) {
    this.bitmapDecoder = bitmapDecoder;
    this.gifDecoder = gifDecoder;
    this.bitmapPool = bitmapPool;
    this.parser = parser;
    this.streamFactory = streamFactory;
}
 
源代码3 项目: giffun   文件: EngineKey.java

public EngineKey(String id, Key signature, int width, int height, ResourceDecoder cacheDecoder,
        ResourceDecoder decoder, Transformation transformation, ResourceEncoder encoder,
        ResourceTranscoder transcoder, Encoder sourceEncoder) {
    this.id = id;
    this.signature = signature;
    this.width = width;
    this.height = height;
    this.cacheDecoder = cacheDecoder;
    this.decoder = decoder;
    this.transformation = transformation;
    this.encoder = encoder;
    this.transcoder = transcoder;
    this.sourceEncoder = sourceEncoder;
}
 
源代码4 项目: giffun   文件: EngineKeyFactory.java

@SuppressWarnings("rawtypes")
public EngineKey buildKey(String id, Key signature, int width, int height, ResourceDecoder cacheDecoder,
        ResourceDecoder sourceDecoder, Transformation transformation, ResourceEncoder encoder,
        ResourceTranscoder transcoder, Encoder sourceEncoder) {
    return new EngineKey(id, signature, width, height, cacheDecoder, sourceDecoder, transformation, encoder,
            transcoder, sourceEncoder);
}
 
源代码5 项目: giffun   文件: ChildLoadProvider.java

/**
 * {@inheritDoc}
 */
@Override
public ResourceDecoder<File, Z> getCacheDecoder() {
    if (cacheDecoder != null) {
        return cacheDecoder;
    } else {
        return parent.getCacheDecoder();
    }
}
 
源代码6 项目: giffun   文件: ChildLoadProvider.java

/**
 * {@inheritDoc}
 */
@Override
public ResourceDecoder<T, Z> getSourceDecoder() {
    if (sourceDecoder != null) {
        return sourceDecoder;
    } else {
        return parent.getSourceDecoder();
    }
}
 

public PaletteBitmapDecoder(
		BitmapPool bitmapPool,
		ResourceDecoder<InputStream, Bitmap> bitmapDecoder,
		ResourceDecoder<InputStream, Palette> paletteDecoder) {
	this.bitmapPool = bitmapPool;
	this.paletteDecoder = paletteDecoder;
	this.bitmapDecoder = bitmapDecoder;
}
 
源代码8 项目: giffun   文件: GifDrawableLoadProvider.java

@Override
public ResourceDecoder<File, GifDrawable> getCacheDecoder() {
    return cacheDecoder;
}
 
源代码9 项目: giffun   文件: GifDrawableLoadProvider.java

@Override
public ResourceDecoder<InputStream, GifDrawable> getSourceDecoder() {
    return decoder;
}
 

@Override
public ResourceDecoder<File, Bitmap> getCacheDecoder() {
    return cacheDecoder;
}
 

@Override
public ResourceDecoder<InputStream, Bitmap> getSourceDecoder() {
    return decoder;
}
 

@Override
public ResourceDecoder<File, Bitmap> getCacheDecoder() {
    return cacheDecoder;
}
 

@Override
public ResourceDecoder<ParcelFileDescriptor, Bitmap> getSourceDecoder() {
    return sourceDecoder;
}
 
源代码14 项目: giffun   文件: ImageVideoBitmapDecoder.java

public ImageVideoBitmapDecoder(ResourceDecoder<InputStream, Bitmap> streamDecoder,
        ResourceDecoder<ParcelFileDescriptor, Bitmap> fileDescriptorDecoder) {
    this.streamDecoder = streamDecoder;
    this.fileDescriptorDecoder = fileDescriptorDecoder;
}
 
源代码15 项目: giffun   文件: ImageVideoDataLoadProvider.java

@Override
public ResourceDecoder<File, Bitmap> getCacheDecoder() {
    return cacheDecoder;
}
 
源代码16 项目: giffun   文件: ImageVideoDataLoadProvider.java

@Override
public ResourceDecoder<ImageVideoWrapper, Bitmap> getSourceDecoder() {
    return sourceDecoder;
}
 
源代码17 项目: giffun   文件: FileToStreamDecoder.java

public FileToStreamDecoder(ResourceDecoder<InputStream, T> streamDecoder) {
    this(streamDecoder, DEFAULT_FILE_OPENER);
}
 
源代码18 项目: giffun   文件: FileToStreamDecoder.java

FileToStreamDecoder(ResourceDecoder<InputStream, T> streamDecoder, FileOpener fileOpener) {
    this.streamDecoder = streamDecoder;
    this.fileOpener = fileOpener;
}
 
源代码19 项目: giffun   文件: StreamFileDataLoadProvider.java

@Override
public ResourceDecoder<File, File> getCacheDecoder() {
    return cacheDecoder;
}
 
源代码20 项目: giffun   文件: StreamFileDataLoadProvider.java

@Override
public ResourceDecoder<InputStream, File> getSourceDecoder() {
    return ERROR_DECODER;
}
 

@Override
public ResourceDecoder<File, GifBitmapWrapper> getCacheDecoder() {
    return cacheDecoder;
}
 

@Override
public ResourceDecoder<ImageVideoWrapper, GifBitmapWrapper> getSourceDecoder() {
    return sourceDecoder;
}
 

public GifBitmapWrapperResourceDecoder(ResourceDecoder<ImageVideoWrapper, Bitmap> bitmapDecoder,
        ResourceDecoder<InputStream, GifDrawable> gifDecoder, BitmapPool bitmapPool) {
    this(bitmapDecoder, gifDecoder, bitmapPool, DEFAULT_PARSER, DEFAULT_STREAM_FACTORY);
}
 

public GifBitmapWrapperStreamResourceDecoder(
        ResourceDecoder<ImageVideoWrapper, GifBitmapWrapper> gifBitmapDecoder) {
    this.gifBitmapDecoder = gifBitmapDecoder;
}
 
源代码25 项目: giffun   文件: EmptyDataLoadProvider.java

@Override
public ResourceDecoder<File, Z> getCacheDecoder() {
    return null;
}
 
源代码26 项目: giffun   文件: EmptyDataLoadProvider.java

@Override
public ResourceDecoder<T, Z> getSourceDecoder() {
    return null;
}
 
源代码27 项目: giffun   文件: FixedLoadProvider.java

/**
 * {@inheritDoc}
 */
@Override
public ResourceDecoder<File, Z> getCacheDecoder() {
    return dataLoadProvider.getCacheDecoder();
}
 
源代码28 项目: giffun   文件: FixedLoadProvider.java

/**
 * {@inheritDoc}
 */
@Override
public ResourceDecoder<T, Z> getSourceDecoder() {
    return dataLoadProvider.getSourceDecoder();
}
 

public StreamAnimationDecoder(ResourceDecoder<ByteBuffer, Drawable> byteBufferDecoder) {
    this.byteBufferDecoder = byteBufferDecoder;
}
 
源代码30 项目: glide-support   文件: PaletteCacheDecoder.java

public PaletteCacheDecoder(
		ResourceDecoder<InputStream, Palette> paletteDecoder,
		ResourceDecoder<InputStream, Bitmap> bitmapDecoder) {
	this.paletteDecoder = paletteDecoder;
	this.bitmapDecoder = bitmapDecoder;
}
 
 类所在包
 同包方法