apply method

void apply(
  1. Image src,
  2. Image dst, {
  3. bool horizontal = true,
  4. Image? mask,
  5. Channel maskChannel = Channel.luminance,
})

Apply the kernel to the src image, storing the results in dst, for a single dimension. If [horizontal is true, the filter will be applied to the horizontal axis, otherwise it will be applied to the vertical axis.

Implementation

void apply(Image src, Image dst,
    {bool horizontal = true,
    Image? mask,
    Channel maskChannel = Channel.luminance}) {
  if (horizontal) {
    for (var y = 0; y < src.height; ++y) {
      _applyCoefficientsLine(
          src, dst, y, src.width, horizontal, mask, maskChannel);
    }
  } else {
    for (var x = 0; x < src.width; ++x) {
      _applyCoefficientsLine(
          src, dst, x, src.height, horizontal, mask, maskChannel);
    }
  }
}