The open imaging DSP library
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
mpix/op_convert.h

Implementing new conversion operations. More...

Macros

#define MPIX_REGISTER_CONVERT_OP(id, fn, format_in, format_out)
 Define a new format conversion operation.
 

Functions

uint8_t mpix_rgb24_get_luma_bt709 (const uint8_t rgb24[3])
 Get the luminance (luma channel) of an RGB24 pixel.
 
void mpix_convert_rgb24_to_rgb24 (const uint8_t *src, uint8_t *dst, uint16_t width)
 Convert a line of pixel data from RGB24 to RGB24 (null conversion).
 
void mpix_convert_rgb332_to_rgb24 (const uint8_t *src, uint8_t *dst, uint16_t width)
 Convert a line of pixel data from RGB332 to RGB24.
 
void mpix_convert_rgb24_to_rgb332 (const uint8_t *src, uint8_t *dst, uint16_t width)
 Convert a line of pixel data from RGB24 to RGB332 little-endian.
 
void mpix_convert_rgb565le_to_rgb24 (const uint8_t *src, uint8_t *dst, uint16_t width)
 Convert a line of pixel data from RGB565 little-endian to RGB24.
 
void mpix_convert_rgb565be_to_rgb24 (const uint8_t *src, uint8_t *dst, uint16_t width)
 Convert a line of pixel data from RGB565 big-endian to RGB24.
 
void mpix_convert_rgb24_to_rgb565le (const uint8_t *src, uint8_t *dst, uint16_t width)
 Convert a line of pixel data from RGB24 to RGB565 little-endian.
 
void mpix_convert_rgb24_to_rgb565be (const uint8_t *src, uint8_t *dst, uint16_t width)
 Convert a line of pixel data from RGB24 to RGB565 big-endian.
 
void mpix_convert_yuyv_to_rgb24_bt709 (const uint8_t *src, uint8_t *dst, uint16_t width)
 Convert a line of pixel data from YUYV to RGB24 (BT.709 coefficients).
 
void mpix_convert_rgb24_to_yuyv_bt709 (const uint8_t *src, uint8_t *dst, uint16_t width)
 Convert a line of pixel data from RGB24 to YUYV (BT.709 coefficients).
 
void mpix_convert_rgb24_to_yuv24_bt709 (const uint8_t *src, uint8_t *dst, uint16_t width)
 Convert a line of pixel data from RGB24 to YUV24 (BT.709 coefficients).
 
void mpix_convert_yuv24_to_rgb24_bt709 (const uint8_t *src, uint8_t *dst, uint16_t width)
 Convert a line of pixel data from YUV24 to RGB24 (BT.709 coefficients).
 
void mpix_convert_yuyv_to_yuv24 (const uint8_t *src, uint8_t *dst, uint16_t width)
 Convert a line of pixel data from YUYV to YUV24.
 
void mpix_convert_yuv24_to_yuyv (const uint8_t *src, uint8_t *dst, uint16_t width)
 Convert a line of pixel data from YUV24 to YUYV.
 
void mpix_convert_y8_to_rgb24_bt709 (const uint8_t *src, uint8_t *dst, uint16_t width)
 Convert a line of pixel data from Y8 to RGB24.
 
void mpix_convert_rgb24_to_y8_bt709 (const uint8_t *src, uint8_t *dst, uint16_t width)
 Convert a line of pixel data from RGB24 to Y8.
 
void mpix_op_convert (struct mpix_base_op *op)
 Helper to turn a format conversion function into an operation.
 

Detailed Description

Implementing new conversion operations.

SPDX-License-Identifier: Apache-2.0

Macro Definition Documentation

◆ MPIX_REGISTER_CONVERT_OP

#define MPIX_REGISTER_CONVERT_OP (   id,
  fn,
  format_in,
  format_out 
)
Value:
const struct mpix_convert_op mpix_convert_op_##id = { \
.base.name = ("convert_" #id), \
.base.format_src = (MPIX_FMT_##format_in), \
.base.format_dst = (MPIX_FMT_##format_out), \
.base.window_size = 1, \
.base.run = (mpix_convert_op), \
.convert_fn = (fn), \
}

Define a new format conversion operation.

Parameters
idShort identifier to differentiate operations of the same type.
fnFunction converting one input line.
format_inThe input format for that operation.
format_outThe Output format for that operation.

Function Documentation

◆ mpix_convert_rgb24_to_rgb24()

void mpix_convert_rgb24_to_rgb24 ( const uint8_t *  src,
uint8_t *  dst,
uint16_t  width 
)

Convert a line of pixel data from RGB24 to RGB24 (null conversion).

See mpix/formats.h for the definition of the input and output formats.

You only need to call this function to work directly on raw buffers. See mpix_image_convert for converting between formats.

Parameters
srcBuffer of the input line in the format, XXX in mpix_convert_XXX_to_YYY().
dstBuffer of the output line in the format, YYY in mpix_convert_XXX_to_YYY().
widthWidth of the lines in number of pixels.

◆ mpix_convert_rgb24_to_rgb332()

void mpix_convert_rgb24_to_rgb332 ( const uint8_t *  src,
uint8_t *  dst,
uint16_t  width 
)

Convert a line of pixel data from RGB24 to RGB332 little-endian.

See mpix/formats.h for the definition of the input and output formats.

You only need to call this function to work directly on raw buffers. See mpix_image_convert for converting between formats.

Parameters
srcBuffer of the input line in the format, XXX in mpix_convert_XXX_to_YYY().
dstBuffer of the output line in the format, YYY in mpix_convert_XXX_to_YYY().
widthWidth of the lines in number of pixels.

◆ mpix_convert_rgb24_to_rgb565be()

void mpix_convert_rgb24_to_rgb565be ( const uint8_t *  src,
uint8_t *  dst,
uint16_t  width 
)

Convert a line of pixel data from RGB24 to RGB565 big-endian.

See mpix/formats.h for the definition of the input and output formats.

You only need to call this function to work directly on raw buffers. See mpix_image_convert for converting between formats.

Parameters
srcBuffer of the input line in the format, XXX in mpix_convert_XXX_to_YYY().
dstBuffer of the output line in the format, YYY in mpix_convert_XXX_to_YYY().
widthWidth of the lines in number of pixels.

◆ mpix_convert_rgb24_to_rgb565le()

void mpix_convert_rgb24_to_rgb565le ( const uint8_t *  src,
uint8_t *  dst,
uint16_t  width 
)

Convert a line of pixel data from RGB24 to RGB565 little-endian.

See mpix/formats.h for the definition of the input and output formats.

You only need to call this function to work directly on raw buffers. See mpix_image_convert for converting between formats.

Parameters
srcBuffer of the input line in the format, XXX in mpix_convert_XXX_to_YYY().
dstBuffer of the output line in the format, YYY in mpix_convert_XXX_to_YYY().
widthWidth of the lines in number of pixels.

◆ mpix_convert_rgb24_to_y8_bt709()

void mpix_convert_rgb24_to_y8_bt709 ( const uint8_t *  src,
uint8_t *  dst,
uint16_t  width 
)

Convert a line of pixel data from RGB24 to Y8.

See mpix/formats.h for the definition of the input and output formats.

You only need to call this function to work directly on raw buffers. See mpix_image_convert for converting between formats.

Parameters
srcBuffer of the input line in the format, XXX in mpix_convert_XXX_to_YYY().
dstBuffer of the output line in the format, YYY in mpix_convert_XXX_to_YYY().
widthWidth of the lines in number of pixels.

◆ mpix_convert_rgb24_to_yuv24_bt709()

void mpix_convert_rgb24_to_yuv24_bt709 ( const uint8_t *  src,
uint8_t *  dst,
uint16_t  width 
)

Convert a line of pixel data from RGB24 to YUV24 (BT.709 coefficients).

See mpix/formats.h for the definition of the input and output formats.

You only need to call this function to work directly on raw buffers. See mpix_image_convert for converting between formats.

Parameters
srcBuffer of the input line in the format, XXX in mpix_convert_XXX_to_YYY().
dstBuffer of the output line in the format, YYY in mpix_convert_XXX_to_YYY().
widthWidth of the lines in number of pixels.

◆ mpix_convert_rgb24_to_yuyv_bt709()

void mpix_convert_rgb24_to_yuyv_bt709 ( const uint8_t *  src,
uint8_t *  dst,
uint16_t  width 
)

Convert a line of pixel data from RGB24 to YUYV (BT.709 coefficients).

See mpix/formats.h for the definition of the input and output formats.

You only need to call this function to work directly on raw buffers. See mpix_image_convert for converting between formats.

Parameters
srcBuffer of the input line in the format, XXX in mpix_convert_XXX_to_YYY().
dstBuffer of the output line in the format, YYY in mpix_convert_XXX_to_YYY().
widthWidth of the lines in number of pixels.

◆ mpix_convert_rgb332_to_rgb24()

void mpix_convert_rgb332_to_rgb24 ( const uint8_t *  src,
uint8_t *  dst,
uint16_t  width 
)

Convert a line of pixel data from RGB332 to RGB24.

See mpix/formats.h for the definition of the input and output formats.

You only need to call this function to work directly on raw buffers. See mpix_image_convert for converting between formats.

Parameters
srcBuffer of the input line in the format, XXX in mpix_convert_XXX_to_YYY().
dstBuffer of the output line in the format, YYY in mpix_convert_XXX_to_YYY().
widthWidth of the lines in number of pixels.

◆ mpix_convert_rgb565be_to_rgb24()

void mpix_convert_rgb565be_to_rgb24 ( const uint8_t *  src,
uint8_t *  dst,
uint16_t  width 
)

Convert a line of pixel data from RGB565 big-endian to RGB24.

See mpix/formats.h for the definition of the input and output formats.

You only need to call this function to work directly on raw buffers. See mpix_image_convert for converting between formats.

Parameters
srcBuffer of the input line in the format, XXX in mpix_convert_XXX_to_YYY().
dstBuffer of the output line in the format, YYY in mpix_convert_XXX_to_YYY().
widthWidth of the lines in number of pixels.

◆ mpix_convert_rgb565le_to_rgb24()

void mpix_convert_rgb565le_to_rgb24 ( const uint8_t *  src,
uint8_t *  dst,
uint16_t  width 
)

Convert a line of pixel data from RGB565 little-endian to RGB24.

See mpix/formats.h for the definition of the input and output formats.

You only need to call this function to work directly on raw buffers. See mpix_image_convert for converting between formats.

Parameters
srcBuffer of the input line in the format, XXX in mpix_convert_XXX_to_YYY().
dstBuffer of the output line in the format, YYY in mpix_convert_XXX_to_YYY().
widthWidth of the lines in number of pixels.

◆ mpix_convert_y8_to_rgb24_bt709()

void mpix_convert_y8_to_rgb24_bt709 ( const uint8_t *  src,
uint8_t *  dst,
uint16_t  width 
)

Convert a line of pixel data from Y8 to RGB24.

See mpix/formats.h for the definition of the input and output formats.

You only need to call this function to work directly on raw buffers. See mpix_image_convert for converting between formats.

Parameters
srcBuffer of the input line in the format, XXX in mpix_convert_XXX_to_YYY().
dstBuffer of the output line in the format, YYY in mpix_convert_XXX_to_YYY().
widthWidth of the lines in number of pixels.

◆ mpix_convert_yuv24_to_rgb24_bt709()

void mpix_convert_yuv24_to_rgb24_bt709 ( const uint8_t *  src,
uint8_t *  dst,
uint16_t  width 
)

Convert a line of pixel data from YUV24 to RGB24 (BT.709 coefficients).

See mpix/formats.h for the definition of the input and output formats.

You only need to call this function to work directly on raw buffers. See mpix_image_convert for converting between formats.

Parameters
srcBuffer of the input line in the format, XXX in mpix_convert_XXX_to_YYY().
dstBuffer of the output line in the format, YYY in mpix_convert_XXX_to_YYY().
widthWidth of the lines in number of pixels.

◆ mpix_convert_yuv24_to_yuyv()

void mpix_convert_yuv24_to_yuyv ( const uint8_t *  src,
uint8_t *  dst,
uint16_t  width 
)

Convert a line of pixel data from YUV24 to YUYV.

See mpix/formats.h for the definition of the input and output formats.

You only need to call this function to work directly on raw buffers. See mpix_image_convert for converting between formats.

Parameters
srcBuffer of the input line in the format, XXX in mpix_convert_XXX_to_YYY().
dstBuffer of the output line in the format, YYY in mpix_convert_XXX_to_YYY().
widthWidth of the lines in number of pixels.

◆ mpix_convert_yuyv_to_rgb24_bt709()

void mpix_convert_yuyv_to_rgb24_bt709 ( const uint8_t *  src,
uint8_t *  dst,
uint16_t  width 
)

Convert a line of pixel data from YUYV to RGB24 (BT.709 coefficients).

See mpix/formats.h for the definition of the input and output formats.

You only need to call this function to work directly on raw buffers. See mpix_image_convert for converting between formats.

Parameters
srcBuffer of the input line in the format, XXX in mpix_convert_XXX_to_YYY().
dstBuffer of the output line in the format, YYY in mpix_convert_XXX_to_YYY().
widthWidth of the lines in number of pixels.

◆ mpix_convert_yuyv_to_yuv24()

void mpix_convert_yuyv_to_yuv24 ( const uint8_t *  src,
uint8_t *  dst,
uint16_t  width 
)

Convert a line of pixel data from YUYV to YUV24.

See mpix/formats.h for the definition of the input and output formats.

You only need to call this function to work directly on raw buffers. See mpix_image_convert for converting between formats.

Parameters
srcBuffer of the input line in the format, XXX in mpix_convert_XXX_to_YYY().
dstBuffer of the output line in the format, YYY in mpix_convert_XXX_to_YYY().
widthWidth of the lines in number of pixels.

◆ mpix_op_convert()

void mpix_op_convert ( struct mpix_base_op op)

Helper to turn a format conversion function into an operation.

The line conversion function is to be provided in op->arg0. It processes on the input line to convert it to the destination format.

Parameters
opCurrent operation in progress.

◆ mpix_rgb24_get_luma_bt709()

uint8_t mpix_rgb24_get_luma_bt709 ( const uint8_t  rgb24[3])

Get the luminance (luma channel) of an RGB24 pixel.

Parameters
rgb24Pointer to an RGB24 pixel: red, green, blue channels.