Build and manage pipeline of operations.
More...
Build and manage pipeline of operations.
SPDX-License-Identifier: Apache-2.0
◆ mpix_params_nb()
Get the number of parameters that an operation accepts.
- Parameters
-
- Returns
- The number of parameters or negative error code on invalid operation.
◆ mpix_pipeline_add()
| 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.
- Parameters
-
| 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. |
- Returns
- 0 on success or negative error code.
◆ mpix_pipeline_add_array()
| int mpix_pipeline_add_array |
( |
struct mpix_image * |
img, |
|
|
int32_t |
array[], |
|
|
size_t |
size |
|
) |
| |
Append an array of integer into a pipeline operation.
- Parameters
-
| 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. |
- Returns
- 0 on success or negative error code.
◆ mpix_pipeline_alloc()
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().
- Parameters
-
| first_op | The first operation of the pipeline. |
- Returns
- 0 on success or negative error code.
◆ mpix_pipeline_free()
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..
- Parameters
-
| first_op | The first operation of the pipeline. |
- Returns
- 0 on success or negative error code
◆ mpix_pipeline_process()
| 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.
- Parameters
-
| first_op | The first operation of the pipeline. |
| palette | The color palette to add. |
- Returns
- 0 on success or negative error code
◆ mpix_pipeline_run_loop()
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.
- Parameters
-
| op | The first operation of the pipeline. |
- Returns
- 0 on success or negative error code.
◆ mpix_pipeline_run_once()
Run a pipeline of operation on a single input line.
- Parameters
-
| op | The first operation of the pipeline. |
- Returns
- 0 on success or negative error code.
◆ mpix_pipeline_set_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.
- Parameters
-
| first_op | The first operation of the pipeline. |
| palette | The color palette to add. |
- Returns
- 0 on success or negative error code