Implementing new kernel operations.
More...
|
void | mpix_identity_rgb24_3x3 (const uint8_t *in[3], uint8_t *out, uint16_t width) |
| Apply a 3x3 identity kernel to an RGB24 input window and produce one RGB24 line.
|
|
void | mpix_identity_rgb24_5x5 (const uint8_t *in[5], uint8_t *out, uint16_t width) |
| Apply a 5x5 identity kernel to an RGB24 input window and produce one RGB24 line.
|
|
void | mpix_sharpen_rgb24_3x3 (const uint8_t *in[3], uint8_t *out, uint16_t width) |
| Apply a 3x3 sharpen kernel to an RGB24 input window and produce one RGB24 line.
|
|
void | mpix_sharpen_rgb24_5x5 (const uint8_t *in[5], uint8_t *out, uint16_t width) |
| Apply a 5x5 unsharp kernel to an RGB24 input window and produce one RGB24 line.
|
|
void | mpix_edgedetect_rgb24_3x3 (const uint8_t *in[3], uint8_t *out, uint16_t width) |
| Apply a 3x3 edge detection kernel to an RGB24 input window and produce one RGB24 line.
|
|
void | mpix_gaussianblur_rgb24_3x3 (const uint8_t *in[3], uint8_t *out, uint16_t width) |
| Apply a 3x3 gaussian blur kernel to an RGB24 input window and produce one RGB24 line.
|
|
void | mpix_median_rgb24_3x3 (const uint8_t *in[3], uint8_t *out, uint16_t width) |
| Apply a 3x3 median denoise kernel to an RGB24 input window and produce one RGB24 line.
|
|
void | mpix_median_rgb24_5x5 (const uint8_t *in[5], uint8_t *out, uint16_t width) |
| Apply a 5x5 median denoise kernel to an RGB24 input window and produce one RGB24 line.
|
|
void | mpix_kernel_5x5_op (struct mpix_base_op *op) |
| Helper to turn a 5x5 kernel conversion function into an operation.
|
|
void | mpix_kernel_3x3_op (struct mpix_base_op *op) |
| Helper to turn a 3x3 kernel conversion function into an operation.
|
|
Implementing new kernel operations.
SPDX-License-Identifier: Apache-2.0
◆ MPIX_REGISTER_KERNEL_3X3_OP
#define MPIX_REGISTER_KERNEL_3X3_OP |
( |
|
id, |
|
|
|
fn, |
|
|
|
t, |
|
|
|
fmt |
|
) |
| |
Value:
.base.format_dst = (MPIX_FMT_##fmt), \
.kernel_fn = (fn), \
.type = (MPIX_KERNEL_##t), \
}
void mpix_kernel_3x3_op(struct mpix_base_op *op)
Helper to turn a 3x3 kernel conversion function into an operation.
uint32_t format_src
Definition op.h:33
uint16_t window_size
Definition op.h:43
const uint8_t * name
Definition op.h:31
Definition op_kernel.h:32
struct mpix_base_op base
Definition op_kernel.h:34
Define a new 3x3 kernel conversion operation.
- Parameters
-
id | Short identifier to differentiate operations of the same type. |
fn | Function converting 3 input lines into 1 output line. |
t | Kernel operation type from mpix_kernel_type |
fmt | The input format for that operation. |
◆ MPIX_REGISTER_KERNEL_5X5_OP
#define MPIX_REGISTER_KERNEL_5X5_OP |
( |
|
id, |
|
|
|
fn, |
|
|
|
t, |
|
|
|
fmt |
|
) |
| |
Value:
.base.format_dst = (MPIX_FMT_##fmt), \
.kernel_fn = (fn), \
.type = (MPIX_KERNEL_##t), \
}
void mpix_kernel_5x5_op(struct mpix_base_op *op)
Helper to turn a 5x5 kernel conversion function into an operation.
Define a new 5x5 kernel conversion operation.
- Parameters
-
id | Short identifier to differentiate operations of the same category. |
fn | Function converting 5 input lines into 1 output line. |
t | Kernel operation type from mpix_kernel_type |
fmt | The input format for that operation. |
◆ mpix_kernel_type
Available kernel operations to apply to the image.
Enumerator |
---|
MPIX_KERNEL_IDENTITY | Identity kernel: no change, the input is the same as the output
|
MPIX_KERNEL_EDGE_DETECT | Edge detection kernel: keep only an outline of the edges
|
MPIX_KERNEL_GAUSSIAN_BLUR | Gaussian blur kernel: apply a blur onto an image following a Gaussian curve
|
MPIX_KERNEL_SHARPEN | Sharpen kernel: accentuate the edges, making the image look less blurry
|
MPIX_KERNEL_DENOISE | Denoise kernel: remove the parasitic image noise using the local median value
|
◆ mpix_edgedetect_rgb24_3x3()
void mpix_edgedetect_rgb24_3x3 |
( |
const uint8_t * |
in[3], |
|
|
uint8_t * |
out, |
|
|
uint16_t |
width |
|
) |
| |
Apply a 3x3 edge detection kernel to an RGB24 input window and produce one RGB24 line.
- Parameters
-
in | Array of input line buffers to convert. |
out | Pointer to the output line converted. |
width | Width of the input and output lines in pixels. |
◆ mpix_gaussianblur_rgb24_3x3()
void mpix_gaussianblur_rgb24_3x3 |
( |
const uint8_t * |
in[3], |
|
|
uint8_t * |
out, |
|
|
uint16_t |
width |
|
) |
| |
Apply a 3x3 gaussian blur kernel to an RGB24 input window and produce one RGB24 line.
- Parameters
-
in | Array of input line buffers to convert. |
out | Pointer to the output line converted. |
width | Width of the input and output lines in pixels. |
◆ mpix_identity_rgb24_3x3()
void mpix_identity_rgb24_3x3 |
( |
const uint8_t * |
in[3], |
|
|
uint8_t * |
out, |
|
|
uint16_t |
width |
|
) |
| |
Apply a 3x3 identity kernel to an RGB24 input window and produce one RGB24 line.
- Parameters
-
in | Array of input line buffers to convert. |
out | Pointer to the output line converted. |
width | Width of the input and output lines in pixels. |
◆ mpix_identity_rgb24_5x5()
void mpix_identity_rgb24_5x5 |
( |
const uint8_t * |
in[5], |
|
|
uint8_t * |
out, |
|
|
uint16_t |
width |
|
) |
| |
Apply a 5x5 identity kernel to an RGB24 input window and produce one RGB24 line.
- Parameters
-
in | Array of input line buffers to convert. |
out | Pointer to the output line converted. |
width | Width of the input and output lines in pixels. |
◆ mpix_kernel_3x3_op()
Helper to turn a 3x3 kernel conversion function into an operation.
The line conversion function is free to perform any processing on the input lines and expected to produce one output line.
The line conversion function is to be provided in op->arg0
.
- Parameters
-
op | Current operation in progress. |
◆ mpix_kernel_5x5_op()
Helper to turn a 5x5 kernel conversion function into an operation.
The line conversion function is free to perform any processing on the input lines and expected to produce one output line.
The line conversion function is to be provided in op->arg0
.
- Parameters
-
op | Current operation in progress. |
◆ mpix_median_rgb24_3x3()
void mpix_median_rgb24_3x3 |
( |
const uint8_t * |
in[3], |
|
|
uint8_t * |
out, |
|
|
uint16_t |
width |
|
) |
| |
Apply a 3x3 median denoise kernel to an RGB24 input window and produce one RGB24 line.
- Parameters
-
in | Array of input line buffers to convert. |
out | Pointer to the output line converted. |
width | Width of the input and output lines in pixels. |
◆ mpix_median_rgb24_5x5()
void mpix_median_rgb24_5x5 |
( |
const uint8_t * |
in[5], |
|
|
uint8_t * |
out, |
|
|
uint16_t |
width |
|
) |
| |
Apply a 5x5 median denoise kernel to an RGB24 input window and produce one RGB24 line.
- Parameters
-
in | Array of input line buffers to convert. |
out | Pointer to the output line converted. |
width | Width of the input and output lines in pixels. |
◆ mpix_sharpen_rgb24_3x3()
void mpix_sharpen_rgb24_3x3 |
( |
const uint8_t * |
in[3], |
|
|
uint8_t * |
out, |
|
|
uint16_t |
width |
|
) |
| |
Apply a 3x3 sharpen kernel to an RGB24 input window and produce one RGB24 line.
- Parameters
-
in | Array of input line buffers to convert. |
out | Pointer to the output line converted. |
width | Width of the input and output lines in pixels. |
◆ mpix_sharpen_rgb24_5x5()
void mpix_sharpen_rgb24_5x5 |
( |
const uint8_t * |
in[5], |
|
|
uint8_t * |
out, |
|
|
uint16_t |
width |
|
) |
| |
Apply a 5x5 unsharp kernel to an RGB24 input window and produce one RGB24 line.
- Parameters
-
in | Array of input line buffers to convert. |
out | Pointer to the output line converted. |
width | Width of the input and output lines in pixels. |