chore: cleanup#1
Conversation
There was a problem hiding this comment.
Pull request overview
This PR performs a broad API cleanup/refactor across videoframe, notably unifying width-alignment validation errors, expanding/adjusting Bayer support APIs, and adding initial HSV plane wrapper types under source.
Changes:
- Replace
OddWidth/WidthNotMultipleOf4with a unifiedWidthAlignment+WidthAlignmentRequirementacross multiple frame families and update tests accordingly. - Add/expand Bayer-related APIs (patterns, WB/CCM validation types, row/walker plumbing) and remove the standalone
cfamodule. - Add
source::hsvtypes (HsvPlane,HsvFrame,HsvFrameMut) and expose them fromsource::mod.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| videoframe/src/source/walker_macro.rs | Makes generated row constructors/accessors pub const fn and cleans up comments. |
| videoframe/src/source/mod.rs | Exposes new hsv module from source. |
| videoframe/src/source/hsv.rs | Adds HSV plane/frame wrapper types (but currently contains compile-blocking move/borrow issues). |
| videoframe/src/lib.rs | Removes pub mod cfa export. |
| videoframe/src/frame/yuva/sub_4_2_2.rs | Switches odd-width validation to WidthAlignment. |
| videoframe/src/frame/yuva/sub_4_2_0.rs | Switches odd-width validation to WidthAlignment. |
| videoframe/src/frame/y2xx.rs | Switches odd-width validation to WidthAlignment and updates panic mapping. |
| videoframe/src/frame/v210.rs | Switches odd-width validation to WidthAlignment and updates panic mapping. |
| videoframe/src/frame/tests/y2xx.rs | Updates tests to assert WidthAlignmentRequirement::Even. |
| videoframe/src/frame/tests/v210.rs | Updates tests to assert WidthAlignmentRequirement::Even. |
| videoframe/src/frame/tests/subsampled_4_2_0_high_bit.rs | Updates odd-width tests to WidthAlignment. |
| videoframe/src/frame/tests/semi_planar_8bit.rs | Updates odd-width tests to WidthAlignment. |
| videoframe/src/frame/tests/planar_8bit.rs | Updates odd-width / multiple-of-4 tests to WidthAlignment. |
| videoframe/src/frame/tests/packed_yuv_8bit.rs | Updates packed 4:2:2 odd-width tests to WidthAlignment. |
| videoframe/src/frame/tests/packed_yuv_4_1_1.rs | Updates packed 4:1:1 multiple-of-4 tests to WidthAlignment. |
| videoframe/src/frame/tests/bayer.rs | Adds behavioral tests for Bayer walkers and sample-range validation. |
| videoframe/src/frame/subsampled_high_bit_pn.rs | Switches odd-width validation to WidthAlignment. |
| videoframe/src/frame/subsampled_high_bit_planar.rs | Switches odd-width validation to WidthAlignment (and updates docs). |
| videoframe/src/frame/semi_planar_8bit.rs | Switches odd-width validation to WidthAlignment. |
| videoframe/src/frame/planar_8bit.rs | Switches odd-width / multiple-of-4 validation to WidthAlignment. |
| videoframe/src/frame/packed_yuv_8bit.rs | Switches odd-width validation to WidthAlignment. |
| videoframe/src/frame/packed_yuv_4_1_1.rs | Switches multiple-of-4 validation to WidthAlignment. |
| videoframe/src/frame/mod.rs | Introduces WidthAlignment + WidthAlignmentRequirement and removes the older payload structs. |
| videoframe/src/frame/bayer.rs | Major expansion: Bayer pattern/demosaic/WB/CCM types + walkers/rows; includes a broken intra-doc link. |
| videoframe/src/cfa.rs | Removed (previously housed BayerPattern). |
| videoframe/Cargo.toml | Bumps crate version to 0.2.0 and pins rust-version = 1.95.0. |
| Cargo.toml | Workspace lint formatting change only. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| pub const fn hsv(&mut self) -> (&mut [u8], &mut [u8], &mut [u8]) { | ||
| (self.h, self.s, self.v) | ||
| } |
| pub const fn h(&mut self) -> &mut [u8] { | ||
| self.h | ||
| } |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
No description provided.