Huge Refactor and prepare for odiff library mode#147
Open
shreyassanthu77 wants to merge 5 commits intodmtrKovalenko:mainfrom
Open
Huge Refactor and prepare for odiff library mode#147shreyassanthu77 wants to merge 5 commits intodmtrKovalenko:mainfrom
shreyassanthu77 wants to merge 5 commits intodmtrKovalenko:mainfrom
Conversation
Owner
Collaborator
Author
|
Wait what 😅 I will see what's going on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Major Changes
🏗️ Build System Overhaul
build.zigbuildOdiff()function withmakeOdiff()using newOdiffBuildOptionsstructimage_mod- Core image data structure and operationsio_mod- Image format handling (imports image_mod)test_filesarraytest-alltotestthroughout📁 Module Structure Reorganization
New directory structure:
🖼️ Image Structure Extraction
Created dedicated image module (
src/image/image.zig):Imagestruct fromsrc/io/io.ziginto its own moduleslice(),deinit(),readRawPixelAtOffset(),readRawPixel()setImgColor(),makeSameAsLayout(),makeWithWhiteOverlay()📥 IO Module Simplification
Simplified
src/io/io.zig:@import("image")loadImageExtoloadImageWithFormat📚 Library Module Prep
Moved core library files to
src/lib/:root.zig- Now serves as main library entry point, exports Image, io, diff, color_delta, antialiasingdiff.zig- Updated imports to use new image moduleantialiasing.zig- Updated importscolor_delta.zig- No changes (pure logic)rvv.c- RISC-V vector implementationvxdiff.asm- AVX assembly implementation🧪 Test Consolidation
Major test file reorganization:
src/test_io_bmp.zig,src/test_io_jpg.zig,src/test_io_png.zig,src/test_io_tiff.zig,src/test_io_webp.zig(544 lines removed)src/test_io.zig- Consolidated all IO tests into single file (277 lines)@import("root.zig")to@import("odiff")io.Imagetolib.Image🔄 Import Updates Across Codebase
Updated import statements:
src/cli.zig: Changed from@import("diff.zig")to@import("odiff")andlib.diffsrc/main.zig: Changed from@import("odiff_lib")to@import("odiff")bmp.zig,jpeg.zig, etc.): Changed Image import fromio.zigtoimage.zig🚀 CI/CD Workflow Updates
GitHub Actions changes:
.github/workflows/build.yml: Changedtest-alltotestin two places.github/workflows/riscv-qemu.yml: Updated path trigger from"src/rvv.c"to"src/lib/rvv.c"📝 Documentation Improvements
Updated docstrings:
loadImageExtoloadImageWithFormatsaveImageExtosaveImageWithFormatStatistics
Summary
This refactoring transforms odiff from a monolithic application structure to a modular library-ready architecture. The key benefits are:
The changes maintain full backward compatibility while setting up the foundation for future library usage.