|
|
| Line 46: |
Line 46: |
| ===Example=== | | ===Example=== |
| {| | | {| |
| |style="font-size:150%;"| | | |style="font-size:100%;"| |
| <syntaxhighlight lang="cpp"> | | <syntaxhighlight lang="cpp"> |
|
| |
|
Latest revision as of 10: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;
|