This repository was archived by the owner on Nov 4, 2023. It is now read-only.
Add a user defined colourpad (filled margin area) #9
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.
Pull request 'Colourpad Addition 1A'
This pull request implements a primitive colour pad, of a user defined size.
Colour padding
Machine reading improves when codes have a large padded area around them, in the same colour as the very thin margin as defined in existing sources.
Improvement
To introduce a user defined padded area, a parameter is added wherever graphic size is referenced (in buffers, allocation, and construction.)
Still broken
The addition of one variable forces the user to define the same padded area size in all four directions, so users trying to fit graphics to a particular screen size will not have the luxury of a well defined area.
Standard conformance
I didn't take the time to read the QR standard, which probably recommends the size of a margin area according to pixel density. I think UPCA codes have similar requirements.
If such a standard exists, then it would be best to:
Wrong branch
This request is made on the release/v7 branch. Please request the equivalent improvement on master and I'll provide it.
Author's comment
I consider this change to be an improvement, but it suffers from the same API problems as the existing source (no default parameters, poor granularity, and no derived functions.) It's cheap and sloppy but it works great until you need one extra variable, like this colour pad addition. Then it's time to scramble and hack, make an addition without the benefit of function overriding. For this reason, it may be best to reject the request. Rejection would leave the problem of a lacking user defined pad unsolved.