.. _nvjpeg2kdecode-label: nvjpeg2kDecode() ***************** Decodes a single image, and writes it to the output device buffers. The function is asynchronous 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 - Decode output struct. The struct should be on host memory. The image component pointers should point to device memory. See :ref:`nvjpeg2kimagedata-label` * - cudaStream_t stream - Input - Host - Instance of cudaStream_t. Can be set to 0. **Returns:** :code:`nvjpeg2kStatus_t` - An error code as specified in :ref:`nvjpeg2kapireturncodes-label` .. _nvjpeg2kdecodetile-label: nvjpeg2kDecodeTile() ********************* Decodes a tile within an image and writes it to the output device buffers. The function is asynchronous 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 nvjpeg2kDecodeTile(nvjpeg2kHandle_t handle, nvjpeg2kDecodeState_t decode_state, nvjpeg2kStream_t jpeg2k_stream, nvjpeg2kDecodeParams_t decode_params, uint32_t tile_id, uint32_t num_res_levels, 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 * - nvjpeg2kDecodeParams_t decode_params - Input - Host - Used to control the decoded output (like specifying an area of interest) Can be set to NULL. * - uint32_t tile_id - Input - Host - Raster scan based tile index * - uint32_t num_res_levels - Input - Host - Number of Resolutions to be decoded within a tile, When set 0, image is decoded at full resolution Maximum allowed resolutions in a tile can be determined using :ref:`nvjpeg2kstreamgetresolutionsintile-label` * - nvjpeg2kImage_t* decode_output - Input/Output - Host - Decode output struct. The struct should be on host memory. The image component pointers should point to device memory. See :ref:`nvjpeg2kimagedata-label` * - cudaStream_t stream - Input - Host - Instance of cudaStream_t. Can be set to 0. **Returns:** :code:`nvjpeg2kStatus_t` - An error code as specified in :ref:`nvjpeg2kapireturncodes-label`