类 Avif
- java.lang.Object
-
- com.tencent.qcloud.image.avif.Avif
-
public class Avif extends java.lang.ObjectAVIF解码工具类
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classAvif.AvifFrame动图解码一帧返回内容 包括位图和延时
-
字段概要
字段 修饰符和类型 字段 说明 static intAVIF_HEADER_SIZE
-
构造器概要
构造器 构造器 说明 Avif()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static com.tencent.libqcloudavif.AvifImageanimationDecodeFrame(com.tencent.libqcloudavif.AvifDecoder decoder, long bytesLength, int index)通过解码器解码其中一帧(需要提前创建AvifDecoder)static Avif.AvifFrameanimationDecodeFrame(com.tencent.libqcloudavif.AvifDecoder decoder, long bytesLength, int index, android.graphics.Bitmap bitmap)通过解码器解码其中一帧(需要提前创建AvifDecoder)static android.graphics.Bitmapdecode(byte[] bytes)原图解码static android.graphics.Bitmapdecode(byte[] bytes, int dstWidth)宽度等比解码static android.graphics.Bitmapdecode(byte[] bytes, int x, int y, int width, int height, int inSampleSize)区域缩放解码static android.graphics.Bitmapdecode(byte[] bytes, int dstWidth, android.graphics.Bitmap bitmap, com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool bitmapPool)宽度等比解码static android.graphics.Bitmapdecode(byte[] bytes, int dstWidth, com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool bitmapPool)宽度等比解码static android.graphics.Bitmapdecode(com.tencent.libqcloudavif.AvifDecoder decoder, int dstWidth, long dataSize, android.graphics.Bitmap bitmap, com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool bitmapPool)宽度等比解码static Avif.AvifFramedecodeAnimationFrame(byte[] bytes, int index)解码动图某一帧static Avif.AvifFramedecodeAnimationFrame(byte[] bytes, int index, android.graphics.Bitmap bitmap)解码动图某一帧static android.graphics.BitmapdecodeRegion(com.tencent.libqcloudavif.AvifDecoder decoder, long bytesLength, int x, int y, int width, int height, int inSampleSize)局部解码(需要提前创建AvifDecoder并nextImage)static com.tencent.libqcloudavif.AvifDecodergetAvifDecoder(byte[] buffer)static com.tencent.libqcloudavif.AvifDecodergetAvifDecoder(java.nio.ByteBuffer source)static android.graphics.PointgetDecoderWH(byte[] buffer)static booleanisAvif(byte[] buffer)static booleanisAvif(java.io.InputStream source, com.bumptech.glide.load.engine.bitmap_recycle.ArrayPool byteArrayPool)static booleanisAvif(java.nio.ByteBuffer source)static booleanisAvis(byte[] buffer)static booleanisAvis(java.io.InputStream source, com.bumptech.glide.load.engine.bitmap_recycle.ArrayPool byteArrayPool)static booleanisAvis(java.nio.ByteBuffer source)static android.graphics.PointproportionalScaling(int imageWidth, int imageHeight, int dstWidth)根据原图宽高和目标宽度 计算目标高度
-
-
-
字段详细资料
-
AVIF_HEADER_SIZE
public static final int AVIF_HEADER_SIZE
- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
decode
public static android.graphics.Bitmap decode(@NonNull byte[] bytes)原图解码- 参数:
bytes- 图片的字节数组- 返回:
- 结果bitmap
-
decode
public static android.graphics.Bitmap decode(@NonNull byte[] bytes, int dstWidth)宽度等比解码- 参数:
bytes- 图片的字节数组dstWidth- 解码目标宽度(仅支持等比缩小)- 返回:
- 结果bitmap
-
decode
public static android.graphics.Bitmap decode(@NonNull byte[] bytes, int dstWidth, @NonNull com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool bitmapPool)宽度等比解码- 参数:
bytes- 图片的字节数组dstWidth- 解码目标宽度(仅支持等比缩小)bitmapPool- 用于获取bitmap的bitmapPool- 返回:
- 结果bitmap
-
decode
public static android.graphics.Bitmap decode(@NonNull byte[] bytes, int dstWidth, @Nullable android.graphics.Bitmap bitmap, @Nullable com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool bitmapPool)宽度等比解码- 参数:
bytes- 图片的字节数组dstWidth- 解码目标宽度(仅支持等比缩小)bitmap- 解码到该位图(也可以传空 将会生成一个新的位图)bitmapPool- 用于获取bitmap的bitmapPool- 返回:
- 结果bitmap
-
decode
public static android.graphics.Bitmap decode(byte[] bytes, int x, int y, int width, int height, int inSampleSize)区域缩放解码- 参数:
bytes- 图片的字节数组x- 区域左上角x坐标y- 区域左上角y坐标width- 区域宽度height- 区域高度inSampleSize- 缩放比, 大于1的时候才生效,小于等于1的情况下不作缩放- 返回:
- 结果bitmap
-
proportionalScaling
public static android.graphics.Point proportionalScaling(int imageWidth, int imageHeight, int dstWidth)根据原图宽高和目标宽度 计算目标高度- 参数:
imageWidth- 原图宽度imageHeight- 原图高度dstWidth- 目标宽度- 返回:
- 目标宽高
-
decode
public static android.graphics.Bitmap decode(@NonNull com.tencent.libqcloudavif.AvifDecoder decoder, int dstWidth, long dataSize, @Nullable android.graphics.Bitmap bitmap, @Nullable com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool bitmapPool)宽度等比解码- 参数:
decoder- avif解码器实例dstWidth- 解码目标宽度(仅支持等比缩小)dataSize- 需要解码的数据大小bitmap- 解码到该位图(也可以传空 将会生成一个新的位图)bitmapPool- 用于获取bitmap的bitmapPool- 返回:
- 结果bitmap
-
animationDecodeFrame
public static Avif.AvifFrame animationDecodeFrame(@NonNull com.tencent.libqcloudavif.AvifDecoder decoder, long bytesLength, int index, @Nullable android.graphics.Bitmap bitmap)
通过解码器解码其中一帧(需要提前创建AvifDecoder)- 参数:
decoder- 解码器(提前创建AvifDecoder)bytesLength- 需要解码的数据长度index- 帧索引bitmap- 解码到该位图(也可以传空 将会生成一个新的位图在TpgFrame中返回)- 返回:
- 动图解码一帧返回内容 包括位图和延时
-
animationDecodeFrame
public static com.tencent.libqcloudavif.AvifImage animationDecodeFrame(@NonNull com.tencent.libqcloudavif.AvifDecoder decoder, long bytesLength, int index)通过解码器解码其中一帧(需要提前创建AvifDecoder)- 参数:
decoder- 解码器(提前创建AvifDecoder)bytesLength- 需要解码的数据长度index- 帧索引- 返回:
- 动图解码一帧返回内容 包括位图和延时
-
decodeAnimationFrame
public static Avif.AvifFrame decodeAnimationFrame(@NonNull byte[] bytes, int index)
解码动图某一帧- 参数:
bytes- 需要解码的数据(字节数组)index- 帧索引- 返回:
- 动图解码一帧返回内容 包括位图和延时
-
decodeAnimationFrame
public static Avif.AvifFrame decodeAnimationFrame(@NonNull byte[] bytes, int index, @Nullable android.graphics.Bitmap bitmap)
解码动图某一帧- 参数:
bytes- 需要解码的数据(字节数组)index- 帧索引bitmap- 解码到该位图(也可以传空 将会生成一个新的位图在TpgFrame中返回)- 返回:
- 动图解码一帧返回内容 包括位图和延时
-
decodeRegion
public static android.graphics.Bitmap decodeRegion(@NonNull com.tencent.libqcloudavif.AvifDecoder decoder, long bytesLength, int x, int y, int width, int height, int inSampleSize)局部解码(需要提前创建AvifDecoder并nextImage)- 参数:
decoder- 解码器(提前创建AvifDecoder并nextImage)bytesLength- 需要解码的数据长度x- 区域左上角x坐标y- 区域左上角y坐标width- 区域宽度height- 区域高度inSampleSize- 缩放比, 大于1的时候才生效,小于等于1的情况下不作缩放- 返回:
- 解码位图
-
isAvif
public static boolean isAvif(byte[] buffer)
-
isAvif
public static boolean isAvif(@NonNull java.io.InputStream source, @NonNull com.bumptech.glide.load.engine.bitmap_recycle.ArrayPool byteArrayPool)
-
isAvif
public static boolean isAvif(@NonNull java.nio.ByteBuffer source)
-
isAvis
public static boolean isAvis(byte[] buffer)
-
isAvis
public static boolean isAvis(@NonNull java.io.InputStream source, @NonNull com.bumptech.glide.load.engine.bitmap_recycle.ArrayPool byteArrayPool)
-
isAvis
public static boolean isAvis(@NonNull java.nio.ByteBuffer source)
-
getAvifDecoder
public static com.tencent.libqcloudavif.AvifDecoder getAvifDecoder(byte[] buffer)
-
getAvifDecoder
public static com.tencent.libqcloudavif.AvifDecoder getAvifDecoder(@NonNull java.nio.ByteBuffer source)
-
getDecoderWH
public static android.graphics.Point getDecoderWH(byte[] buffer)
-
-