summaryrefslogtreecommitdiff
path: root/src/qcam/assets/feathericons/align-justify.svg
blob: 0539876ff38de9f17626022b6d14845c8c709027 (plain)
1
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-align-justify"><line x1="21" y1="10" x2="3" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="21" y1="18" x2="3" y2="18"></line></svg>
class="hl kwa">using libcamera::utils::Duration; using namespace std::literals::chrono_literals; class CamHelperImx296 : public CamHelper { public: CamHelperImx296(); uint32_t gainCode(double gain) const override; double gain(uint32_t gainCode) const override; uint32_t exposureLines(Duration exposure) const override; Duration exposure(uint32_t exposureLines) const override; private: static constexpr uint32_t maxGainCode = 239; static constexpr Duration timePerLine = 550.0 / 37.125e6 * 1.0s; /* * Smallest difference between the frame length and integration time, * in units of lines. */ static constexpr int frameIntegrationDiff = 4; }; CamHelperImx296::CamHelperImx296() : CamHelper(nullptr, frameIntegrationDiff) { } uint32_t CamHelperImx296::gainCode(double gain) const { uint32_t code = 20 * std::log10(gain) * 10; return std::min(code, maxGainCode); } double CamHelperImx296::gain(uint32_t gainCode) const { return std::pow(10.0, gainCode / 200.0); } uint32_t CamHelperImx296::exposureLines(Duration exposure) const { return (exposure - 14.26us) / timePerLine; } Duration CamHelperImx296::exposure(uint32_t exposureLines) const { return exposureLines * timePerLine + 14.26us; } static CamHelper *create() { return new CamHelperImx296(); } static RegisterCamHelper reg("imx296", &create);