From 178e59a618caeb8e88b56f13476472bf448c4aa6 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Sat, 1 Mar 2025 11:45:57 +0800 Subject: [PATCH] add enabled/strength params for bloom --- .../lib/src/viewer/src/ffi/src/ffi_view.dart | 11 +++++++++-- .../src/viewer/src/ffi/src/thermion_viewer_ffi.dart | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/thermion_dart/lib/src/viewer/src/ffi/src/ffi_view.dart b/thermion_dart/lib/src/viewer/src/ffi/src/ffi_view.dart index e76e42b4..dadad4ee 100644 --- a/thermion_dart/lib/src/viewer/src/ffi/src/ffi_view.dart +++ b/thermion_dart/lib/src/viewer/src/ffi/src/ffi_view.dart @@ -75,8 +75,10 @@ class FFIView extends View { } @override - Future setBloom(double strength) async { - View_setBloom(view, strength); + Future setBloom(bool enabled, double strength) async { + await withVoidCallback((cb) { + View_setBloomRenderThread(view, enabled, strength); + }); } @override @@ -100,4 +102,9 @@ class FFIView extends View { Future isDitheringEnabled() async { return View_isDitheringEnabled(view); } + + @override + Future setRenderQuality(QualityLevel quality) async { + View_setRenderQuality(view, TQualityLevel.values[quality.index]); + } } diff --git a/thermion_dart/lib/src/viewer/src/ffi/src/thermion_viewer_ffi.dart b/thermion_dart/lib/src/viewer/src/ffi/src/thermion_viewer_ffi.dart index 8f59fc99..a2634457 100644 --- a/thermion_dart/lib/src/viewer/src/ffi/src/thermion_viewer_ffi.dart +++ b/thermion_dart/lib/src/viewer/src/ffi/src/thermion_viewer_ffi.dart @@ -1194,9 +1194,9 @@ class ThermionViewerFFI extends ThermionViewer { /// /// @override - Future setBloom(double bloom) async { + Future setBloom(bool enabled, double strength) async { final view = await getViewAt(0) as FFIView; - View_setBloom(view.view, bloom); + View_setBloom(view.view, enabled, strength); } ///