Package-level declarations

Functions

Link copied to clipboard
fun byQuality(qualityPercent: Float): CompressionScheme

Re-encodes the image to WebP at qualityPercent (0-100).

Link copied to clipboard
fun byTargetSize(targetSizeKb: Int): CompressionScheme

Re-encodes the image to WebP, iterating quality to approximate targetSizeKb.

Link copied to clipboard

Delivers the picked image as a ByteArray.

Link copied to clipboard

Delivers the picked image as a base64-encoded String.

Link copied to clipboard
fun EventSchemaBuilderScope.GetImageFromGallery(id: String = randomId(), trigger: EventTrigger, compression: CompressionScheme? = null, resize: ImageResizeOptions? = null, outputType: GetImageFromGalleryEventSchema.OutputType = galleryArrayOfBytes(), events: EventSchemaBuilderScope.() -> Unit = {})

Opens the platform picker restricted to images and emits the chosen image downstream, on the IO dispatcher. When compression is set the bytes are re-encoded to WebP through byQuality/byTargetSize, with resize applied in the same pass (the compressor's own defaults are used when resize is null); when compression is null the original bytes are emitted untouched and resize has no effect. Does not consume incomingData. Dispatches onSuccess (carrying the image, shaped by outputType) when an image was picked and processed; onCancelled (no data) when the user dismisses the picker without choosing an image; onFailure (carrying the thrown exception) when reading or compressing throws.

Link copied to clipboard

Delivers the captured image as a ByteArray.

Link copied to clipboard

Delivers the captured image as a base64-encoded String.

Link copied to clipboard
fun EventSchemaBuilderScope.TakePicture(id: String = randomId(), trigger: EventTrigger, compression: CompressionScheme? = null, resize: ImageResizeOptions? = null, outputType: TakePictureEventSchema.OutputType = pictureArrayOfBytes(), events: EventSchemaBuilderScope.() -> Unit = {})

Opens the camera and emits the captured photo downstream, on the IO dispatcher. When compression is set the bytes are re-encoded to WebP through byQuality/byTargetSize (the capture is treated as image/png), with resize applied in the same pass (the compressor's own defaults are used when resize is null); when compression is null the original bytes are emitted untouched and resize has no effect. Does not consume incomingData. Dispatches onSuccess (carrying the image, shaped by outputType) when a picture was taken and processed; onCancelled (no data) when the camera returns nothing, e.g. the user backs out of the capture; onFailure (carrying the thrown exception) when capturing or compressing throws.