.. _nvjpeg2kdecode-label: nvjpeg2kDecode() ***************** Decodes a single image, and writes it to the output device buffers. The function is synchronous with respect to the host. All GPU tasks will be submitted to the provided :code:`stream`. Prior to calling this function user must parse the bitstream using :ref:`nvjpeg2kstreamparse-label` such that the bitstream information is stored in :code:`jpeg2k_stream`. **Signature:** .. code-block:: cpp nvjpeg2kStatus_t nvjpeg2kDecode(nvjpeg2kHandle_t handle, nvjpeg2kDecodeState_t decode_state, nvjpeg2kStream_t jpeg2k_stream, nvjpeg2kImage_t* decode_output, cudaStream_t stream); **Parameters:** .. list-table:: :header-rows: 1 :widths: 15 10 10 20 * - Parameter - Input/Output - Memory - Description * - nvjpeg2kHandle_t handle - Input - Host - library handle * - nvjpeg2kDecodeState_t decode_state - Input - Host - decode state handle * - nvjpeg2kStream_t jpeg2k_stream - Input - Host - nvjpeg2k bitstream handle * - nvjpeg2kImage_t* decode_output - Input/Output - Host - pointer to an instance of component_info * - cudaStream_t stream - Input - Host - Decode output struct. The struct should be on host memory. The image component pointers should point to device memory. See :ref:`nvjpeg2kimagedata-label` **Returns:** :code:`nvjpeg2kStatus_t` - An error code as specified in :ref:`nvjpeg2kapireturncodes-label`