Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Convolution Api #2797

Merged
merged 5 commits into from
Nov 19, 2024
Merged

Expose Convolution Api #2797

merged 5 commits into from
Nov 19, 2024

Conversation

JimBobSquarePants
Copy link
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

See the roadmap discussion at #2533

Adds a general convolution API that accepts a DenseMatrix<float> to describe the convolution kernel.

All this stuff has been the plumbing for various processors over the years and should be exposed publicly now it's solid.

Comment on lines +81 to +89
public static IImageProcessingContext Convolve(
this IImageProcessingContext source,
Rectangle rectangle,
DenseMatrix<float> kernelXY,
bool preserveAlpha,
BorderWrappingMode borderWrapModeX,
BorderWrappingMode borderWrapModeY)
=> source.ApplyProcessor(new ConvolutionProcessor(kernelXY, preserveAlpha, borderWrapModeX, borderWrapModeY), rectangle);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add integration tests that excercise at least 2 different values for all parameters to validate that everything is plumbed through end-to-end, otherwise LGTM.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have alook. Thanks!

@JimBobSquarePants JimBobSquarePants merged commit 1ec479e into main Nov 19, 2024
8 checks passed
@JimBobSquarePants JimBobSquarePants deleted the js/convolution-api branch November 19, 2024 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants