Sum
Statistical Operations

Primitives for computing the sum of all the pixel values in an image. More...

## Sum

Given an image with width and height , the sum will be computed as

All the results are stored in a 64-bit double precision format, except for two primitives nppiSum_8u64s_C1R and nppiSum_8u64s_C4R.

The sum functions require additional scratch buffer for computations.

### Common parameters for nppiSum functions include:

Parameters

  pSrc | Source-Image Pointer.
  nSrcStep | Source-Image Line Step.
  oSizeROI | Region-of-Interest (ROI).
  pDeviceBuffer | Pointer to the required device memory allocation, Scratch Buffer and Host Pointer. Use nppiSumGetBufferHostSize_XX_XXX to determine the minium number of bytes required.
  pSum | Pointer to the computed sum.

Returns
  Image Data Related Error Codes, ROI Related Error Codes

NppStatus | nppiSum_8u_C1R (const Npp8u *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f *pSum)
| One-channel 8-bit unsigned image sum. More...
NppStatus | nppiSum_8u64s_C1R (const Npp8u *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64s *pSum)
| One-channel 8-bit unsigned image sum. More...
NppStatus | nppiSum_16u_C1R (const Npp16u *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f *pSum)
| One-channel 16-bit unsigned image sum. More...
NppStatus | nppiSum_16s_C1R (const Npp16s *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f *pSum)
| One-channel 16-bit signed image sum. More...
NppStatus | nppiSum_32f_C1R (const Npp32f *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f *pSum)
| One-channel 32-bit floating point image sum. More...
NppStatus | nppiSum_8u_C3R (const Npp8u *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f aSum[3])
| Three-channel 8-bit unsigned image sum. More...
NppStatus | nppiSum_16u_C3R (const Npp16u *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f aSum[3])
| Three-channel 16-bit unsigned image sum. More...
NppStatus | nppiSum_16s_C3R (const Npp16s *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f aSum[3])
| Three-channel 16-bit signed image sum. More...
NppStatus | nppiSum_32f_C3R (const Npp32f *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f aSum[3])
| Three-channel 32-bit floating point image sum. More...
NppStatus | nppiSum_8u_AC4R (const Npp8u *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f aSum[3])
| Four-channel 8-bit unsigned image sum ignoring alpha channel. More...
NppStatus | nppiSum_16u_AC4R (const Npp16u *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f aSum[3])
| Four-channel 16-bit unsigned image sum ignoring alpha channel. More...
NppStatus | nppiSum_16s_AC4R (const Npp16s *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f aSum[3])
| Four-channel 16-bit signed image sum ignoring alpha channel. More...
NppStatus | nppiSum_32f_AC4R (const Npp32f *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f aSum[3])
| Four-channel 32-bit floating point image sum ignoring alpha channel. More...
NppStatus | nppiSum_8u_C4R (const Npp8u *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f aSum[4])
| Four-channel 8-bit unsigned image sum. More...
NppStatus | nppiSum_8u64s_C4R (const Npp8u *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64s aSum[4])
| Four-channel 8-bit unsigned image sum. More...
NppStatus | nppiSum_16u_C4R (const Npp16u *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f aSum[4])
| Four-channel 16-bit unsigned image sum. More...
NppStatus | nppiSum_16s_C4R (const Npp16s *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f aSum[4])
| Four-channel 16-bit signed image sum. More...
NppStatus | nppiSum_32f_C4R (const Npp32f *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f aSum[4])
| Four-channel 32-bit floating point image sum. More...

## SumGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the sum primitives.
NppStatus | nppiSumGetBufferHostSize_8u_C1R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_8u_C1R. More...
NppStatus | nppiSumGetBufferHostSize_8u64s_C1R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_8u64s_C1R. More...
NppStatus | nppiSumGetBufferHostSize_16u_C1R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_16u_C1R. More...
NppStatus | nppiSumGetBufferHostSize_16s_C1R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_16s_C1R. More...
NppStatus | nppiSumGetBufferHostSize_32f_C1R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_32f_C1R. More...
NppStatus | nppiSumGetBufferHostSize_8u_C3R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_8u_C3R. More...
NppStatus | nppiSumGetBufferHostSize_16u_C3R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_16u_C3R. More...
NppStatus | nppiSumGetBufferHostSize_16s_C3R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_16s_C3R. More...
NppStatus | nppiSumGetBufferHostSize_32f_C3R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_32f_C3R. More...
NppStatus | nppiSumGetBufferHostSize_8u_AC4R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_8u_AC4R. More...
NppStatus | nppiSumGetBufferHostSize_16u_AC4R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_16u_AC4R. More...
NppStatus | nppiSumGetBufferHostSize_16s_AC4R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_16s_AC4R. More...
NppStatus | nppiSumGetBufferHostSize_32f_AC4R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_32f_AC4R. More...
NppStatus | nppiSumGetBufferHostSize_8u64s_C4R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_8u64s_C4R. More...
NppStatus | nppiSumGetBufferHostSize_8u_C4R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_8u_C4R. More...
NppStatus | nppiSumGetBufferHostSize_16u_C4R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_16u_C4R. More...
NppStatus | nppiSumGetBufferHostSize_16s_C4R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_16s_C4R. More...
NppStatus | nppiSumGetBufferHostSize_32f_C4R (NppiSize oSizeROI, int *hpBufferSize)
| Buffer size for nppiSum_32f_C4R. More...

## Detailed Description

Primitives for computing the sum of all the pixel values in an image.

## Function Documentation

NppStatus nppiSum_16s_AC4R | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f | aSum[3]
| ) |  |

Four-channel 16-bit signed image sum ignoring alpha channel.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_16s_C1R | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f * | pSum
| ) |  |

One-channel 16-bit signed image sum.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_16s_C3R | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f | aSum[3]
| ) |  |

Three-channel 16-bit signed image sum.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_16s_C4R | ( | const Npp16s * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f | aSum[4]
| ) |  |

Four-channel 16-bit signed image sum.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_16u_AC4R | ( | const Npp16u * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f | aSum[3]
| ) |  |

Four-channel 16-bit unsigned image sum ignoring alpha channel.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_16u_C1R | ( | const Npp16u * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f * | pSum
| ) |  |

One-channel 16-bit unsigned image sum.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_16u_C3R | ( | const Npp16u * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f | aSum[3]
| ) |  |

Three-channel 16-bit unsigned image sum.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_16u_C4R | ( | const Npp16u * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f | aSum[4]
| ) |  |

Four-channel 16-bit unsigned image sum.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_32f_AC4R | ( | const Npp32f * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f | aSum[3]
| ) |  |

Four-channel 32-bit floating point image sum ignoring alpha channel.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_32f_C1R | ( | const Npp32f * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f * | pSum
| ) |  |

One-channel 32-bit floating point image sum.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_32f_C3R | ( | const Npp32f * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f | aSum[3]
| ) |  |

Three-channel 32-bit floating point image sum.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_32f_C4R | ( | const Npp32f * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f | aSum[4]
| ) |  |

Four-channel 32-bit floating point image sum.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_8u64s_C1R | ( | const Npp8u * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64s * | pSum
| ) |  |

One-channel 8-bit unsigned image sum.

The result is 64-bit long long integer.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_8u64s_C4R | ( | const Npp8u * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64s | aSum[4]
| ) |  |

Four-channel 8-bit unsigned image sum.

The result is 64-bit long long integer.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_8u_AC4R | ( | const Npp8u * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f | aSum[3]
| ) |  |

Four-channel 8-bit unsigned image sum ignoring alpha channel.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_8u_C1R | ( | const Npp8u * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f * | pSum
| ) |  |

One-channel 8-bit unsigned image sum.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_8u_C3R | ( | const Npp8u * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f | aSum[3]
| ) |  |

Three-channel 8-bit unsigned image sum.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSum_8u_C4R | ( | const Npp8u * | pSrc,
|  | int | nSrcStep,
|  | NppiSize | oSizeROI,
|  | Npp8u * | pDeviceBuffer,
|  | Npp64f | aSum[4]
| ) |  |

Four-channel 8-bit unsigned image sum.

For common parameter descriptions, see Common parameters for nppiSum functions.

NppStatus nppiSumGetBufferHostSize_16s_AC4R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_16s_AC4R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_16s_C1R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_16s_C1R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_16s_C3R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_16s_C3R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_16s_C4R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_16s_C4R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_16u_AC4R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_16u_AC4R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_16u_C1R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_16u_C1R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_16u_C3R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_16u_C3R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_16u_C4R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_16u_C4R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_32f_AC4R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_32f_AC4R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_32f_C1R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_32f_C1R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_32f_C3R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_32f_C3R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_32f_C4R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_32f_C4R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_8u64s_C1R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_8u64s_C1R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_8u64s_C4R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_8u64s_C4R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_8u_AC4R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_8u_AC4R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_8u_C1R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_8u_C1R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_8u_C3R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_8u_C3R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSumGetBufferHostSize_8u_C4R | ( | NppiSize | oSizeROI,
|  | int * | hpBufferSize
| ) |  |

Buffer size for nppiSum_8u_C4R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Copyright © 2009-2017 NVIDIA Corporation