The open imaging DSP library
Loading...
Searching...
No Matches
posix.h
1/* SPDX-License-Identifier: Apache-2.0 */
7#ifndef MPIX_POSIX_H
8#define MPIX_POSIX_H
9
10#include <mpix/types.h>
11#include <mpix/pipeline.h>
12
22static inline int mpix_image_to_file(struct mpix_image *img, int file_descriptor, size_t buf_size)
23{
24 int32_t p[] = { (int32_t)file_descriptor, (int32_t)buf_size };
25 int err = mpix_pipeline_add(img, MPIX_OP_POSIX_WRITE, p, ARRAY_SIZE(p));
26 return err ? err : mpix_pipeline_process(img->first_op, img->buffer, img->size);
27}
28
29#endif
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_add(struct mpix_image *img, enum mpix_op_type type, const int32_t *params, size_t params_nb)
Add an operation to an image.
static int mpix_image_to_file(struct mpix_image *img, int file_descriptor, size_t buf_size)
Write an image to an open file.
Definition posix.h:22
Represent the image currently being processed.
Definition types.h:136
struct mpix_base_op * first_op
Definition types.h:138
const uint8_t * buffer
Definition types.h:142
size_t size
Definition types.h:144