Package-level declarations

Types

Link copied to clipboard
data class RenderBlock(var inBound: Boolean = false, var inSampleSize: Int = 1, var renderOffset: IntOffset = IntOffset.Zero, var renderSize: IntSize = IntSize.Zero, var sliceRect: Rect = Rect(0, 0, 0, 0), bitmap: Bitmap? = null)
Link copied to clipboard
class RotationIllegalException(msg: String = "Illegal rotation angle.") : RuntimeException
Link copied to clipboard
data class SamplingCanvasViewPort(val scale: Float, val visualRect: Rect)

渲染的视口对象

Link copied to clipboard
class SamplingDecoder(decoder: BitmapRegionDecoder, rotation: SamplingDecoder.Rotation = Rotation.ROTATION_0, onRelease: () -> Unit = {}, thumbnails: Bitmap? = null) : CoroutineScope

用以提供SamplingCanvas显示大型图片,rememberSamplingDecoder,createSamplingDecoder

Properties

Functions

Link copied to clipboard
fun calculateInSampleSize(srcWidth: Int, reqWidth: Int): Int
Link copied to clipboard
fun checkRectInBound(stX1: Float, stY1: Float, edX1: Float, edY1: Float, stX2: Float, stY2: Float, edX2: Float, edY2: Float): Boolean
Link copied to clipboard

通过流创建BitmapRegionDecoder

Link copied to clipboard

通过文件创建SamplingDecoder

fun createSamplingDecoder(decoder: BitmapRegionDecoder, rotation: SamplingDecoder.Rotation = SamplingDecoder.Rotation.ROTATION_0): SamplingDecoder

创建SamplingDecoder的主要方法

Link copied to clipboard

通过Exif接口获取SamplingDecoder的旋转方向

Link copied to clipboard

从ZoomableView状态直接获取当前视口对象

Link copied to clipboard
fun rememberSamplingDecoder(inputStream: InputStream, rotation: SamplingDecoder.Rotation = SamplingDecoder.Rotation.ROTATION_0): Pair<SamplingDecoder?, Exception?>

创建SamplingDecoder的方法

Link copied to clipboard

用于ImageViewer/ZoomableView进行分块显示大型图片的配套组件