Enables or disables resampling.


int miraacq_SetResampling(makernelpma, int enable);


Parameters:

  • pma: A pointer to the acquisition kernel returned by miraacq_Init.
  • enable: 1 to enable resampling, 0 to disable it.


Return value:

MIRA_OK (0) or an error code.


Description:

miraacq_SetResampling can enable resampling once it is set up using miraacq_SetResamplingWavelengthCount and miraacq_SetResamplingWavelength. Resampling requires that the camera is able to retrieve wavelengths (miraacq_CanReturnWavelengths).


Example:

Note the MIRAACQ_CHECK macro, which will check if the return value was MIRA_OK (0) or an error code. In case of an error code, it will jump to a label called Error.


  1. int bands = ((1000 - 400) / 2) + 1; // + 1 is used to keep the final (1000 nm) band
  2. MIRAACQ_CHECK(miraacq_SetResamplingWavelengthCount(pma, bands));
  3. for (int i = 0; i < bands; i++) {
  4.     MIRAACQ_CHECK(miraacq_SetResamplingWavelength(pma, i, 400 + (2 * i)));
  5. }
  6. MIRAACQ_CHECK(miraacq_SetResampling(pma, 1));

  7. Error:
  8. if (res != MIRA_OK) {
  9.     printf("Error %d: %s", miraacq_GetErrorCode(pma), miraacq_GetErrorMsg(pma));
  10. }