hdr_synthesis.h 877 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef HDRSYNTHESIS_HDR_SYNTHESIS_H
  2. #define HDRSYNTHESIS_HDR_SYNTHESIS_H
  3. #include <opencv2/core/cuda.hpp>
  4. #include <cstdint>
  5. #include <memory>
  6. static constexpr auto default_pyramid_level = 6;
  7. class hdr_buffer;
  8. // TODO: use half precision float point number to further optimize
  9. class hdr_synthesizer {
  10. public:
  11. explicit hdr_synthesizer(cv::Size size, uint8_t pyramid_level = default_pyramid_level,
  12. cv::cuda::Stream &stream = cv::cuda::Stream::Null());
  13. ~hdr_synthesizer();
  14. hdr_buffer *malloc_buffer(); // per image buffer
  15. static void free_buffer(hdr_buffer *buf);
  16. void preprocess_image(hdr_buffer *buf, cv::InputArray img_dev);
  17. void merge_image(hdr_buffer *buf_a, hdr_buffer *buf_b, cv::OutputArray img_dev_out);
  18. private:
  19. struct impl;
  20. std::unique_ptr<impl> pimpl;
  21. };
  22. #endif //HDRSYNTHESIS_HDR_SYNTHESIS_H