gif color count slider (2-256) and dithering control in editing screen, both wired through export/preview pipeline
This commit is contained in:
+11
-1
@@ -644,6 +644,10 @@ pub struct ExportRequest {
|
||||
pub crop: Option<CaptureRect>,
|
||||
#[serde(default)]
|
||||
pub gif_budget_mode: GifBudgetMode,
|
||||
#[serde(default)]
|
||||
pub gif_dither: Option<GifDither>,
|
||||
#[serde(default)]
|
||||
pub gif_colors: Option<u16>,
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -666,6 +670,10 @@ pub struct PreviewRequest {
|
||||
pub target_bytes: u64,
|
||||
#[serde(default)]
|
||||
pub gif_budget_mode: GifBudgetMode,
|
||||
#[serde(default)]
|
||||
pub gif_dither: Option<GifDither>,
|
||||
#[serde(default)]
|
||||
pub gif_colors: Option<u16>,
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -691,6 +699,7 @@ fn render_preview(
|
||||
fps: request.fps,
|
||||
keep_audio: false,
|
||||
gif_dither: GifDither::FloydSteinberg,
|
||||
gif_colors: request.gif_colors.unwrap_or(256),
|
||||
webm_codec: WebmCodec::Vp9,
|
||||
mp4_codec: Mp4Codec::H264,
|
||||
scratch_dir: PathBuf::new(),
|
||||
@@ -1286,7 +1295,8 @@ fn export(app: AppHandle, state: State<'_, AppState>, request: ExportRequest) ->
|
||||
duration_secs: effective_duration,
|
||||
fps: request.fps,
|
||||
keep_audio: request.keep_audio,
|
||||
gif_dither: cfg.export.gif_dither,
|
||||
gif_dither: request.gif_dither.unwrap_or(cfg.export.gif_dither),
|
||||
gif_colors: request.gif_colors.unwrap_or(256),
|
||||
webm_codec: cfg.export.webm_codec,
|
||||
mp4_codec: cfg.export.mp4_codec,
|
||||
scratch_dir: temp_dir(&state.app_dir),
|
||||
|
||||
Reference in New Issue
Block a user