|
|
Line 14: |
Line 14: |
|
| |
|
| ===Parameters=== | | ===Parameters=== |
| | | {| |
| | |style="font-size:75%;"| |
| {|class="wikitable" | | {|class="wikitable" |
| |- | | |- |
Line 40: |
Line 41: |
| | const CuviStream& | | | const CuviStream& |
| | GPU stream ID for execution | | | GPU stream ID for execution |
|
| |
| |} | | |} |
| | | |} |
| | |
|
| |
|
| ===Example=== | | ===Example=== |
Revision as of 18:23, 19 October 2022
JPEG Decoding: Decodes a JPEG file into an image pixel array.
Function
CuviStatus decode(const Cuvi8u* src,
const size_t srcBytes,
CuviImage& dst,
const bool srcOnGPU,
const CuviStream& stream = CuviStream());
|
Parameters
Name
|
Type
|
Description
|
src
|
Cuvi8u*
|
Pointer to encoded data
|
srcBytes
|
const size_t
|
Size of encoded data
|
dst
|
CuviImage& dst
|
Decoded image in CuviImage
|
srcOnGPU
|
const bool
|
Whether the encoded data is CPU pointer or GPU
|
stream
|
const CuviStream&
|
GPU stream ID for execution
|
|
Example
CuviImage img;
CuviStatus err = cuvi::codecs::decode(inputPath, img);
if(err!= CUVI_SUCCESS)
{
cout <<"Failed to decode image, error: "<<err<<endl;
return;
}
cout<<"Decoded image dimensions: "<<img.width()<<"x"<<img.height()<<endl;
cout<<"Encoding image and writing to "<<outputPath<<endl;
|