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

Implementing new resizing operations. More...

Data Structures

struct  mpix_resize_op
 

Macros

#define MPIX_REGISTER_RESIZE_OP(id, fn, fmt)
 Define a format conversion operation.
 

Functions

void mpix_resize_frame_raw24 (const uint8_t *src_buf, size_t src_width, size_t src_height, uint8_t *dst_buf, size_t dst_width, size_t dst_height)
 Resize an 24-bit per pixel frame by subsampling the pixels horizontally/vertically.
 
void mpix_resize_frame_raw16 (const uint8_t *src_buf, size_t src_width, size_t src_height, uint8_t *dst_buf, size_t dst_width, size_t dst_height)
 Resize an 16-bit per pixel frame by subsampling the pixels horizontally/vertically.
 
void mpix_resize_frame_raw8 (const uint8_t *src_buf, size_t src_width, size_t src_height, uint8_t *dst_buf, size_t dst_width, size_t dst_height)
 Resize an 8-bit per pixel frame by subsampling the pixels horizontally/vertically.
 

Detailed Description

Implementing new resizing operations.

SPDX-License-Identifier: Apache-2.0

Macro Definition Documentation

◆ MPIX_REGISTER_RESIZE_OP

#define MPIX_REGISTER_RESIZE_OP (   id,
  fn,
  fmt 
)
Value:
const struct mpix_resize_op mpix_resize_op_##id = { \
.base.name = ("resize_" #id), \
.base.format_src = (MPIX_FMT_##fmt), \
.base.format_dst = (MPIX_FMT_##fmt), \
.base.window_size = 1, \
.base.run = (fn), \
}
uint32_t format_src
Definition op.h:33
uint16_t window_size
Definition op.h:43
const uint8_t * name
Definition op.h:31
Definition op_resize.h:15
struct mpix_base_op base
Definition op_resize.h:17

Define a format conversion operation.

Invoking this macro suffices for mpix_image_convert() to include the extra format.

Parameters
idShort identifier to differentiate operations of the same type.
fnFunction converting one input line.
fmtThe pixel format of the data resized.

Function Documentation

◆ mpix_resize_frame_raw16()

void mpix_resize_frame_raw16 ( const uint8_t *  src_buf,
size_t  src_width,
size_t  src_height,
uint8_t *  dst_buf,
size_t  dst_width,
size_t  dst_height 
)

Resize an 16-bit per pixel frame by subsampling the pixels horizontally/vertically.

Parameters
src_bufInput buffer to resize
src_widthWidth of the input in number of pixels.
src_heightHeight of the input in number of pixels.
dst_bufOutput buffer in which the stretched/compressed is stored.
dst_widthWidth of the output in number of pixels.
dst_heightHeight of the output in number of pixels.

◆ mpix_resize_frame_raw24()

void mpix_resize_frame_raw24 ( const uint8_t *  src_buf,
size_t  src_width,
size_t  src_height,
uint8_t *  dst_buf,
size_t  dst_width,
size_t  dst_height 
)

Resize an 24-bit per pixel frame by subsampling the pixels horizontally/vertically.

Parameters
src_bufInput buffer to resize
src_widthWidth of the input in number of pixels.
src_heightHeight of the input in number of pixels.
dst_bufOutput buffer in which the stretched/compressed is stored.
dst_widthWidth of the output in number of pixels.
dst_heightHeight of the output in number of pixels.

◆ mpix_resize_frame_raw8()

void mpix_resize_frame_raw8 ( const uint8_t *  src_buf,
size_t  src_width,
size_t  src_height,
uint8_t *  dst_buf,
size_t  dst_width,
size_t  dst_height 
)

Resize an 8-bit per pixel frame by subsampling the pixels horizontally/vertically.

Parameters
src_bufInput buffer to resize
src_widthWidth of the input in number of pixels.
src_heightHeight of the input in number of pixels.
dst_bufOutput buffer in which the stretched/compressed is stored.
dst_widthWidth of the output in number of pixels.
dst_heightHeight of the output in number of pixels.