oarust 0.9.0

GPU-first semantic computing engine written in Rust
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
// @generated by tool/gen/fn/generate.py; DO NOT EDIT.
// schema=image.json schema_version=1 generator_version=64
// schema_sha256=7964c886261cd8764e3b9bdef23d569d3f12ad030b674d98056242b6d4822bd9
use crate::image::{BorderMode, ImageFormat, InterpolationMode, NormalizationParams};
use crate::{Image, Matrix, Result};

impl Image {
	/// Resize an FP32 channel-first image while preserving its layout and format.
	///
	/// Delegates to [`crate::image::resize`].
	pub fn resize(
		&self,
		target_width: u32,
		target_height: u32,
		interpolation: InterpolationMode,
	) -> Result<Self> {
		crate::image::resize(self, target_width, target_height, interpolation)
	}

	/// Extract a region, clipping its right and bottom edges to the source extent.
	///
	/// Delegates to [`crate::image::crop`].
	pub fn crop(&self, x: u32, y: u32, width: u32, height: u32) -> Result<Self> {
		crate::image::crop(self, x, y, width, height)
	}

	/// Flip an image horizontally, vertically, or along both axes.
	///
	/// Delegates to [`crate::image::flip`].
	pub fn flip(&self, horizontal: bool, vertical: bool) -> Result<Self> {
		crate::image::flip(self, horizontal, vertical)
	}

	/// Rotate clockwise by a multiple of 90 degrees.
	///
	/// Delegates to [`crate::image::rotate`].
	pub fn rotate(&self, degrees: u32) -> Result<Self> {
		crate::image::rotate(self, degrees)
	}

	/// Add asymmetric padding with an explicit border policy.
	///
	/// Delegates to [`crate::image::pad`].
	pub fn pad(
		&self,
		left: u32,
		right: u32,
		top: u32,
		bottom: u32,
		border: BorderMode,
		border_value: f32,
	) -> Result<Self> {
		crate::image::pad(self, left, right, top, bottom, border, border_value)
	}

	/// Extract a centered region with the requested exact extent.
	///
	/// Delegates to [`crate::image::center_crop`].
	pub fn center_crop(&self, width: u32, height: u32) -> Result<Self> {
		crate::image::center_crop(self, width, height)
	}

	/// Resample an image from an FP32 absolute-coordinate map shaped
	///
	/// Delegates to [`crate::image::remap`].
	pub fn remap(
		&self,
		map: &Matrix,
		interpolation: InterpolationMode,
		border: BorderMode,
		border_value: f32,
	) -> Result<Self> {
		crate::image::remap(self, map, interpolation, border, border_value)
	}

	/// Apply an inverse FP32 2x3 affine transform to an image.
	///
	/// Delegates to [`crate::image::warp_affine`].
	pub fn warp_affine(
		&self,
		transform: &Matrix,
		width: u32,
		height: u32,
		interpolation: InterpolationMode,
		border: BorderMode,
		border_value: f32,
	) -> Result<Self> {
		crate::image::warp_affine(
			self,
			transform,
			width,
			height,
			interpolation,
			border,
			border_value,
		)
	}

	/// Apply an inverse FP32 3x3 perspective transform to an image.
	///
	/// Delegates to [`crate::image::warp_perspective`].
	pub fn warp_perspective(
		&self,
		transform: &Matrix,
		width: u32,
		height: u32,
		interpolation: InterpolationMode,
		border: BorderMode,
		border_value: f32,
	) -> Result<Self> {
		crate::image::warp_perspective(
			self,
			transform,
			width,
			height,
			interpolation,
			border,
			border_value,
		)
	}

	/// Replace values above `threshold` with `max_value` and all others with zero.
	///
	/// Delegates to [`crate::image::threshold_binary`].
	pub fn threshold_binary(&self, threshold: f32, max_value: f32) -> Result<Self> {
		crate::image::threshold_binary(self, threshold, max_value)
	}

	/// Replace values at or below `threshold` with `max_value` and all others with zero.
	///
	/// Delegates to [`crate::image::threshold_binary_inv`].
	pub fn threshold_binary_inv(&self, threshold: f32, max_value: f32) -> Result<Self> {
		crate::image::threshold_binary_inv(self, threshold, max_value)
	}

	/// Truncate values above `threshold`.
	///
	/// Delegates to [`crate::image::threshold_truncate`].
	pub fn threshold_truncate(&self, threshold: f32) -> Result<Self> {
		crate::image::threshold_truncate(self, threshold)
	}

	/// Replace values at or below `threshold` with zero.
	///
	/// Delegates to [`crate::image::threshold_to_zero`].
	pub fn threshold_to_zero(&self, threshold: f32) -> Result<Self> {
		crate::image::threshold_to_zero(self, threshold)
	}

	/// Replace values above `threshold` with zero.
	///
	/// Delegates to [`crate::image::threshold_to_zero_inv`].
	pub fn threshold_to_zero_inv(&self, threshold: f32) -> Result<Self> {
		crate::image::threshold_to_zero_inv(self, threshold)
	}

	/// Produce `true_value` for values inside the inclusive interval and zero outside it.
	///
	/// Delegates to [`crate::image::in_range`].
	pub fn in_range(&self, low: f32, high: f32, true_value: f32) -> Result<Self> {
		crate::image::in_range(self, low, high, true_value)
	}

	/// Clamp every pixel to the inclusive interval.
	///
	/// Delegates to [`crate::image::clamp`].
	pub fn clamp(&self, low: f32, high: f32) -> Result<Self> {
		crate::image::clamp(self, low, high)
	}

	/// Invert every value around `max_value`.
	///
	/// Delegates to [`crate::image::invert`].
	pub fn invert(&self, max_value: f32) -> Result<Self> {
		crate::image::invert(self, max_value)
	}

	/// Apply `value * contrast + brightness`.
	///
	/// Delegates to [`crate::image::brightness_contrast`].
	pub fn brightness_contrast(&self, brightness: f32, contrast: f32) -> Result<Self> {
		crate::image::brightness_contrast(self, brightness, contrast)
	}

	/// Apply `max(value, 0)^gamma * gain`.
	///
	/// Delegates to [`crate::image::gamma_contrast`].
	pub fn gamma_contrast(&self, gamma: f32, gain: f32) -> Result<Self> {
		crate::image::gamma_contrast(self, gamma, gain)
	}

	/// Invert values at or above `threshold` around `max_value`.
	///
	/// Delegates to [`crate::image::solarize`].
	pub fn solarize(&self, threshold: f32, max_value: f32) -> Result<Self> {
		crate::image::solarize(self, threshold, max_value)
	}

	/// Quantize `[low, high]` to `levels` evenly spaced values using round-half-up.
	///
	/// Delegates to [`crate::image::posterize`].
	pub fn posterize(&self, levels: u32, low: f32, high: f32) -> Result<Self> {
		crate::image::posterize(self, levels, low, high)
	}

	/// Convert an RGB or RGBA image to Rec.709 grayscale.
	///
	/// Delegates to [`crate::image::grayscale`].
	pub fn grayscale(&self) -> Result<Self> {
		crate::image::grayscale(self)
	}

	/// Blend two equal semantic images using `left * (1-alpha) + right * alpha`.
	///
	/// Delegates to [`crate::image::alpha_blend`].
	pub fn alpha_blend(&self, right: &Image, alpha: f32) -> Result<Self> {
		crate::image::alpha_blend(self, right, alpha)
	}

	/// Composite two equal images with a clamped Gray or per-channel mask.
	///
	/// Delegates to [`crate::image::composite`].
	pub fn composite(&self, right: &Image, mask: &Image) -> Result<Self> {
		crate::image::composite(self, right, mask)
	}

	/// Fill the intersection of a rectangle and the image with one finite value.
	///
	/// Delegates to [`crate::image::erase`].
	pub fn erase(&self, x: u32, y: u32, width: u32, height: u32, value: f32) -> Result<Self> {
		crate::image::erase(self, x, y, width, height, value)
	}

	/// Apply one shared FP32 `[3, 4]` affine color transform to RGB channels.
	///
	/// Delegates to [`crate::image::color_twist`].
	pub fn color_twist(&self, transform: &Matrix) -> Result<Self> {
		crate::image::color_twist(self, transform)
	}

	/// Reorder one to four channels and explicitly assign the resulting format.
	///
	/// Delegates to [`crate::image::channel_reorder`].
	pub fn channel_reorder(&self, order: [u32; 4], output_format: ImageFormat) -> Result<Self> {
		crate::image::channel_reorder(self, order, output_format)
	}

	/// Add explicit-seed Philox Gaussian noise to every pixel.
	///
	/// Delegates to [`crate::image::gaussian_noise`].
	pub fn gaussian_noise(&self, mean: f32, stddev: f32, seed: u64) -> Result<Self> {
		crate::image::gaussian_noise(self, mean, stddev, seed)
	}

	/// Replace a seeded fraction of pixels with salt or pepper values.
	///
	/// Delegates to [`crate::image::salt_pepper_noise`].
	pub fn salt_pepper_noise(
		&self,
		probability: f32,
		salt_value: f32,
		pepper_value: f32,
		seed: u64,
	) -> Result<Self> {
		crate::image::salt_pepper_noise(self, probability, salt_value, pepper_value, seed)
	}

	/// Apply same-shape 2D cross-correlation with an odd FP32 kernel up to 31×31.
	///
	/// Delegates to [`crate::image::convolve_2d`].
	pub fn convolve_2d(
		&self,
		kernel: &Matrix,
		border: BorderMode,
		border_value: f32,
	) -> Result<Self> {
		crate::image::convolve_2d(self, kernel, border, border_value)
	}

	/// Apply horizontal and vertical odd FP32 vector kernels up to length 31.
	///
	/// Delegates to [`crate::image::separable_convolve_2d`].
	pub fn separable_convolve_2d(
		&self,
		kernel_x: &Matrix,
		kernel_y: &Matrix,
		border: BorderMode,
		border_value: f32,
	) -> Result<Self> {
		crate::image::separable_convolve_2d(self, kernel_x, kernel_y, border, border_value)
	}

	/// Average an odd rectangular neighborhood up to 31×31.
	///
	/// Delegates to [`crate::image::average_blur`].
	pub fn average_blur(&self, width: u32, height: u32, border: BorderMode) -> Result<Self> {
		crate::image::average_blur(self, width, height, border)
	}

	/// Compute one first-order Sobel derivative.
	///
	/// Delegates to [`crate::image::sobel`].
	pub fn sobel(&self, dx: u32, dy: u32, border: BorderMode) -> Result<Self> {
		crate::image::sobel(self, dx, dy, border)
	}

	/// Compute one first-order Scharr derivative.
	///
	/// Delegates to [`crate::image::scharr`].
	pub fn scharr(&self, dx: u32, dy: u32, border: BorderMode) -> Result<Self> {
		crate::image::scharr(self, dx, dy, border)
	}

	/// Apply the four-neighbor discrete Laplacian.
	///
	/// Delegates to [`crate::image::laplacian`].
	pub fn laplacian(&self, border: BorderMode) -> Result<Self> {
		crate::image::laplacian(self, border)
	}

	/// Erode with an odd rectangular structuring element up to 31×31.
	///
	/// Delegates to [`crate::image::erode`].
	pub fn erode(
		&self,
		width: u32,
		height: u32,
		border: BorderMode,
		border_value: f32,
	) -> Result<Self> {
		crate::image::erode(self, width, height, border, border_value)
	}

	/// Dilate with an odd rectangular structuring element up to 31×31.
	///
	/// Delegates to [`crate::image::dilate`].
	pub fn dilate(
		&self,
		width: u32,
		height: u32,
		border: BorderMode,
		border_value: f32,
	) -> Result<Self> {
		crate::image::dilate(self, width, height, border, border_value)
	}

	/// Erode and then dilate with the same rectangular element.
	///
	/// Delegates to [`crate::image::morphology_open`].
	pub fn morphology_open(
		&self,
		width: u32,
		height: u32,
		border: BorderMode,
		border_value: f32,
	) -> Result<Self> {
		crate::image::morphology_open(self, width, height, border, border_value)
	}

	/// Dilate and then erode with the same rectangular element.
	///
	/// Delegates to [`crate::image::morphology_close`].
	pub fn morphology_close(
		&self,
		width: u32,
		height: u32,
		border: BorderMode,
		border_value: f32,
	) -> Result<Self> {
		crate::image::morphology_close(self, width, height, border, border_value)
	}

	/// Return dilation minus erosion.
	///
	/// Delegates to [`crate::image::morphology_gradient`].
	pub fn morphology_gradient(
		&self,
		width: u32,
		height: u32,
		border: BorderMode,
		border_value: f32,
	) -> Result<Self> {
		crate::image::morphology_gradient(self, width, height, border, border_value)
	}

	/// Apply a normalized Gaussian blur with replicate borders.
	///
	/// Delegates to [`crate::image::gaussian_blur`].
	pub fn gaussian_blur(&self, sigma: f32, kernel_size: u32) -> Result<Self> {
		crate::image::gaussian_blur(self, sigma, kernel_size)
	}

	/// Apply a nonnegative four-neighbor sharpening amount.
	///
	/// Delegates to [`crate::image::sharpen`].
	pub fn sharpen(&self, amount: f32, border: BorderMode) -> Result<Self> {
		crate::image::sharpen(self, amount, border)
	}

	/// Select the median of an odd square neighborhood up to 15×15.
	///
	/// Delegates to [`crate::image::median_blur`].
	pub fn median_blur(&self, kernel_size: u32, border: BorderMode) -> Result<Self> {
		crate::image::median_blur(self, kernel_size, border)
	}

	/// Apply a bilateral neighborhood filter.
	///
	/// Delegates to [`crate::image::bilateral_filter`].
	pub fn bilateral_filter(
		&self,
		kernel_size: u32,
		sigma_color: f32,
		sigma_space: f32,
		border: BorderMode,
	) -> Result<Self> {
		crate::image::bilateral_filter(self, kernel_size, sigma_color, sigma_space, border)
	}

	/// Apply an unsharp mask using a Gaussian detail estimate.
	///
	/// Delegates to [`crate::image::unsharp_mask`].
	pub fn unsharp_mask(&self, sigma: f32, amount: f32, kernel_size: u32) -> Result<Self> {
		crate::image::unsharp_mask(self, sigma, amount, kernel_size)
	}

	/// Return the source minus its morphological opening.
	///
	/// Delegates to [`crate::image::morphology_top_hat`].
	pub fn morphology_top_hat(
		&self,
		width: u32,
		height: u32,
		border: BorderMode,
		border_value: f32,
	) -> Result<Self> {
		crate::image::morphology_top_hat(self, width, height, border, border_value)
	}

	/// Return the morphological closing minus the source.
	///
	/// Delegates to [`crate::image::morphology_black_hat`].
	pub fn morphology_black_hat(
		&self,
		width: u32,
		height: u32,
		border: BorderMode,
		border_value: f32,
	) -> Result<Self> {
		crate::image::morphology_black_hat(self, width, height, border, border_value)
	}

	/// Threshold against the local arithmetic mean minus `c`.
	///
	/// Delegates to [`crate::image::adaptive_threshold_mean`].
	pub fn adaptive_threshold_mean(
		&self,
		kernel_size: u32,
		c: f32,
		max_value: f32,
		border: BorderMode,
	) -> Result<Self> {
		crate::image::adaptive_threshold_mean(self, kernel_size, c, max_value, border)
	}

	/// Threshold against a local Gaussian-weighted mean minus `c`.
	///
	/// Delegates to [`crate::image::adaptive_threshold_gaussian`].
	pub fn adaptive_threshold_gaussian(
		&self,
		kernel_size: u32,
		c: f32,
		max_value: f32,
		sigma: f32,
		border: BorderMode,
	) -> Result<Self> {
		crate::image::adaptive_threshold_gaussian(self, kernel_size, c, max_value, sigma, border)
	}

	/// Apply `(pixel - mean[channel]) / std[channel]` to up to three channels.
	///
	/// Delegates to [`crate::image::normalize`].
	pub fn normalize(&self, parameters: NormalizationParams) -> Result<Self> {
		crate::image::normalize(self, parameters)
	}

	/// Convert between three-channel RGB and BGR semantics, including identity.
	///
	/// Delegates to [`crate::image::convert_color`].
	pub fn convert_color(&self, destination_format: crate::ImageFormat) -> Result<Self> {
		crate::image::convert_color(self, destination_format)
	}

	/// Bilinearly resize and normalize in one semantic and executable operation.
	///
	/// Delegates to [`crate::image::resize_normalize`].
	pub fn resize_normalize(
		&self,
		width: u32,
		height: u32,
		parameters: NormalizationParams,
	) -> Result<Self> {
		crate::image::resize_normalize(self, width, height, parameters)
	}

	/// Blend a class palette over an RGB/RGBA image using an I32 label map.
	///
	/// Delegates to [`crate::image::segmentation_overlay`].
	pub fn segmentation_overlay(&self, mask: &Matrix, palette: &Matrix, alpha: f32) -> Result<Self> {
		crate::image::segmentation_overlay(self, mask, palette, alpha)
	}
}

const _: fn(&Image, u32, u32, InterpolationMode) -> Result<Image> = crate::image::resize;
const _: fn(&Image, u32, u32, InterpolationMode) -> Result<Image> = Image::resize;
const _: fn(&Image, u32, u32, u32, u32) -> Result<Image> = crate::image::crop;
const _: fn(&Image, u32, u32, u32, u32) -> Result<Image> = Image::crop;
const _: fn(&Image, bool, bool) -> Result<Image> = crate::image::flip;
const _: fn(&Image, bool, bool) -> Result<Image> = Image::flip;
const _: fn(&Image, u32) -> Result<Image> = crate::image::rotate;
const _: fn(&Image, u32) -> Result<Image> = Image::rotate;
const _: fn(&Image, u32, u32, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::pad;
const _: fn(&Image, u32, u32, u32, u32, BorderMode, f32) -> Result<Image> = Image::pad;
const _: fn(&Image, u32, u32) -> Result<Image> = crate::image::center_crop;
const _: fn(&Image, u32, u32) -> Result<Image> = Image::center_crop;
const _: fn(&Image, &Matrix, InterpolationMode, BorderMode, f32) -> Result<Image> =
	crate::image::remap;
const _: fn(&Image, &Matrix, InterpolationMode, BorderMode, f32) -> Result<Image> = Image::remap;
const _: fn(&Image, &Matrix, u32, u32, InterpolationMode, BorderMode, f32) -> Result<Image> =
	crate::image::warp_affine;
const _: fn(&Image, &Matrix, u32, u32, InterpolationMode, BorderMode, f32) -> Result<Image> =
	Image::warp_affine;
const _: fn(&Image, &Matrix, u32, u32, InterpolationMode, BorderMode, f32) -> Result<Image> =
	crate::image::warp_perspective;
const _: fn(&Image, &Matrix, u32, u32, InterpolationMode, BorderMode, f32) -> Result<Image> =
	Image::warp_perspective;
const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::threshold_binary;
const _: fn(&Image, f32, f32) -> Result<Image> = Image::threshold_binary;
const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::threshold_binary_inv;
const _: fn(&Image, f32, f32) -> Result<Image> = Image::threshold_binary_inv;
const _: fn(&Image, f32) -> Result<Image> = crate::image::threshold_truncate;
const _: fn(&Image, f32) -> Result<Image> = Image::threshold_truncate;
const _: fn(&Image, f32) -> Result<Image> = crate::image::threshold_to_zero;
const _: fn(&Image, f32) -> Result<Image> = Image::threshold_to_zero;
const _: fn(&Image, f32) -> Result<Image> = crate::image::threshold_to_zero_inv;
const _: fn(&Image, f32) -> Result<Image> = Image::threshold_to_zero_inv;
const _: fn(&Image, f32, f32, f32) -> Result<Image> = crate::image::in_range;
const _: fn(&Image, f32, f32, f32) -> Result<Image> = Image::in_range;
const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::clamp;
const _: fn(&Image, f32, f32) -> Result<Image> = Image::clamp;
const _: fn(&Image, f32) -> Result<Image> = crate::image::invert;
const _: fn(&Image, f32) -> Result<Image> = Image::invert;
const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::brightness_contrast;
const _: fn(&Image, f32, f32) -> Result<Image> = Image::brightness_contrast;
const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::gamma_contrast;
const _: fn(&Image, f32, f32) -> Result<Image> = Image::gamma_contrast;
const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::solarize;
const _: fn(&Image, f32, f32) -> Result<Image> = Image::solarize;
const _: fn(&Image, u32, f32, f32) -> Result<Image> = crate::image::posterize;
const _: fn(&Image, u32, f32, f32) -> Result<Image> = Image::posterize;
const _: fn(&Image) -> Result<Image> = crate::image::grayscale;
const _: fn(&Image) -> Result<Image> = Image::grayscale;
const _: fn(&Image, &Image, f32) -> Result<Image> = crate::image::alpha_blend;
const _: fn(&Image, &Image, f32) -> Result<Image> = Image::alpha_blend;
const _: fn(&Image, &Image, &Image) -> Result<Image> = crate::image::composite;
const _: fn(&Image, &Image, &Image) -> Result<Image> = Image::composite;
const _: fn(&Image, u32, u32, u32, u32, f32) -> Result<Image> = crate::image::erase;
const _: fn(&Image, u32, u32, u32, u32, f32) -> Result<Image> = Image::erase;
const _: fn(&Image, &Matrix) -> Result<Image> = crate::image::color_twist;
const _: fn(&Image, &Matrix) -> Result<Image> = Image::color_twist;
const _: fn(&Image, [u32; 4], ImageFormat) -> Result<Image> = crate::image::channel_reorder;
const _: fn(&Image, [u32; 4], ImageFormat) -> Result<Image> = Image::channel_reorder;
const _: fn(&Image, f32, f32, u64) -> Result<Image> = crate::image::gaussian_noise;
const _: fn(&Image, f32, f32, u64) -> Result<Image> = Image::gaussian_noise;
const _: fn(&Image, f32, f32, f32, u64) -> Result<Image> = crate::image::salt_pepper_noise;
const _: fn(&Image, f32, f32, f32, u64) -> Result<Image> = Image::salt_pepper_noise;
const _: fn(&Image, &Matrix, BorderMode, f32) -> Result<Image> = crate::image::convolve_2d;
const _: fn(&Image, &Matrix, BorderMode, f32) -> Result<Image> = Image::convolve_2d;
const _: fn(&Image, &Matrix, &Matrix, BorderMode, f32) -> Result<Image> =
	crate::image::separable_convolve_2d;
const _: fn(&Image, &Matrix, &Matrix, BorderMode, f32) -> Result<Image> =
	Image::separable_convolve_2d;
const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = crate::image::average_blur;
const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = Image::average_blur;
const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = crate::image::sobel;
const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = Image::sobel;
const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = crate::image::scharr;
const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = Image::scharr;
const _: fn(&Image, BorderMode) -> Result<Image> = crate::image::laplacian;
const _: fn(&Image, BorderMode) -> Result<Image> = Image::laplacian;
const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::erode;
const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::erode;
const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::dilate;
const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::dilate;
const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::morphology_open;
const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::morphology_open;
const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::morphology_close;
const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::morphology_close;
const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::morphology_gradient;
const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::morphology_gradient;
const _: fn(&Image, f32, u32) -> Result<Image> = crate::image::gaussian_blur;
const _: fn(&Image, f32, u32) -> Result<Image> = Image::gaussian_blur;
const _: fn(&Image, f32, BorderMode) -> Result<Image> = crate::image::sharpen;
const _: fn(&Image, f32, BorderMode) -> Result<Image> = Image::sharpen;
const _: fn(&Image, u32, BorderMode) -> Result<Image> = crate::image::median_blur;
const _: fn(&Image, u32, BorderMode) -> Result<Image> = Image::median_blur;
const _: fn(&Image, u32, f32, f32, BorderMode) -> Result<Image> = crate::image::bilateral_filter;
const _: fn(&Image, u32, f32, f32, BorderMode) -> Result<Image> = Image::bilateral_filter;
const _: fn(&Image, f32, f32, u32) -> Result<Image> = crate::image::unsharp_mask;
const _: fn(&Image, f32, f32, u32) -> Result<Image> = Image::unsharp_mask;
const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::morphology_top_hat;
const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::morphology_top_hat;
const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> =
	crate::image::morphology_black_hat;
const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::morphology_black_hat;
const _: fn(&Image, u32, f32, f32, BorderMode) -> Result<Image> =
	crate::image::adaptive_threshold_mean;
const _: fn(&Image, u32, f32, f32, BorderMode) -> Result<Image> = Image::adaptive_threshold_mean;
const _: fn(&Image, u32, f32, f32, f32, BorderMode) -> Result<Image> =
	crate::image::adaptive_threshold_gaussian;
const _: fn(&Image, u32, f32, f32, f32, BorderMode) -> Result<Image> =
	Image::adaptive_threshold_gaussian;
const _: fn(&Image, NormalizationParams) -> Result<Image> = crate::image::normalize;
const _: fn(&Image, NormalizationParams) -> Result<Image> = Image::normalize;
const _: fn(&Image, crate::ImageFormat) -> Result<Image> = crate::image::convert_color;
const _: fn(&Image, crate::ImageFormat) -> Result<Image> = Image::convert_color;
const _: fn(&Image, u32, u32, NormalizationParams) -> Result<Image> =
	crate::image::resize_normalize;
const _: fn(&Image, u32, u32, NormalizationParams) -> Result<Image> = Image::resize_normalize;
const _: fn(&Image, &Matrix, &Matrix, f32) -> Result<Image> = crate::image::segmentation_overlay;
const _: fn(&Image, &Matrix, &Matrix, f32) -> Result<Image> = Image::segmentation_overlay;