| 445 | |
| 446 | |
| 447 | void Viewer::DoSaveFiletypeOptions(tFileType fileType) |
| 448 | { |
| 449 | Config::ProfileData& profile = Config::GetProfileData(); |
| 450 | float itemWidth = Gutil::GetUIParamScaled(160.0f, 2.5f); |
| 451 | |
| 452 | ImGui::PushItemWidth(itemWidth); |
| 453 | |
| 454 | switch (fileType) |
| 455 | { |
| 456 | case tFileType::TGA: |
| 457 | { |
| 458 | const char* tgaModeItems[] = { "Auto", "24 BPP", "32 BPP" }; |
| 459 | ImGui::Combo("Bits Per Pixel", &profile.SaveFileTgaDepthMode , tgaModeItems, tNumElements(tgaModeItems)); |
| 460 | ImGui::SameLine(); |
| 461 | Gutil::HelpMark("Auto: Decide based on opacity.\n24 BPP: Force 24 bits per pixel.\n32 BPP: Force 32 bits per pixel."); |
| 462 | |
| 463 | ImGui::Checkbox("RLE Compression", &profile.SaveFileTgaRLE); |
| 464 | ImGui::SameLine(); |
| 465 | Gutil::HelpMark("Perform simple run-length compression."); |
| 466 | break; |
| 467 | } |
| 468 | |
| 469 | case tFileType::PNG: |
| 470 | { |
| 471 | const char* pngModeItems[] = { "Auto", "24 BPP", "32 BPP", "48 BPP", "64 BPP" }; |
| 472 | ImGui::Combo("Bits Per Pixel", &profile.SaveFilePngDepthMode , pngModeItems, tNumElements(pngModeItems)); |
| 473 | ImGui::SameLine(); |
| 474 | Gutil::HelpMark("Auto: Decide based on opacity.\n24 BPP: Force 24 bits per pixel.\n32 BPP: Force 32 bits per pixel.\n48 BPP: Force 38 bits per pixel.\n64 BPP: Force 64 bits per pixel."); |
| 475 | break; |
| 476 | } |
| 477 | |
| 478 | case tFileType::JPG: |
| 479 | ImGui::SliderInt("Quality", &profile.SaveFileJpegQuality, 1, 100, "%d"); |
| 480 | break; |
| 481 | |
| 482 | case tFileType::GIF: |
| 483 | DoSaveGifOptions(false); |
| 484 | break; |
| 485 | |
| 486 | case tFileType::WEBP: |
| 487 | ImGui::Checkbox("Lossy", &profile.SaveFileWebpLossy); |
| 488 | if (profile.SaveFileWebpLossy) |
| 489 | { |
| 490 | ImGui::SliderFloat("Quality", &profile.SaveFileWebpQualComp, 0.0f, 100.0f, "%.1f"); |
| 491 | ImGui::SameLine(); Gutil::HelpMark("Lossy selected. This is the image quality percent."); |
| 492 | } |
| 493 | else |
| 494 | { |
| 495 | ImGui::SliderFloat("Compression", &profile.SaveFileWebpQualComp, 0.0f, 100.0f, "%.1f"); |
| 496 | ImGui::SameLine(); Gutil::HelpMark("Non-lossy selected. This is the image compression strength.\nBigger is slower and yields smaller files."); |
| 497 | } |
| 498 | ImGui::SliderInt("Duration Override", &profile.SaveFileWebpDurOverride, -1, 10000, "%d"); |
| 499 | ImGui::SameLine(); Gutil::HelpMark("In milliseconds. If set to >= 0, overrides all frame durations.\nIf -1, uses the current value for the frame."); |
| 500 | if (Gutil::Button("1.0s")) profile.SaveFileWebpDurOverride = 1000; ImGui::SameLine(); |
| 501 | if (Gutil::Button("0.5s")) profile.SaveFileWebpDurOverride = 500; ImGui::SameLine(); |
| 502 | if (Gutil::Button("30fps")) profile.SaveFileWebpDurOverride = 33; ImGui::SameLine(); |
| 503 | if (Gutil::Button("60fps")) profile.SaveFileWebpDurOverride = 16; |
| 504 | break; |
nothing calls this directly
no outgoing calls
no test coverage detected