The open imaging DSP library
Loading...
Searching...
No Matches
Functions
mpix/sample.h

Sampling of image pixels [EXPERIMENTAL]. More...

Functions

int mpix_sample_random_rgb (const uint8_t *buf, uint16_t width, uint16_t height, uint32_t fourcc, uint8_t *dst)
 Collect a pixel at a random location from the input buffer in RGB24 format.
 

Detailed Description

Sampling of image pixels [EXPERIMENTAL].

SPDX-License-Identifier: Apache-2.0

Function Documentation

◆ mpix_sample_random_rgb()

int mpix_sample_random_rgb ( const uint8_t *  buf,
uint16_t  width,
uint16_t  height,
uint32_t  fourcc,
uint8_t *  dst 
)

Collect a pixel at a random location from the input buffer in RGB24 format.

Parameters
bufBuffer of pixels from which collect the sample.
widthWidth of the buffer in pixel.
heightHeight of the buffer in pixel.
fourccPixel format of the buffer as a Four Character Code.
dstBuffer for one pixel filled by this function.
Returns
0 on success, negative error code on error.