miraacq_SetResamplingWavelength
Set the wavelength value of a band to resample to.
int miraacq_SetResamplingWavelength(makernel* pma, int band, double wavelength);
Parameters:
- pma: A pointer to the acquisition kernel returned by miraacq_Init.
- band: The band to set the wavelength to, must be less than the number set with miraacq_SetResamplingWavelengthCount.
- wavelength: The wavelength value in nanometers.
Return value:
MIRA_OK (0) or an error code.
Description:
miraacq_SetResamplingWavelength will set the wavelength of a specific band, the wavelengths need to be between the camera wavelength range (miraacq_GetFrameWavelength). 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));
- }