-
Notifications
You must be signed in to change notification settings - Fork 22
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
Refactoring RXingResultPoint usage #12
Comments
I'll add to this by saying: we might do the same math in multiple places. I know that there is a module where result point math is done, a place in math_utils, and a bunch of op implementations as well. It all over the place. I think in the c++ ported parts of datamatrix I'm more likely to have passed it by value. |
I see that besides |
I feel fine with that chain of logic. The Point is probably from something I ported from C++ and was in an hurry and didn’t spend any time figuring out what I had already done. The ResultPoint is because the java has an interface for it, but I don’t know how useful that is. I think there might be something to be said for making a generic version of it that can handle f32, f64, u32, u64. The C++ version does that, but I don’t remember why. |
I've edited the original comment to include a list of goals for this issue. Let me know if you have any suggestions or comments. |
I’ll have to double check, but I don’t think this should require a full version bump to 0.4.0. Well, now that I’ve typed that I think I am wrong. We do expose that through both the serde binding and through the ResultMetadata return value. I don’t mind moving to 0.4, but I’d like to batch up some other breaking changes and do them together. Other things I’d like to do in 0.4: possibly migrate to using a HashSet for the EncodeHints and DecodeHints because the HashMap has never been rust reasonable and only made sense in Java, POSSIBLY actually do the work to move the reader chain that includes Binarizer, LumaSource, and Reader to use generics instead of &dyn Trait. I should make a milestone for that. |
If renaming pub type RXingResultPoint = Point; Once we're reading for a version bump, it'll be as simple as removing the alias. Does this sound good or am I missing something else besides the renaming that also makes it a breaking change? I've already created an alias type actually; I had to because a proc macro needed it; take a look at this commit. |
That should be fine, actually (there is another rust trick I forgot!). In the not so distant future I’m going to move those macros into the main repository and rearrange things so that the root of this repository is a workspace with the proc-macro crate and the main library (as suggested in #7). That seems less prone to failures when making changes across the two. |
Reopened because it was autoclosed when I merged in #13 |
Yeah, that's a bit sucky. From what I can tell, the only way to link an issue inside a PR without write privileges is by writing Anyway, next up I'm planning to tackle the various number conversions related to point creation, as well as replacing various |
fe8f89c addresses "Remove the Point type in the aztec module" |
Since this is a library that works with images, naturally there's a ton of 2D point math going on in the code. I feel like putting in effort here will have a big return on investment, since it's such an integral part of the program logic.
Some points that can be improved in particular:
&[RXingResultPoint]
. A dedicated rectangle type would be better here for type safety.I'm opening a PR that addresses the first point, and I'd like to tackle points 2 and 3, though that's a more long-term goal.
Goals
RXingResultPoint
to justPoint
RXingResultPoint
and similarly named methods in therxing-one-d-proc-derive
crateMathUtils
module, since it holds duplicated logicResultPoint
trait (all uses in repo removed, but the type still remains because of proc macro)Point
type in theaztec
modulef32
parameter pairs and(f32, f32)
tuples withPoint
a + b
instead oflet x = a.x + b.x; let y = a.y + b.y
)The text was updated successfully, but these errors were encountered: