Add real-time tilt-shift preview for gallery images
Gallery imports now show the effect live as you adjust parameters, matching the camera preview experience. Uses a downscaled (1024px) source bitmap for fast recomputation via collectLatest, which cancels stale frames when params change mid-computation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
dedf445cf6
commit
12051b2a83
3 changed files with 77 additions and 7 deletions
|
|
@ -327,6 +327,15 @@ class ImageCaptureHandler(
|
|||
return rotated
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies tilt-shift effect to a bitmap for real-time preview.
|
||||
* Runs on [Dispatchers.IO]. The caller owns the returned bitmap.
|
||||
*/
|
||||
suspend fun applyTiltShiftPreview(source: Bitmap, params: BlurParameters): Bitmap =
|
||||
withContext(Dispatchers.IO) {
|
||||
applyTiltShiftEffect(source, params)
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies tilt-shift blur effect to a bitmap.
|
||||
* Supports both linear and radial modes.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue