Thank you Jimmy for the answer, I did not notice the code has rescaled the intensity of the image pixels.
On the other hand, I still would like to know how to check and set the AGC and radiometry modes in software. For AGC, I followed the Lepton SDK code, and tried to use the LEP_GetAgcEnableState() function like this:
LEP_OpenPort(1, LEP_CCI_TWI, 400, &_port);
LEP_RESULT lep_res;
LEP_AGC_ENABLE_E_PTR lep_ptr;
lep_ptr = (LEP_AGC_ENABLE_E_PTR)malloc(sizeof(int));
lep_res = LEP_GetAgcEnableState(&_port, lep_ptr);
However it did not work, and I got an error LEP_ERROR_I2C_FAIL. The problem is when the function LEP_GetAgcEnableState() calls this line in the function DEV_I2C_MasterReadData() in raspi_I2C.c:
int writeValue = write(leptonDevice, txdata, bytesToWrite);
It failed with an errno EBADF. And I further checked, and found that LEP_OpenPort(1, LEP_CCI_TWI, 400, &_port); has failed too with the errno ENETRESET, hence making the _port.portID being 0. What was wrong? Is that I should provide another port nnumber apart from 1 in LEP_OpenPort()?