Difference between revisions of "Function:SHL"

From CUVI Wiki
(Created page with "__NOTOC__ Left shift pixel values of the input image by specified constant value. ===Function=== {| |style="font-size:150%;"| <syntaxhighlight lang="cpp"> CuviStatus SHL(const...")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
Left shift pixel values of the input image by specified constant value.
Left shift pixel values of the input image by specified constant value.
===Function===
====Function====
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
CuviStatus SHL(const CuviImage& src,
CuviStatus SHL(const CuviImage& src,
Line 11: Line 11:
</syntaxhighlight>
</syntaxhighlight>
|}
|}
===Parameters===


====Parameters====
{|
|style="font-size:75%;"|
{|class="wikitable"
{|class="wikitable"
|-
|-
Line 34: Line 36:
| const CuviStream&
| const CuviStream&
| GPU stream ID for execution
| GPU stream ID for execution
 
|}
|}
|}


===Image Type Support===
====Image Type Support====
 
{|
|style="font-size:75%;"|
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 55: Line 58:
| 16uC3
| 16uC3
| 16uC3
| 16uC3
|}
|}
|}


===Sample===
====Code Example====
 
 
 
===Example===
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">



Latest revision as of 20:26, 18 October 2022

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;