![]() |
The open imaging DSP library
|
Build and manage pipeline of operations. More...
Functions | |
int | mpix_pipeline_run_loop (struct mpix_base_op *op) |
Run a pipeline of operation until there is no more input to send. | |
int | mpix_pipeline_run_once (struct mpix_base_op *op) |
int | mpix_params_nb (enum mpix_op_type type) |
Get the number of parameters that an operation accepts. | |
int | mpix_pipeline_add (struct mpix_image *img, enum mpix_op_type type, const int32_t *params, size_t params_nb) |
Add an operation to an image. | |
void * | mpix_pipeline_append (struct mpix_image *img, enum mpix_op_type op_type, size_t op_sz, size_t buf_sz) |
Add a operation processing step to an image. | |
int | mpix_pipeline_alloc (struct mpix_base_op *first_op) |
Allocate intermediate memory for all operations of a pipeline. | |
void | mpix_pipeline_free (struct mpix_base_op *first_op) |
Free the intermediate memory as well as operations of a pipeline. | |
int | mpix_pipeline_set_palette (struct mpix_base_op *first_op, struct mpix_palette *palette) |
Set an image palette for every palette-related elements of the pipeline. | |
int | mpix_pipeline_process (struct mpix_base_op *op, const uint8_t *buffer, size_t size) |
Process a buffer into a pipeline. | |
int | mpix_pipeline_get_palette_fourcc (struct mpix_base_op *first_op, struct mpix_palette *palette) |
Build and manage pipeline of operations.
SPDX-License-Identifier: Apache-2.0
int mpix_params_nb | ( | enum mpix_op_type | type | ) |
Get the number of parameters that an operation accepts.
type | The operation type. |
The | number of parameters or negative error code on invalid operation. |
int mpix_pipeline_add | ( | struct mpix_image * | img, |
enum mpix_op_type | type, | ||
const int32_t * | params, | ||
size_t | params_nb | ||
) |
Add an operation to an image.
img | The image to which add operations. |
type | The operation type to allocate and add. |
params | The array of parameters for that operation. |
params_nb | The number of parameters in that array. |
int mpix_pipeline_alloc | ( | struct mpix_base_op * | first_op | ) |
Allocate intermediate memory for all operations of a pipeline.
It will go through every operation of the pipeline and only allocate buffers not yet allocated. This allows buffers to be manually allocated as first or last element of the pipeline if needed. Only the newly allocated buffers will be freed by mpix_op_pipeline_free().
first_op | The first operation of the pipeline. |
void mpix_pipeline_free | ( | struct mpix_base_op * | first_op | ) |
Free the intermediate memory as well as operations of a pipeline.
This will free every node of a pipeline as well as their intermediate buffers. This will only free memory allocated by libmpix, keeping all buffers provided by the application unchanged..
first_op | The first operation of the pipeline. |
int mpix_pipeline_process | ( | struct mpix_base_op * | op, |
const uint8_t * | buffer, | ||
size_t | size | ||
) |
Process a buffer into a pipeline.
The pipeline is first allocated, then the pipeline is continuously fed with data from the buffer.
first_op | The first operation of the pipeline. |
palette | The color palette to add. |
int mpix_pipeline_run_loop | ( | struct mpix_base_op * | op | ) |
Run a pipeline of operation until there is no more input to send.
It runs until all the input buffer is consumed.
This is called by mpix_image_process to run the operation chain until the input buffer is empty, as well as in mpix_op_done to run the next operation in the chain.
op | The first operation of the pipeline. |
int mpix_pipeline_set_palette | ( | struct mpix_base_op * | first_op, |
struct mpix_palette * | palette | ||
) |
Set an image palette for every palette-related elements of the pipeline.
It will add the palette only if the operation is allowing to select the palette, and only if the pixel format of the palette matches the operation.
first_op | The first operation of the pipeline. |
palette | The color palette to add. |