- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to invert value of every pixel in my image in-place. Image is allocated with ippiMalloc_32f_C1.
I mean if it was 2, it must become 0.5. So f(x) -> 1/x.
I would like to use only O(1) additional memory.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ihor,
just call the next function for each image row:
/* ////////////////////////////////////////////////////////////////////////////
// Name: ippsDivCRev
// Purpose: Divides a constant value by each element of a vector
// Arguments:
// val Constant value used as a dividend in the operation
// pSrc Pointer to the source vector whose elements are used as divisors
// pDst Pointer to the destination vector
// pSrcDst Pointer to the source and destination vector for in-place operation
// len Number of elements in the vector
// scaleFactor Scale factor
// Return:
// ippStsNullPtrErr At least one of the pointers is NULL
// ippStsSizeErr Vector length is less than 1
// ippStsDivByZero Warning status if any element of vector is zero. IF the dividend is zero
// than result is NaN, if the dividend is not zero than result is Infinity
// with correspondent sign. Execution is not aborted.
// For the integer operation zero instead of NaN and the corresponding
// bound values instead of Infinity
// ippStsNoErr No error
// Note:
// DivCRev(v,X,Y) : Y
// DivCRev(v,X) : X
*/
IPPAPI(IppStatus, ippsDivCRev_16u_I, ( Ipp16u val, Ipp16u* pSrcDst, int len))
IPPAPI(IppStatus, ippsDivCRev_16u, (const Ipp16u* pSrc, Ipp16u val, Ipp16u* pDst, int len))
IPPAPI(IppStatus, ippsDivCRev_32f_I, ( Ipp32f val, Ipp32f* pSrcDst, int len))
IPPAPI(IppStatus, ippsDivCRev_32f, (const Ipp32f* pSrc, Ipp32f val, Ipp32f* pDst, int len))
regards, Igor
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ihor,
just call the next function for each image row:
/* ////////////////////////////////////////////////////////////////////////////
// Name: ippsDivCRev
// Purpose: Divides a constant value by each element of a vector
// Arguments:
// val Constant value used as a dividend in the operation
// pSrc Pointer to the source vector whose elements are used as divisors
// pDst Pointer to the destination vector
// pSrcDst Pointer to the source and destination vector for in-place operation
// len Number of elements in the vector
// scaleFactor Scale factor
// Return:
// ippStsNullPtrErr At least one of the pointers is NULL
// ippStsSizeErr Vector length is less than 1
// ippStsDivByZero Warning status if any element of vector is zero. IF the dividend is zero
// than result is NaN, if the dividend is not zero than result is Infinity
// with correspondent sign. Execution is not aborted.
// For the integer operation zero instead of NaN and the corresponding
// bound values instead of Infinity
// ippStsNoErr No error
// Note:
// DivCRev(v,X,Y) : Y
// DivCRev(v,X) : X
*/
IPPAPI(IppStatus, ippsDivCRev_16u_I, ( Ipp16u val, Ipp16u* pSrcDst, int len))
IPPAPI(IppStatus, ippsDivCRev_16u, (const Ipp16u* pSrc, Ipp16u val, Ipp16u* pDst, int len))
IPPAPI(IppStatus, ippsDivCRev_32f_I, ( Ipp32f val, Ipp32f* pSrcDst, int len))
IPPAPI(IppStatus, ippsDivCRev_32f, (const Ipp32f* pSrc, Ipp32f val, Ipp32f* pDst, int len))
regards, Igor
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page