Threshold

Compare to a threshold value, replace with threshold value (General)

Supported Technologies

MT, SSE2, Family10h

Synopsis

FwStatus   fwsThreshold_16s ( const Fw16s * pSrc, Fw16s * pDst, int len, Fw16s level, FwCmpOp relOp );
FwStatus   fwsThreshold_32f ( const Fw32f * pSrc, Fw32f * pDst, int len, Fw32f level, FwCmpOp relOp );
FwStatus   fwsThreshold_64f ( const Fw64f * pSrc, Fw64f * pDst, int len, Fw64f level, FwCmpOp relOp );
FwStatus   fwsThreshold_32fc ( const Fw32fc * pSrc, Fw32fc * pDst, int len, Fw32f level, FwCmpOp relOp );
FwStatus   fwsThreshold_64fc ( const Fw64fc * pSrc, Fw64fc * pDst, int len, Fw64f level, FwCmpOp relOp );
FwStatus   fwsThreshold_16sc ( const Fw16sc * pSrc, Fw16sc * pDst, int len, Fw16s level, FwCmpOp relOp );
FwStatus   fwsThreshold_16s_I ( Fw16s * pSrcDst, int len, Fw16s level, FwCmpOp relOp );
FwStatus   fwsThreshold_32f_I ( Fw32f * pSrcDst, int len, Fw32f level, FwCmpOp relOp );
FwStatus   fwsThreshold_64f_I ( Fw64f * pSrcDst, int len, Fw64f level, FwCmpOp relOp );
FwStatus   fwsThreshold_32fc_I ( Fw32fc * pSrcDst, int len, Fw32f level, FwCmpOp relOp );
FwStatus   fwsThreshold_64fc_I ( Fw64fc * pSrcDst, int len, Fw64f level, FwCmpOp relOp );
FwStatus   fwsThreshold_16sc_I ( Fw16sc * pSrcDst, int len, Fw16s level, FwCmpOp relOp );

Parameters

len   Specifies the number of elements in a buffer.
level   Specifies a threshold level.
pDst   Pointer to a destination buffer.
pSrc   Pointer to a source buffer.
pSrcDst   Pointer to a buffer that is both the source and destination.
relOp   Constant that indicates which relational operation to perform.

Description

These functions step through vector elements in a source buffer and compare the source data to a specified threshold value using a specified compare operation.

The compare operation can be "less than", "less than or equal", "equal", "greater than or equal" or "greater than".

When the comparison evaluates as true, the function writes the threshold value.

When the comparison evaluates as false, the function writes the value of the source data.

Output data can be written to a destination buffer or back to the source buffer for in-place operation.

The following evaluation formulas are used.

      |level, pSrc[n] < level   |
For fwCmpLess:  pDst[n] = |pSrc[n], pSrc[n] >= level|
      |        |


    |(pSrc[n] * level)/ abs(pSrc[n], abs(pSrc[n]) < level|
For complex variant:  pDst[n] = |pSrc[n], pSrc[n] >= level        |
    |           |


    |level,  pSrc[n] > level  |
For fwCmpGreater:  pDst[n] = |pSrc[n], pSrc[n] <= level|
    |     |


    |(pSrc[n] * level)/ abs(pSrc[n], abs(pSrc[n]) > level|
For complex variant:  pDst[n] = |pSrc[n], pSrc[n] <= level        |
    |           |