Support 16bit output from Local contrast&brightness - #84
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthrough
Changes16-bit output pipeline
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant SaveProcessedImageAsync
participant GeneralFileFormatHandler
participant LocalContrastViewModel
participant BitmapSource
SaveProcessedImageAsync->>GeneralFileFormatHandler: Check output format
GeneralFileFormatHandler-->>SaveProcessedImageAsync: Return 16-bit decision
SaveProcessedImageAsync->>LocalContrastViewModel: Get result image
LocalContrastViewModel->>BitmapSource: Convert destination bitmap when 16-bit
BitmapSource-->>SaveProcessedImageAsync: Return bitmap source
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
PhotoLocatorTest/BitmapOperations/FloatBitmapTest.cs (1)
120-143: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the converted 16-bit pixel values.
This test verifies only dimensions and format, so it would pass if conversion wrote incorrect values. Add assertions for gamma mapping plus clamping to
0andushort.MaxValue; also cover the unsupported-plane exception.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@PhotoLocatorTest/BitmapOperations/FloatBitmapTest.cs` around lines 120 - 143, Extend ToBitmapSource16_ShouldCreateBitmapSource to inspect converted 16-bit pixel values, asserting the expected gamma-mapped result and clamping behavior at 0 and ushort.MaxValue. Add test coverage for an unsupported plane count and verify the expected exception is thrown, while preserving the existing dimension and format assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@PhotoLocator/LocalContrastViewModel.cs`:
- Around line 579-584: Update the produce16bitOutput branch in the local
contrast result flow to check the destination bitmap’s plane count before
calling ToBitmapSource16. For unsupported counts such as CMYK’s four planes,
return PreviewPictureSource instead, while preserving 16-bit export for
supported one- and three-plane results.
---
Nitpick comments:
In `@PhotoLocatorTest/BitmapOperations/FloatBitmapTest.cs`:
- Around line 120-143: Extend ToBitmapSource16_ShouldCreateBitmapSource to
inspect converted 16-bit pixel values, asserting the expected gamma-mapped
result and clamping behavior at 0 and ushort.MaxValue. Add test coverage for an
unsupported plane count and verify the expected exception is thrown, while
preserving the existing dimension and format assertions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e0c9961a-15ff-4ebb-9088-6b32df611a41
📒 Files selected for processing (6)
PhotoLocator/BitmapOperations/FloatBitmap.csPhotoLocator/ImageTransformCommands.csPhotoLocator/LocalContrastViewModel.csPhotoLocator/PictureFileFormats/GeneralFileFormatHandler.csPhotoLocator/VideoTransformCommands.csPhotoLocatorTest/BitmapOperations/FloatBitmapTest.cs
Summary by CodeRabbit
New Features
Bug Fixes
Tests