Skip to content

Implement QR Code Detection and Refactor for Improved Performance - #10

Merged
andrewchen5678 merged 14 commits into
mainfrom
refactor2
May 20, 2026
Merged

andrewchen5678 merged 14 commits into
mainfrom
refactor2

Conversation

@andrewchen5678

Copy link
Copy Markdown
Contributor

Introduce a QR code detector module with enhanced version handling and utility functions. Update existing components for better clarity and performance, including type safety improvements by replacing u32 with usize. Bump version to 0.0.9 for relevant packages. Refactor various functions and structures for improved readability and maintainability.

andrew added 14 commits May 20, 2026 17:18
- Added a new detector module for QR code patterns, including functions to find and validate finder patterns.
- Implemented methods for estimating module size and dimension based on detected patterns.
- Enhanced version handling by adding functions to decode version information and validate sizes.
- Introduced utility functions for estimating tilt and locating alignment patterns within the QR code.
- Updated existing version handling to improve error tolerance and validation checks.
…lice of points

fix: update point length assertion for accuracy in tests
…and performance

- Introduced constants for bit manipulation and encoding schemes in decoder.rs.
- Enhanced error handling with custom error types for Hanzi and AIM indicators.
- Simplified bit reading functions to improve readability and maintainability.
- Updated segment decoding functions to use usize instead of u32 for character counts.
- Refactored alphanumeric character conversion to utilize array indexing for efficiency.
- Improved ECI value parsing by consolidating logic into a single method.
- Adjusted data structures in version.rs to use usize for codeword counts, enhancing type safety.
- Streamlined dimension estimation and validation logic in detector.rs.
- Removed unnecessary public visibility from functions that are only used internally.
- Enhanced error messages for better debugging and user feedback.
…r and improve error handling in FormatInformation
- Updated the GridSampler trait to accept usize for dimensions.
- Modified HybridBinarizer to use usize for width and height parameters.
- Changed Luma8LuminanceSource to store dimensions as usize.
- Adjusted QR code reader and decoder functions to use usize for dimensions and symbol counts.
- Refactored downscale_luma_buffer to work with usize.
- Updated tests to reflect changes in function signatures and types.
- Ensured consistency across the codebase by replacing u32 with usize where applicable.
@andrewchen5678
andrewchen5678 merged commit bdbd3fb into main May 20, 2026
1 check passed
@andrewchen5678
andrewchen5678 deleted the refactor2 branch May 20, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant