I did have the idea of pulling in rayon to speed things up, but just compiling with release seems sufficiently fast for the image sizes I'm working with, so adding parallelism is a low priority for me at the moment.
But especially as this is my first published crate, feedback is welcome.
Hi, congrats on your first crate! Since this operates on images, it would probably nice to have some visual illustration in the README, e.g. some height map and the normal map generated from it. If this is for a game, maybe a screenshot of that as well.
Thanks for the feedback! I've added some sample height and normal maps and pushed them out to GitHub. I'm going to hold off on updating crates.io for now.
I am planning to use this in a tool to make content for a game, but said tool still needs to be made and said game is made by someone else. But I'm also not sure screenshots of the tool I'm envisioning would be particularly useful included with this crate, though.
Clippy's lints aren't very helpful here in my opinion.
While I would in general agree with the many single character names being bad, I think it's justified here. x and y are the standard names for these coordinates and while the n, s, e, and w could be expanded out to their full names, I thing that would be more distracting than helpful. The tight layout better conveys the meaning in my opinion.
As for the absurd comparison lint, I don't find the reasoning behind it very compelling for the u32 <= 0 case. I prefer the more defensive style.
But I did add an #[allow()] for those two lints to that function. And I do appreciate the reminder that clippy exists. I've got a bad habit of not thinking about it.