Skip to content

Port feColorMatrix and feConvolveMatrix, fix <image> bbox (again), add integer parsers, add PixelRectangle iterator

Ivan Molodetskikh requested to merge YaLTeR/librsvg:filters-to-rust-7 into master
  • Ported feColorMatrix and feConvolveMatrix to Rust.
  • I used the rulinalg crate for basic matrix operations.
  • Unfortunately, due to (what I think is) lack of inlining and bounds checks, the feColorMatrix test takes ages (16 seconds) on debug. On release it's as fast as the C code.
  • feConvolveMatrix code 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() and parsers::integer_optional_integer().
  • Added a PixelRectangle iterator which returns pixels in a given rectangle, which can include out-of-bounds areas. Pixels in out-of-bounds areas are returned according to EdgeMode (which corresponds to the edgeMode property of feConvolveMatrix).
  • Added SharedImageSurface::scale(), ::scale_to(), ::extract_alpha().
  • Refactored FilterError and FilterContext::get_input() to not lose any errors.
Edited by Ivan Molodetskikh

Merge request reports