Document the internal image distinctness constraints - #9752
Conversation
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
|
Thanks, good points! I noticed #9988 would invalidate some of the comments added here - would you prefer this be merged first or that API change and then this? I'm fine rebasing/fixing either way. |
| } | ||
|
|
||
| /** | ||
| * Accumulate a histogram over `im`, optionally restricted to imMask. |
There was a problem hiding this comment.
'accumulate' makes it sound like this is a cumulative histogram, which it isn't?
| /** | ||
| * Accumulate a histogram over `im`, optionally restricted to imMask. | ||
| * | ||
| * Contract: Both im and imMask are read-only. |
There was a problem hiding this comment.
Why is this the contract? I expect that is how it is used, but I don't see any use of restrict in here.
There was a problem hiding this comment.
I didn't get this far in the optimization series, looks like 😄
But this documents the contract nevertheless, that was never going to change with the series.
EDIT: See #10005. Turns out I had half-written optimizations but didn't push them before.
| * Quantize `im` down to at most `colors` palette entries, | ||
| * returning a newly allocated result. | ||
| * | ||
| * Contract: im is read-only. |
There was a problem hiding this comment.
Again, I don't see any restrict here.
There was a problem hiding this comment.
Same here as above: this still documents the contract. Quantize was touched a bit in #9740, though not with restrict bits.
|
Thanks! |
Follows up on #9649, #9675, #9736, #9737, #9738, #9739, #9740.
#9743 will do this internally.
Adds documentation comments to the touched functions to document the distinctness-or-lack-thereof requirements for the image data.