-
Notifications
You must be signed in to change notification settings - Fork 61
Replace preprocessor abuse with templates for pixel depth-specific functions #274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
jblang
wants to merge
12
commits into
algodoc
Choose a base branch
from
claude-template
base: algodoc
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Replace repeated inclusion of zoomd.h with different preprocessor defines with a modern template-based approach. All zoom functions (calcline, calccolumn, dosymmetry2, fillline) are now templates in the tpl namespace, instantiated for each pixel depth (8, 16, 24, 32-bit). This eliminates macro-based code generation while maintaining the same functionality and performance. The new pixel_traits.h header provides type-safe pixel operations for all supported color depths. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Converts the 3D pseudo-stereoscopic filter from preprocessor-based code generation to modern C++ templates. Functions convert_3d, convertup_3d, and do_3d are now templates in the tpl namespace, using PixelTraits for type-safe pixel operations across different bit depths (8, 16, 24, and 32 bpp). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Converts the boundary trace algorithm from preprocessor-based code generation to modern C++ templates. Functions tracecolor, tracepoint, queue, bfill, and dosymmetries are now templates in the tpl namespace, using PixelTraits for type-safe pixel operations across different bit depths (8, 16, 24, and 32 bpp). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Converts the edge detection filter from preprocessor-based code generation to modern C++ templates. The do_edge function is now a template in the tpl namespace, using PixelTraits for type-safe pixel operations across different bit depths (8, 16, 24, and 32 bpp). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Converts the second edge detection filter from preprocessor-based code generation to modern C++ templates. The do_edge2 function is now a template in the tpl namespace, using PixelTraits for type-safe pixel operations across different bit depths (8, 16, 24, and 32 bpp). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Converts the palette emulator filter from preprocessor-based code generation to modern C++ templates. The cpalette function is now a template in the tpl namespace, using PixelTraits for type-safe pixel operations across different bit depths (8, 16, 24, and 32 bpp). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Converts the image rotation filter from preprocessor-based code generation to modern C++ templates. The do_rotate function is now a template in the tpl namespace, using PixelTraits for type-safe pixel operations across different bit depths (8, 16, 24, and 32 bpp). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Converts the starfield filter from preprocessor-based code generation to modern C++ templates. The do_starfield function is now a template in the tpl namespace, using PixelTraits for type-safe pixel operations across different bit depths (8, 16, 24, and 32 bpp). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Converts the random dot stereogram filter from preprocessor-based code generation to modern C++ templates. The do_stereogram function is now a template in the tpl namespace, using PixelTraits for type-safe pixel operations across different bit depths (8, 16, 24, and 32 bpp). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Converted grlibd.h to use type-safe C++ templates with PixelTraits parameter, replacing the old preprocessor-based approach of repeated includes with different macros for each pixel depth. Updated image.cpp to use template instantiations via #define aliases for backward compatibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…ssor Converted autod.h to use type-safe C++ templates with PixelTraits parameter, replacing the old preprocessor-based approach of repeated includes with different macros for each pixel depth. Updated autopilot.cpp to use direct template instantiations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Merged all remaining *d.h template header files into their corresponding .cpp implementation files: - btraced.h → btrace.cpp (boundary trace templates) - edge2d.h → edge2.cpp (edge detection algorithm 2) - edged.h → edge.cpp (edge detection algorithm 1) - paletted.h → palettef.cpp (palette conversion) - rotated.h → rotate.cpp (image rotation) - stard.h → star.cpp (starfield effect) - stereod.h → stereogram.cpp (random dot stereogram) - zoomd.h → zoom.cpp (zoom with solid guessing) - 3dd.h → 3d.cpp (3D rendering) All template functions now reside inline within the tpl namespace in their respective .cpp files. Updated engine.pri to remove all deleted header files. Build tested and verified. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
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.
Starting with zoomd.h, I'm replacing the repeated inclusion of these *d.h with C++ templated functions. This is easier to understand and more typesafe than using macros.