.. _nvjpeg2kstreamparse-label: nvjpeg2kStreamParse() ********************* This function is the first step in the decoding of a JPEG2000 bitstream. It accepts the bitstream buffer on host memory as input and parses the JPEG2000 header information. The parsed information is stored in the :code:`nvjpeg2kStream_t` handle and can be retrieved by the APIs documented in this section. **Signature**: .. code-block:: cpp nvjpeg2kStatus_t nvjpeg2kStreamParse(nvjpeg2kHandle_t handle, const unsigned char *data, size_t length, int save_metadata, int save_stream, nvjpeg2kStream_t *stream_handle); **Parameters:** .. list-table:: :header-rows: 1 :widths: 15 10 10 20 * - Parameter - Input/Output - Memory - Description * - nvjpeg2kHandle_t handle - Input - Host - library handle * - const unsigned char *data - Input - Host - bitstream buffer * - size_t length - Input - Host - bitstream size in bytes * - int save_metadata - Input - Host - Set to 0. Added for future use * - int save_stream - Input - Host - Set to 0. Added for future use * - nvjpeg2kStream_t *stream_handle - Input - Host - bitstream handle **Returns:** :code:`nvjpeg2kStatus_t` - An error code as specified in :ref:`nvjpeg2kapireturncodes-label` nvjpeg2kStreamGetImageInfo() **************************** Retrieves the image information defined in :ref:`nvjpeg2kImageInfo_t`. This information is useful in allocating output buffers on device memory. **Signature**: .. code-block:: cpp nvjpeg2kStatus_t nvjpeg2kStreamGetImageInfo(nvjpeg2kStream_t stream_handle, nvjpeg2kImageInfo_t* image_info); **Parameters:** .. list-table:: :header-rows: 1 :widths: 15 10 10 20 * - Parameter - Input/Output - Memory - Description * - nvjpeg2kStream_t *stream_handle - Input - Host - bitstream handle * - nvjpeg2kImageInfo_t* image_info - Input/Output - Host - Pointer to nvjpeg2kImageInfo_t **Returns:** :code:`nvjpeg2kStatus_t` - An error code as specified in :ref:`nvjpeg2kapireturncodes-label` nvjpeg2kStreamGetImageComponentInfo() ************************************** Retrieves the component level information defined in :ref:`nvjpeg2kImageComponentInfo_t` This information can be used in allocating output buffers on device memory. Component level information is useful when the dimensions vary across components. **Signature:** .. code-block:: cpp nvjpeg2kStatus_t nvjpeg2kStreamGetImageComponentInfo(nvjpeg2kStream_t stream_handle, nvjpeg2kImageComponentInfo_t* component_info, uint32_t component_id); **Parameters:** .. list-table:: :header-rows: 1 :widths: 15 10 10 20 * - Parameter - Input/Output - Memory - Description * - nvjpeg2kStream_t stream_handle - Input - Host - bitstream handle * - nvjpeg2kImageComponentInfo_t* component_info - Input/Output - Host - Pointer to nvjpeg2kImageInfo_t * - uint32_t component_id - Input - Host - Component index **Returns:** :code:`nvjpeg2kStatus_t` - An error code as specified in :ref:`nvjpeg2kapireturncodes-label`