com.bumptech.glide.Registry.setResourceDecoderBucketPriorityList()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(216)

本文整理了Java中com.bumptech.glide.Registry.setResourceDecoderBucketPriorityList方法的一些代码示例,展示了Registry.setResourceDecoderBucketPriorityList的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Registry.setResourceDecoderBucketPriorityList方法的具体详情如下:
包路径:com.bumptech.glide.Registry
类名称:Registry
方法名:setResourceDecoderBucketPriorityList

Registry.setResourceDecoderBucketPriorityList介绍

[英]Overrides the default ordering of resource decoder buckets. You may also add custom buckets which are identified as a unique string. Glide will attempt to decode using decoders in the highest priority bucket before moving on to the next one.

The default order is [ #BUCKET_GIF, #BUCKET_BITMAP, #BUCKET_BITMAP_DRAWABLE].

When registering decoders, you can use these buckets to specify the ordering relative only to other decoders in that bucket.
[中]覆盖资源解码器存储桶的默认顺序。您还可以添加被标识为唯一字符串的自定义存储桶。Glide将尝试使用最高优先级存储桶中的解码器进行解码,然后再进入下一个存储桶。
默认顺序为[#BUCKET_GIF、#BUCKET_BITMAP、#BUCKET_BITMAP_DRAWABLE]。
注册解码器时,可以使用这些桶来指定仅相对于该桶中其他解码器的顺序。

代码示例

代码示例来源:origin: bumptech/glide

public Registry() {
 this.modelLoaderRegistry = new ModelLoaderRegistry(throwableListPool);
 this.encoderRegistry = new EncoderRegistry();
 this.decoderRegistry = new ResourceDecoderRegistry();
 this.resourceEncoderRegistry = new ResourceEncoderRegistry();
 this.dataRewinderRegistry = new DataRewinderRegistry();
 this.transcoderRegistry = new TranscoderRegistry();
 this.imageHeaderParserRegistry = new ImageHeaderParserRegistry();
 setResourceDecoderBucketPriorityList(
   Arrays.asList(BUCKET_GIF, BUCKET_BITMAP, BUCKET_BITMAP_DRAWABLE));
}

代码示例来源:origin: mozilla-tw/Rocket

public Registry() {
 this.modelLoaderRegistry = new ModelLoaderRegistry(exceptionListPool);
 this.encoderRegistry = new EncoderRegistry();
 this.decoderRegistry = new ResourceDecoderRegistry();
 this.resourceEncoderRegistry = new ResourceEncoderRegistry();
 this.dataRewinderRegistry = new DataRewinderRegistry();
 this.transcoderRegistry = new TranscoderRegistry();
 this.imageHeaderParserRegistry = new ImageHeaderParserRegistry();
 setResourceDecoderBucketPriorityList(
   Arrays.asList(BUCKET_GIF, BUCKET_BITMAP, BUCKET_BITMAP_DRAWABLE));
}

相关文章