All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Scale To Lower Bit Depth
Scale Bit Depth

Functions for scaling images to lower bit depth. More...

## Functions

NppStatus | nppiScale_16u8u_C1R_Ctx (const Npp16u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint, NppStreamContext nppStreamCtx)
| Single channel 16-bit unsigned to 8-bit unsigned conversion. More...
NppStatus | nppiScale_16u8u_C1R (const Npp16u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint)
NppStatus | nppiScale_16u8u_C3R_Ctx (const Npp16u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint, NppStreamContext nppStreamCtx)
| Three channel 16-bit unsigned to 8-bit unsigned conversion. More...
NppStatus | nppiScale_16u8u_C3R (const Npp16u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint)
NppStatus | nppiScale_16u8u_C4R_Ctx (const Npp16u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint, NppStreamContext nppStreamCtx)
| Four channel 16-bit unsigned to 8-bit unsigned conversion. More...
NppStatus | nppiScale_16u8u_C4R (const Npp16u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint)
NppStatus | nppiScale_16u8u_AC4R_Ctx (const Npp16u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint, NppStreamContext nppStreamCtx)
| Four channel 16-bit unsigned to 8-bit unsigned conversion, not affecting Alpha. More...
NppStatus | nppiScale_16u8u_AC4R (const Npp16u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint)
NppStatus | nppiScale_16s8u_C1R_Ctx (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint, NppStreamContext nppStreamCtx)
| Single channel 16-bit signed to 8-bit unsigned conversion. More...
NppStatus | nppiScale_16s8u_C1R (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint)
NppStatus | nppiScale_16s8u_C3R_Ctx (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint, NppStreamContext nppStreamCtx)
| Three channel 16-bit signed to 8-bit unsigned conversion. More...
NppStatus | nppiScale_16s8u_C3R (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint)
NppStatus | nppiScale_16s8u_C4R_Ctx (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint, NppStreamContext nppStreamCtx)
| Four channel 16-bit signed to 8-bit unsigned conversion. More...
NppStatus | nppiScale_16s8u_C4R (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint)
NppStatus | nppiScale_16s8u_AC4R_Ctx (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint, NppStreamContext nppStreamCtx)
| Four channel 16-bit signed to 8-bit unsigned conversion, not affecting Alpha. More...
NppStatus | nppiScale_16s8u_AC4R (const Npp16s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint)
NppStatus | nppiScale_32s8u_C1R_Ctx (const Npp32s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint, NppStreamContext nppStreamCtx)
| Single channel 32-bit signed to 8-bit unsigned conversion. More...
NppStatus | nppiScale_32s8u_C1R (const Npp32s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint)
NppStatus | nppiScale_32s8u_C3R_Ctx (const Npp32s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint, NppStreamContext nppStreamCtx)
| Three channel 32-bit signed to 8-bit unsigned conversion. More...
NppStatus | nppiScale_32s8u_C3R (const Npp32s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint)
NppStatus | nppiScale_32s8u_C4R_Ctx (const Npp32s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint, NppStreamContext nppStreamCtx)
| Four channel 32-bit signed to 8-bit unsigned conversion. More...
NppStatus | nppiScale_32s8u_C4R (const Npp32s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint)
NppStatus | nppiScale_32s8u_AC4R_Ctx (const Npp32s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint, NppStreamContext nppStreamCtx)
| Four channel 32-bit signed to 8-bit unsigned conversion, not affecting Alpha. More...
NppStatus | nppiScale_32s8u_AC4R (const Npp32s *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppHintAlgorithm hint)
NppStatus | nppiScale_32f8u_C1R_Ctx (const Npp32f *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, Npp32f nMin, Npp32f nMax, NppStreamContext nppStreamCtx)
| Single channel 32-bit floating point to 8-bit unsigned conversion. More...
NppStatus | nppiScale_32f8u_C1R (const Npp32f *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, Npp32f nMin, Npp32f nMax)
NppStatus | nppiScale_32f8u_C3R_Ctx (const Npp32f *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, Npp32f nMin, Npp32f nMax, NppStreamContext nppStreamCtx)
| Three channel 32-bit floating point to 8-bit unsigned conversion. More...
NppStatus | nppiScale_32f8u_C3R (const Npp32f *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, Npp32f nMin, Npp32f nMax)
NppStatus | nppiScale_32f8u_C4R_Ctx (const Npp32f *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, Npp32f nMin, Npp32f nMax, NppStreamContext nppStreamCtx)
| Four channel 32-bit floating point to 8-bit unsigned conversion. More...
NppStatus | nppiScale_32f8u_C4R (const Npp32f *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, Npp32f nMin, Npp32f nMax)
NppStatus | nppiScale_32f8u_AC4R_Ctx (const Npp32f *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, Npp32f nMin, Npp32f nMax, NppStreamContext nppStreamCtx)
| Four channel 32-bit floating point to 8-bit unsigned conversion, not affecting Alpha. More...
NppStatus | nppiScale_32f8u_AC4R (const Npp32f *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, Npp32f nMin, Npp32f nMax)

## Detailed Description

Functions for scaling images to lower bit depth.

To map source pixel srcPixelValue to destination pixel dstPixelValue the following equation is used:

     dstPixelValue = dstMinRangeValue + scaleFactor * (srcPixelValue - srcMinRangeValue)

where scaleFactor = (dstMaxRangeValue - dstMinRangeValue) / (srcMaxRangeValue - srcMinRangeValue).

For conversions between integer data types, the entire integer numeric range of the input data type is mapped onto the entire integer numeric range of the output data type.

For conversions to floating point data types the floating point data range is defined by the user supplied floating point values of nMax and nMin which are used as the dstMaxRangeValue and dstMinRangeValue respectively in the scaleFactor and dstPixelValue calculations and also as the saturation values to which output data is clamped.

When converting from floating-point values to integer values, nMax and nMin are used as the srcMaxRangeValue and srcMinRangeValue respectively in the scaleFactor and dstPixelValue calculations. Output values are saturated and clamped to the full output integer pixel value range.

### Common parameters for nppiScale to lower bit depth functions include:

Parameters

  pSrc | Source-Image Pointer.
  nSrcStep | Source-Image Line Step.
  pDst | Destination-Image Pointer.
  nDstStep | Destination-Image Line Step.
  oSizeROI | Region-of-Interest (ROI).
  hint | algorithm performance or accuracy selector, currently ignored
  nMin | specifies the minimum saturation value to which every output value will be clamped.
  nMax | specifies the maximum saturation value to which every output value will be clamped.
  nppStreamCtx | Application Managed Stream Context.

Returns
  Image Data Related Error Codes, ROI Related Error Codes, NPP_SCALE_RANGE_ERROR indicates an error condition if nMax <= nMin.

## Function Documentation

NppStatus nppiScale_16s8u_AC4R | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint
| ) |  |

NppStatus nppiScale_16s8u_AC4R_Ctx | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Four channel 16-bit signed to 8-bit unsigned conversion, not affecting Alpha.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

NppStatus nppiScale_16s8u_C1R | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint
| ) |  |

NppStatus nppiScale_16s8u_C1R_Ctx | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Single channel 16-bit signed to 8-bit unsigned conversion.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

NppStatus nppiScale_16s8u_C3R | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint
| ) |  |

NppStatus nppiScale_16s8u_C3R_Ctx | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Three channel 16-bit signed to 8-bit unsigned conversion.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

NppStatus nppiScale_16s8u_C4R | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint
| ) |  |

NppStatus nppiScale_16s8u_C4R_Ctx | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Four channel 16-bit signed to 8-bit unsigned conversion.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

NppStatus nppiScale_16u8u_AC4R | ( | const Npp16u * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint
| ) |  |

NppStatus nppiScale_16u8u_AC4R_Ctx | ( | const Npp16u * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Four channel 16-bit unsigned to 8-bit unsigned conversion, not affecting Alpha.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

NppStatus nppiScale_16u8u_C1R | ( | const Npp16u * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint
| ) |  |

NppStatus nppiScale_16u8u_C1R_Ctx | ( | const Npp16u * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Single channel 16-bit unsigned to 8-bit unsigned conversion.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

NppStatus nppiScale_16u8u_C3R | ( | const Npp16u * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint
| ) |  |

NppStatus nppiScale_16u8u_C3R_Ctx | ( | const Npp16u * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Three channel 16-bit unsigned to 8-bit unsigned conversion.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

NppStatus nppiScale_16u8u_C4R | ( | const Npp16u * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint
| ) |  |

NppStatus nppiScale_16u8u_C4R_Ctx | ( | const Npp16u * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Four channel 16-bit unsigned to 8-bit unsigned conversion.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

NppStatus nppiScale_32f8u_AC4R | ( | const Npp32f * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | Npp32f | nMin,
|  | Npp32f | nMax
| ) |  |

NppStatus nppiScale_32f8u_AC4R_Ctx | ( | const Npp32f * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | Npp32f | nMin,
|  | Npp32f | nMax,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Four channel 32-bit floating point to 8-bit unsigned conversion, not affecting Alpha.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

NppStatus nppiScale_32f8u_C1R | ( | const Npp32f * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | Npp32f | nMin,
|  | Npp32f | nMax
| ) |  |

NppStatus nppiScale_32f8u_C1R_Ctx | ( | const Npp32f * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | Npp32f | nMin,
|  | Npp32f | nMax,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Single channel 32-bit floating point to 8-bit unsigned conversion.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

NppStatus nppiScale_32f8u_C3R | ( | const Npp32f * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | Npp32f | nMin,
|  | Npp32f | nMax
| ) |  |

NppStatus nppiScale_32f8u_C3R_Ctx | ( | const Npp32f * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | Npp32f | nMin,
|  | Npp32f | nMax,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Three channel 32-bit floating point to 8-bit unsigned conversion.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

NppStatus nppiScale_32f8u_C4R | ( | const Npp32f * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | Npp32f | nMin,
|  | Npp32f | nMax
| ) |  |

NppStatus nppiScale_32f8u_C4R_Ctx | ( | const Npp32f * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | Npp32f | nMin,
|  | Npp32f | nMax,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Four channel 32-bit floating point to 8-bit unsigned conversion.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

NppStatus nppiScale_32s8u_AC4R | ( | const Npp32s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint
| ) |  |

NppStatus nppiScale_32s8u_AC4R_Ctx | ( | const Npp32s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Four channel 32-bit signed to 8-bit unsigned conversion, not affecting Alpha.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

NppStatus nppiScale_32s8u_C1R | ( | const Npp32s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint
| ) |  |

NppStatus nppiScale_32s8u_C1R_Ctx | ( | const Npp32s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Single channel 32-bit signed to 8-bit unsigned conversion.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

NppStatus nppiScale_32s8u_C3R | ( | const Npp32s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint
| ) |  |

NppStatus nppiScale_32s8u_C3R_Ctx | ( | const Npp32s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Three channel 32-bit signed to 8-bit unsigned conversion.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

NppStatus nppiScale_32s8u_C4R | ( | const Npp32s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint
| ) |  |

NppStatus nppiScale_32s8u_C4R_Ctx | ( | const Npp32s * | pSrc,
|  | int | nSrcStep,
|  | Npp8u * | pDst,
|  | int | nDstStep,
|  | NppiSize | oSizeROI,
|  | NppHintAlgorithm | hint,
|  | NppStreamContext | nppStreamCtx
| ) |  |

Four channel 32-bit signed to 8-bit unsigned conversion.

For common parameter descriptions, see Common parameters for nppiScale to lower bit depth functions.

Copyright © 2009-2019 NVIDIA Corporation