Function:SHL

From CUVI Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

Function

CuviStatus SHL(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

Code Example

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

CuviImage output;

//Left shift 2 bits
cuvi::arithmeticLogical::SHL(input, 2, output);

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