Refactor conv op to use slightly safer std::vector

Inspired by similar change to recomb op in commit 60c5c50
This commit is contained in:
Lovell Fuller
2024-07-05 21:34:24 +01:00
parent 60c5c5083d
commit 2f0bbebfc9
4 changed files with 5 additions and 5 deletions

View File

@@ -164,10 +164,10 @@ namespace sharp {
*/
VImage Convolve(VImage image, int const width, int const height,
double const scale, double const offset,
std::unique_ptr<double[]> const &kernel_v
std::vector<double> const &kernel_v
) {
VImage kernel = VImage::new_from_memory(
kernel_v.get(),
static_cast<void*>(const_cast<double*>(kernel_v.data())),
width * height * sizeof(double),
width,
height,