ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcbMath.c File Reference
#include <ngc/core/ngcb.h>

Macros

#define _GNU_SOURCE
 
#define _REENTRANT
 
#define PIX_SWAP(a, b)
 

Functions

int ngcbEndian (void)
 
void ngcbSwap2 (void *buffer, size_t length)
 
void ngcbSwap4 (void *buffer, size_t length)
 
void ngcbSwap8 (void *buffer, size_t length)
 
int ngcbBin2Int (const char *str)
 
unsigned int ngcbBin2UInt (const char *str)
 
void ngcbInt2Bin (char *str, int in)
 
void ngcbUInt2Bin (char *str, unsigned int in)
 
int ngcbRound (double x)
 
int ngcbRoundL (long double x)
 
int64_t ngcbRound64 (double x)
 
int64_t ngcbRound64L (long double x)
 
double ngcbMean16 (unsigned short *a, int n)
 
double ngcbMean32 (int *a, int n)
 
double ngcbMeanR32 (float *a, int n)
 
double ngcbMeanR64 (double *a, int n)
 
unsigned short ngcbMedian16 (unsigned short *a, int n)
 
int ngcbMedian32 (int *a, int n)
 
float ngcbMedianR32 (float *a, int n)
 
void ngcbFilterInit (ngcb_ma_t *f, int size)
 
void ngcbFilterDelete (ngcb_ma_t *f)
 
void ngcbFilterReset (ngcb_ma_t *f)
 
double ngcbFilter (ngcb_ma_t *f, double value)
 
void ngcbMedianInit (ngcb_rm_t *f, int size)
 
void ngcbMedianDelete (ngcb_rm_t *f)
 
void ngcbMedianReset (ngcb_rm_t *f)
 
int ngcbRunningMedian (ngcb_rm_t *f, int value)
 

Detailed Description

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

◆ _REENTRANT

#define _REENTRANT

◆ PIX_SWAP

#define PIX_SWAP ( a,
b )
Value:
{tmp=(a);(a)=(b);(b)=tmp;}

Function Documentation

◆ ngcbBin2Int()

int ngcbBin2Int ( const char * str)

Convert binary format string to signed integer. The string to be passed can contain up to 32 characters '0' or '1'.

◆ ngcbBin2UInt()

unsigned int ngcbBin2UInt ( const char * str)

Convert binary format string to an unsigned integer. The string to be passed can contain up to 32 characters '0' or '1'.

◆ ngcbEndian()

int ngcbEndian ( void )

Return ngcbBIG_ENDIAN (1) in case the memory architecture is big endian, otherwise ngcbLITTLE_ENDIAN (0) is returned.

◆ ngcbFilter()

double ngcbFilter ( ngcb_ma_t * f,
double value )

Return next filtered value (moving average).

◆ ngcbFilterDelete()

void ngcbFilterDelete ( ngcb_ma_t * f)

Delete moving average filter.

◆ ngcbFilterInit()

void ngcbFilterInit ( ngcb_ma_t * f,
int size )

Initialize moving average filter.

◆ ngcbFilterReset()

void ngcbFilterReset ( ngcb_ma_t * f)

Reset moving average filter.

◆ ngcbInt2Bin()

void ngcbInt2Bin ( char * str,
int in )

Convert a signed integer value to binary format string.

◆ ngcbMean16()

double ngcbMean16 ( unsigned short * a,
int n )

Compute mean-value of 16-bit unsigned integer array.

◆ ngcbMean32()

double ngcbMean32 ( int * a,
int n )

Compute mean-value of 32-bit signed integer array.

◆ ngcbMeanR32()

double ngcbMeanR32 ( float * a,
int n )

Compute mean-value of 32-bit floating point array.

◆ ngcbMeanR64()

double ngcbMeanR64 ( double * a,
int n )

Compute mean-value of 64-bit floating point array.

◆ ngcbMedian16()

unsigned short ngcbMedian16 ( unsigned short * a,
int n )

Compute median of 16-bit unsigned integer array.

◆ ngcbMedian32()

int ngcbMedian32 ( int * a,
int n )

Compute median of 32-bit signed integer array.

◆ ngcbMedianDelete()

void ngcbMedianDelete ( ngcb_rm_t * f)

Delete running median filter.

◆ ngcbMedianInit()

void ngcbMedianInit ( ngcb_rm_t * f,
int size )

Initialize running median filter.

◆ ngcbMedianR32()

float ngcbMedianR32 ( float * a,
int n )

Compute median of 32-bit floating point array.

◆ ngcbMedianReset()

void ngcbMedianReset ( ngcb_rm_t * f)

Reset running median filter.

◆ ngcbRound()

int ngcbRound ( double x)

Round argument to the nearest 32-bit integral value.

◆ ngcbRound64()

int64_t ngcbRound64 ( double x)

Round argument to the nearest 64-bit integral value

◆ ngcbRound64L()

int64_t ngcbRound64L ( long double x)

Round argument to the nearest 64-bit integral value

◆ ngcbRoundL()

int ngcbRoundL ( long double x)

Round argument to the nearest 32-bit integral value.

◆ ngcbRunningMedian()

int ngcbRunningMedian ( ngcb_rm_t * f,
int value )

Return next filtered value (running median).

◆ ngcbSwap2()

void ngcbSwap2 ( void * buffer,
size_t length )

Change the byte order of the 16-bit numbers in buffer from 1,2 to 2,1. length is the number of 16-bit items in the buffer.

◆ ngcbSwap4()

void ngcbSwap4 ( void * buffer,
size_t length )

Change the byte order of the 32-bit numbers in buffer from 1,2,3,4 to 4,3,2,1. length is the number of 32-bit items (integer, single precision float) in the buffer.

◆ ngcbSwap8()

void ngcbSwap8 ( void * buffer,
size_t length )

Change the byte order of the 64-bit numbers in buffer from 1,2,3,4,5,6,7,8 to 8,7,6,5,4,3,2,1. length is the number of 64-bit items (64-bit integer, double precision float) in the buffer.

◆ ngcbUInt2Bin()

void ngcbUInt2Bin ( char * str,
unsigned int in )

Convert an unsigned integer value to binary format string.