Utilities to implement new operations.
More...
|
#define | MPIX_REGISTER_OP(name, ...) MPIX_REGISTER_NB(name, ## __VA_ARGS__, P_NB) |
| Register an operation globally in the library.
|
|
#define | MPIX_REGISTER_NB(name, ...) enum { __VA_ARGS__ }; const size_t mpix_params_nb_##name = P_NB |
|
#define | MPIX_OP_PARAMS_NB(X, x) extern const size_t mpix_params_nb_##x; |
|
#define | MPIX_OP_ADD(X, x) int mpix_add_##x(struct mpix_image *img, const int32_t *params); |
|
#define | MPIX_OP_RUN(X, x) int mpix_run_##x(struct mpix_base_op *op); |
|
#define | MPIX_OP_INPUT_LINES(...) { int e = mpix_op_input_lines(__VA_ARGS__); if (e) return e; } |
|
#define | MPIX_OP_INPUT_BYTES(...) { int e = mpix_op_input_bytes(__VA_ARGS__); if (e) return e; } |
|
#define | MPIX_OP_INPUT_DONE(...) { int e = mpix_op_input_done(__VA_ARGS__); if (e) return e; } |
|
#define | MPIX_OP_INPUT_PEEK(...) { int e = mpix_op_input_peek(__VA_ARGS__); if (e) return e; } |
|
#define | MPIX_OP_INPUT_FLUSH(...) { int e = mpix_op_input_flush(__VA_ARGS__); if (e) return e; } |
|
#define | MPIX_OP_OUTPUT_LINE(...) { int e = mpix_op_output_line(__VA_ARGS__); if (e) return e; } |
|
#define | MPIX_OP_OUTPUT_DONE(...) { int e = mpix_op_output_done(__VA_ARGS__); if (e) return e; } |
|
#define | MPIX_OP_OUTPUT_PEEK(...) { int e = mpix_op_output_peek(__VA_ARGS__); if (e) return e; } |
|
#define | MPIX_OP_OUTPUT_FLUSH(...) { int e = mpix_op_output_flush(__VA_ARGS__); if (e) return e; } |
|
|
static int | mpix_op_input_lines (struct mpix_base_op *op, const uint8_t **src, size_t num) |
|
static int | mpix_op_input_bytes (struct mpix_base_op *op, const uint8_t **src, size_t bytes) |
|
static int | mpix_op_input_done (struct mpix_base_op *op, size_t lines) |
|
static int | mpix_op_input_peek (struct mpix_base_op *op, const uint8_t **src, size_t *sz) |
|
static int | mpix_op_input_flush (struct mpix_base_op *op, size_t bytes) |
|
static void | mpix_op_input_all (struct mpix_base_op *op, const uint8_t **src, size_t *sz) |
|
static int | mpix_op_output_peek (struct mpix_base_op *op, uint8_t **dst, size_t *sz) |
|
static int | mpix_op_output_done (struct mpix_base_op *op) |
|
static int | mpix_op_output_line (struct mpix_base_op *op, uint8_t **dst) |
|
static int | mpix_op_output_flush (struct mpix_base_op *op, size_t bytes) |
|
static void * | mpix_op_append (struct mpix_image *img, enum mpix_op_type op_type, size_t op_sz, size_t buf_sz) |
| Allocate a new operation and add it to an image pipeline.
|
|
Utilities to implement new operations.
◆ MPIX_OP_INPUT_BYTES
#define MPIX_OP_INPUT_BYTES |
( |
|
... | ) |
{ int e = mpix_op_input_bytes(__VA_ARGS__); if (e) return e; } |
Call mpix_op_input_bytes() and return the error if any
◆ MPIX_OP_INPUT_DONE
#define MPIX_OP_INPUT_DONE |
( |
|
... | ) |
{ int e = mpix_op_input_done(__VA_ARGS__); if (e) return e; } |
Call mpix_op_input_done() and return the error if any
◆ MPIX_OP_INPUT_FLUSH
#define MPIX_OP_INPUT_FLUSH |
( |
|
... | ) |
{ int e = mpix_op_input_flush(__VA_ARGS__); if (e) return e; } |
Call mpix_op_input_flush() and return the error if any
◆ MPIX_OP_INPUT_LINES
#define MPIX_OP_INPUT_LINES |
( |
|
... | ) |
{ int e = mpix_op_input_lines(__VA_ARGS__); if (e) return e; } |
Call mpix_op_input_lines() and return the error if any
◆ MPIX_OP_INPUT_PEEK
#define MPIX_OP_INPUT_PEEK |
( |
|
... | ) |
{ int e = mpix_op_input_peek(__VA_ARGS__); if (e) return e; } |
Call mpix_op_input_peek() and return the error if any
◆ MPIX_OP_OUTPUT_DONE
#define MPIX_OP_OUTPUT_DONE |
( |
|
... | ) |
{ int e = mpix_op_output_done(__VA_ARGS__); if (e) return e; } |
Call mpix_op_output_done() and return the error if any
◆ MPIX_OP_OUTPUT_FLUSH
#define MPIX_OP_OUTPUT_FLUSH |
( |
|
... | ) |
{ int e = mpix_op_output_flush(__VA_ARGS__); if (e) return e; } |
Call mpix_op_output_flush() and return the error if any
◆ MPIX_OP_OUTPUT_LINE
#define MPIX_OP_OUTPUT_LINE |
( |
|
... | ) |
{ int e = mpix_op_output_line(__VA_ARGS__); if (e) return e; } |
Call mpix_op_output_line() and return the error if any
◆ MPIX_OP_OUTPUT_PEEK
#define MPIX_OP_OUTPUT_PEEK |
( |
|
... | ) |
{ int e = mpix_op_output_peek(__VA_ARGS__); if (e) return e; } |
Call mpix_op_output_peek() and return the error if any
◆ MPIX_REGISTER_OP
#define MPIX_REGISTER_OP |
( |
|
name, |
|
|
|
... |
|
) |
| MPIX_REGISTER_NB(name, ## __VA_ARGS__, P_NB) |
Register an operation globally in the library.
The declaration is collected by generated.py which adds it to the MPIX_FOR_EACH_OP() macro used to generate code.
- Parameters
-
name | The identifier assigned to the operation |
... | A list of parameter names in their correct order. |
◆ mpix_op_append()
static void * mpix_op_append |
( |
struct mpix_image * |
img, |
|
|
enum mpix_op_type |
op_type, |
|
|
size_t |
op_sz, |
|
|
size_t |
buf_sz |
|
) |
| |
|
inlinestatic |
Allocate a new operation and add it to an image pipeline.
- Parameters
-
op_type | Type of the new operation. |
op_sz | Size of the operation struct, allocated immediately. |
buf_sz | Size of the buffer, allocated when calling mpix_pipeline_alloc(). |