miraacq_SetResampling
Enables or disables resampling.
int miraacq_SetResampling(makernel* pma, 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.
- int bands = ((1000 - 400) / 2) + 1; // + 1 is used to keep the final (1000 nm) band
- MIRAACQ_CHECK(miraacq_SetResamplingWavelengthCount(pma, bands));
- for (int i = 0; i < bands; i++) {
- MIRAACQ_CHECK(miraacq_SetResamplingWavelength(pma, i, 400 + (2 * i)));
- }
- MIRAACQ_CHECK(miraacq_SetResampling(pma, 1));
- Error:
- if (res != MIRA_OK) {
- printf("Error %d: %s", miraacq_GetErrorCode(pma), miraacq_GetErrorMsg(pma));
- }