VideoDecoder.parcel(bitmapPool); ByteBufferBitmapDecoder byteBufferBitmapDecoder = new ByteBufferBitmapDecoder(downsampler); StreamBitmapDecoder streamBitmapDecoder = new StreamBitmapDecoder(downsampler, arrayPool); ResourceDrawableDecoder resourceDrawableDecoder = new ResourceDrawableDecoder(context);
public FileDescriptorBitmapDataLoadProvider(BitmapPool bitmapPool, DecodeFormat decodeFormat) { cacheDecoder = new FileToStreamDecoder<Bitmap>(new StreamBitmapDecoder(bitmapPool, decodeFormat)); sourceDecoder = new FileDescriptorBitmapDecoder(bitmapPool, decodeFormat); encoder = new BitmapEncoder(); sourceEncoder = NullEncoder.get(); }
/** * 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 request builder. */ private BitmapRequestBuilder<ModelType, TranscodeType> downsample(Downsampler downsampler) { this.downsampler = downsampler; imageDecoder = new StreamBitmapDecoder(downsampler, bitmapPool, decodeFormat); super.decoder(new ImageVideoBitmapDecoder(imageDecoder, videoDecoder)); return this; }
public StreamBitmapDataLoadProvider(BitmapPool bitmapPool, DecodeFormat decodeFormat) { sourceEncoder = new StreamEncoder(); decoder = new StreamBitmapDecoder(bitmapPool, decodeFormat); encoder = new BitmapEncoder(); cacheDecoder = new FileToStreamDecoder<Bitmap>(decoder); }
BitmapRequestBuilder(LoadProvider<ModelType, ImageVideoWrapper, Bitmap, TranscodeType> loadProvider, Class<TranscodeType> transcodeClass, GenericRequestBuilder<ModelType, ?, ?, ?> other) { super(loadProvider, transcodeClass, other); this.bitmapPool = other.glide.getBitmapPool(); this.decodeFormat = other.glide.getDecodeFormat(); imageDecoder = new StreamBitmapDecoder(bitmapPool, decodeFormat); videoDecoder = new FileDescriptorBitmapDecoder(bitmapPool, decodeFormat); }
/** * Sets the preferred format for {@link Bitmap}s decoded in this request. Defaults to * {@link DecodeFormat#PREFER_RGB_565}. This replaces any previous calls to {@link #imageDecoder(ResourceDecoder)}, * {@link #videoDecoder(ResourceDecoder)}, {@link #decoder(ResourceDecoder)} and * {@link #cacheDecoder(ResourceDecoder)}} with default decoders with the appropriate * options set. * * <p> * Note - If using a {@link Transformation} that expect bitmaps to support transparency, this should always be * set to ALWAYS_ARGB_8888. RGB_565 requires fewer bytes per pixel and is generally preferable, but it does not * support transparency. * </p> * * @see DecodeFormat * * @param format The format to use. * @return This request builder. */ public BitmapRequestBuilder<ModelType, TranscodeType> format(DecodeFormat format) { this.decodeFormat = format; imageDecoder = new StreamBitmapDecoder(downsampler, bitmapPool, format); videoDecoder = new FileDescriptorBitmapDecoder(new VideoBitmapDecoder(), bitmapPool, format); super.cacheDecoder(new FileToStreamDecoder<Bitmap>(new StreamBitmapDecoder(downsampler, bitmapPool, format))); super.decoder(new ImageVideoBitmapDecoder(imageDecoder, videoDecoder)); return this; }
new ByteBufferBitmapDecoder(downsampler)) .append(Registry.BUCKET_BITMAP, InputStream.class, Bitmap.class, new StreamBitmapDecoder(downsampler, arrayPool)) .append(Registry.BUCKET_BITMAP, ParcelFileDescriptor.class, Bitmap.class, new VideoBitmapDecoder(bitmapPool)) .append(Registry.BUCKET_BITMAP_DRAWABLE, InputStream.class, BitmapDrawable.class, new BitmapDrawableDecoder<>(resources, bitmapPool, new StreamBitmapDecoder(downsampler, arrayPool))) .append(Registry.BUCKET_BITMAP_DRAWABLE, ParcelFileDescriptor.class, BitmapDrawable.class, new BitmapDrawableDecoder<>(resources, bitmapPool, new VideoBitmapDecoder(bitmapPool)))