public ImageWrapperStreamResourceDecoder(Context context) { StreamBitmapDecoder streamBitmapDecoder = new StreamBitmapDecoder(context); FileDescriptorBitmapDecoder fileDescriptorBitmapDecoder = new FileDescriptorBitmapDecoder(context); ImageVideoBitmapDecoder imageVideoBitmapDecoder = new ImageVideoBitmapDecoder(streamBitmapDecoder, fileDescriptorBitmapDecoder); GifResourceDecoder gifResourceDecoder = new GifResourceDecoder(); BitmapPool bitmapPool = Glide.get(context).getBitmapPool(); this.gifBitmapDecoder = new ImageWrapperResourceDecoder(imageVideoBitmapDecoder, gifResourceDecoder, bitmapPool); }
public BitmapRequestBuilder<ModelType, TranscodeType> imageDecoder(ResourceDecoder<InputStream, Bitmap> decoder) { imageDecoder = decoder; super.decoder(new ImageVideoBitmapDecoder(decoder, videoDecoder)); return this; }
public BitmapRequestBuilder<ModelType, TranscodeType> videoDecoder( ResourceDecoder<ParcelFileDescriptor, Bitmap> decoder) { videoDecoder = decoder; super.decoder(new ImageVideoBitmapDecoder(imageDecoder, decoder)); return this; }
/** * Load images using the given {@link Downsampler}. Replaces any existing image decoder. Defaults to * {@link Downsampler#AT_LEAST}. Will be ignored if the data represented by the model is a video. This replaces any * previous calls to {@link #imageDecoder(ResourceDecoder)} and {@link #decoder(ResourceDecoder)} with default * decoders with the appropriate options set. * * @see #imageDecoder * * @param downsampler The downsampler * @return This RequestBuilder */ private BitmapRequestBuilder<ModelType, TranscodeType> downsample(Downsampler downsampler) { this.downsampler = downsampler; imageDecoder = new StreamBitmapDecoder(downsampler, bitmapPool, decodeFormat); super.decoder(new ImageVideoBitmapDecoder(imageDecoder, videoDecoder)); return this; }