Full_process.cpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //HDR READER
  2. //https://www.flipcode.com/archives/HDR_Image_Reader.shtml
  3. #include "pch.h"
  4. #include <iostream>
  5. #include <chrono>
  6. #include <cstdlib>
  7. #include <vector>
  8. #include <ctime>
  9. #include <Eigen/Core>
  10. #include <unsupported/Eigen/Splines>
  11. #include "ImageHDR.hpp"
  12. #include "YCurve.hpp"
  13. #include "Conversion.hpp"
  14. #include "Full_process.hpp"
  15. float* full_process(float* data, unsigned int width, unsigned int height,
  16. float exposure,
  17. float contrast,
  18. float yCs, float yCb, float yCm, float yCw, float yCh,
  19. bool lms, bool lmb, bool lmm, bool lmw, bool lmh,
  20. float saturation,
  21. float ce_sel_light_l, float ce_sel_light_h, float ce_sel_chr_l, float ce_sel_chr_h, float ce_sel_hue_l, float ce_sel_hue_h, float ce_tol, float ce_edit_hue, float ce_edit_expo, float ce_edit_con, float ce_edit_sat, bool ce_mask)
  22. {
  23. ImageHDR img(data, width, height);
  24. // ******************************************
  25. img.exposure(exposure);
  26. // ******************************************
  27. // ******************************************
  28. img.contrast(contrast);
  29. // ******************************************
  30. // ******************************************
  31. img.yCurve(yCs, yCb, yCm, yCw, yCh);
  32. // ******************************************
  33. // ******************************************
  34. img.lightnessMask(lms, lmb, lmm, lmw, lmh);
  35. // ******************************************
  36. // ******************************************
  37. img.saturation(saturation);
  38. // ******************************************
  39. // ******************************************
  40. float sel_light[2] = {ce_sel_light_l, ce_sel_light_h};
  41. float sel_chr[2] = {ce_sel_chr_l, ce_sel_chr_h};
  42. float sel_hue[2] = {ce_sel_hue_l, ce_sel_hue_h};
  43. img.colorEditor(sel_light, sel_chr, sel_hue, ce_tol, ce_edit_hue, ce_edit_expo, ce_edit_con, ce_edit_sat, ce_mask);
  44. // ******************************************
  45. float *ret = new float[width*height*3];
  46. memcpy(ret, img.data, width * height * 3 * sizeof(float));
  47. return ret;
  48. }