All Downloads are FREE. Search and download functionalities are using the official Maven repository.

iosMain.com.seiko.imageloader.util.UIImageExt.kt Maven / Gradle / Ivy

The newest version!
package com.seiko.imageloader.util

import kotlinx.cinterop.ExperimentalForeignApi
import org.jetbrains.skia.Image
import platform.CoreGraphics.CGImageRef
import platform.UIKit.UIImage

@OptIn(ExperimentalForeignApi::class)
fun UIImage.toSkiaImage(): Image {
    val cgImage: CGImageRef = this.CGImage()
        ?: throw IllegalArgumentException("can't read CGImage of $this")
    return cgImage.toSkiaImage()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy