Function:SHR

From CUVI Wiki
Revision as of 16:04, 13 June 2014 by Ghazanfar (talk | contribs) (Created page with "__NOTOC__ Right shift pixel values of the input image by specified constant value. ===Function=== {| |style="font-size:150%;"| <syntaxhighlight lang="cpp"> CuviStatus SHR(cons...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Right shift pixel values of the input image by specified constant value.

Function

CuviStatus SHR(const CuviImage& src,
               const Cuvi32s value,
               CuviImage& dst,
               const CuviStream& stream = CuviStream());

Parameters

Name Type Description
src const CuviImage& Input Image
value const CuviImage& Shift value
dst CuviImage& Resultant Image
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC1 8uC1
8uC3 8uC3
16uC1 16uC1
16uC3 16uC3

Sample

Example

CuviImage input = cuvi::io::loadImage(path);

CuviImage output;

//Right shift 2 bits
cuvi::arithmeticLogical::SHR(input, 2, output);

//The above can also be achieved by using shift operator
output = input>>2;