Input Function

User defined input function to read data from input stream.

size_t in_func (
  JDEC* jdec,       /* Pointer to the decompression object */
  uint8_t* buff,    /* Pointer to buffer to store the read data */
  size_t ndata      /* Number of bytes to read/remove */
);

Parameters

jdec
Decompression object of this session.
buff
Points the read buffer to store the data read form the input stream. A null pointer specifies to remove the data from the input stream.
ndata
Number of bytes to read/remove from the input stream.

Return Values

Returns number of bytes read/removed. If any value not expected is returned, the jd_prepare and jd_decomp function aborts with JDR_INP.

Description

This function is the data input interface of the TJpgDec module. The corresponding decompression session can be identified by the session identifier jdec->device passed to the 5th argument of jd_prepare function.

Return