Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Assert user-specified positions within image or image_view are in ran…
…ge (#344) These assertions validating user-specified x and y values for pixel positions at run-time should help GIL users to catch basic mistakes as early as possible, especially during complex processing algorithms. (Easy to make a mistake calling `view(y, x)` instead of `view(x, y)`!) The checks are deliberately implemented using assertions as debug-only tools disabled in `NDEBUG` builds, and not as exceptions to avoid potentially significant performance hit at run-time in optimised builds. Add `TODO` comments where certain assumptions are not immediately obvious and may require further testing to clarify and documenting. For example, what are constraints on requesting locators with negative offsets using `image_view::xy_at`? Tidy up image.hpp and image_view.hpp formatting vertically rather than horizontally with very long lines, align return statements to left for immediate display what is calculated and returned, instead of hiding it behind the right margin.
- Loading branch information