Port feColorMatrix and feConvolveMatrix, fix <image> bbox (again), add integer parsers, add PixelRectangle iterator
- Ported
feColorMatrixandfeConvolveMatrixto Rust. - I used the
rulinalgcrate for basic matrix operations. - Unfortunately, due to (what I think is) lack of inlining and bounds checks, the
feColorMatrixtest takes ages (16 seconds) on debug. On release it's as fast as the C code. -
feConvolveMatrixcode is rather complex. It might be possible to factor out some common parts, please check, since I spent too much time thinking about the behavior over the past three days to process it properly. - Added
parsers::integer()andparsers::integer_optional_integer(). - Added a
PixelRectangleiterator which returns pixels in a given rectangle, which can include out-of-bounds areas. Pixels in out-of-bounds areas are returned according toEdgeMode(which corresponds to theedgeModeproperty offeConvolveMatrix). - Added
SharedImageSurface::scale(),::scale_to(),::extract_alpha(). - Refactored
FilterErrorandFilterContext::get_input()to not lose any errors.
Edited by Ivan Molodetskikh