ImageDriver

interface ImageDriver(source)

ImageDriver is responsible for probing, loading and saving images

Since

0.4.3

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun imageToDataUrl(imageData: ImageData, formatHint: ImageFileFormat?): String

Convert an image to a data-url

Link copied to clipboard
abstract fun loadCubemapImage(fileOrUrl: String, formatHint: ImageFileFormat?): CubemapImageData

Loads a cubemap image from a file or URL. A cubemap is a texture typically used in 3D rendering, consisting of six images representing the sides of a cube.

abstract fun loadCubemapImage(buffer: MPPBuffer, name: String?, formatHint: ImageFileFormat?): CubemapImageData

Loads a cubemap image from the provided buffer. The cubemap is typically a texture with six faces corresponding to the sides of a cube, used in 3D rendering.

Link copied to clipboard
abstract fun loadImage(fileOrUrl: String, formatHint: ImageFileFormat?, allowSRGB: Boolean, details: ImageFileDetails?): ImageData

Loads an image from a file path or URL.

abstract fun loadImage(buffer: MPPBuffer, name: String?, formatHint: ImageFileFormat?, allowSRGB: Boolean, details: ImageFileDetails? = null): ImageData

Loads an image from the provided buffer.

Link copied to clipboard
abstract fun probeImage(fileOrUrl: String): ImageFileDetails?

Probe an image located at fileOrUrl

abstract fun probeImage(buffer: MPPBuffer, formatHint: ImageFileFormat?): ImageFileDetails?

Probe an image from buffer

Link copied to clipboard
open fun saveImage(imageData: ImageData, filename: String, saveContext: ImageSaveContext.() -> ImageSaveConfiguration)

Saves the provided image data to the specified filename using a custom save configuration.

open fun saveImage(imageData: ImageData, filename: String, formatHint: ImageFileFormat?)

Save an image to filename

abstract fun saveImage(imageData: ImageData, filename: String, configuration: ImageSaveConfiguration)

Saves the provided image data to the specified filename using the given configuration.