Difference between revisions of "Function:Pow"

From CUVI Wiki
 
(4 intermediate revisions by 2 users not shown)
Line 3: Line 3:
Raises each pixel of the image to the specified power.
Raises each pixel of the image to the specified power.


===Function===
====Function====
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
CuviStatus pow(const CuviImage& src,
CuviStatus pow(const CuviImage& src,
Line 14: Line 14:
|}
|}


===Parameters===
====Parameters====
 
{|
|style="font-size:75%;"|
{|class="wikitable"
{|class="wikitable"
|-
|-
Line 37: Line 38:
| 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 48: Line 50:
|-
|-
| 8uC1
| 8uC1
| 8uC1
| 32fC1
|-
|-
| 8uC3
| 8uC3
| 8uC3
| 32fC3
|-
|-
| 16uC1
| 16uC1
| 16uC1
| 32fC1
|-
|-
| 16uC3
| 16uC3
| 16uC3
| 32fC3
|-
|-
| 32fC1
| 32fC1
Line 64: Line 66:
| 32fC3
| 32fC3
| 32fC3
| 32fC3
|}
|}
|}


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



Latest revision as of 20:24, 18 October 2022


Raises each pixel of the image to the specified power.

Function

CuviStatus pow(const CuviImage& src,
	       const Cuvi32f power,
               CuviImage& dst,
               const CuviStream& stream = CuviStream());

Parameters

Name Type Description
src const CuviImage& Input Image
power const Cuvi32f Power by which each pixel would be raised.
dst CuviImage& Output Image
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC1 32fC1
8uC3 32fC3
16uC1 32fC1
16uC3 32fC3
32fC1 32fC1
32fC3 32fC3

Code Example

//Read an image from the disk
CuviImage input = cuvi::io::loadImage(path);
CuviImage output;

const Cuvi32f power = 2.0f;

//Raise the image to the specified power.
cuvi::arithmeticLogical::pow(input,power,output);