Parcourir la source

Ajout de toutes les méthodes

Rémi Synave il y a 2 ans
Parent
commit
4afed16d43
5 fichiers modifiés avec 93 ajouts et 2 suppressions
  1. 74 0
      HDRip/Full_process.cpp
  2. 12 2
      HDRip/Full_process.hpp
  3. 1 0
      HDRip/HDRip.vcxproj
  4. 1 0
      HDRip/HDRip.vcxproj.filters
  5. 5 0
      HDRip/cpp.hint

+ 74 - 0
HDRip/Full_process.cpp

@@ -33,6 +33,80 @@ float* exposure(float* data, unsigned int width, unsigned int height, float expo
 
 
 
+float* contrast(float* data, unsigned int width, unsigned int height, float constrast)
+{
+  ImageHDR img(data, width, height);
+
+  img.contrast(constrast);
+
+  float* ret = new float[width * height * 3];
+  memcpy(ret, img.data, width * height * 3 * sizeof(float));
+
+  return ret;
+}
+
+
+
+float* yCurve(float* data, unsigned int width, unsigned int height, float yCs, float yCb, float yCm, float yCw, float yCh)
+{
+  ImageHDR img(data, width, height);
+
+  img.yCurve(yCs, yCb, yCm, yCw, yCh);
+
+  float* ret = new float[width * height * 3];
+  memcpy(ret, img.data, width * height * 3 * sizeof(float));
+
+  return ret;
+}
+
+
+
+float* lightnessMask(float* data, unsigned int width, unsigned int height, bool lms, bool lmb, bool lmm, bool lmw, bool lmh)
+{
+  ImageHDR img(data, width, height);
+
+  img.lightnessMask(lms, lmb, lmm, lmw, lmh);
+
+  float* ret = new float[width * height * 3];
+  memcpy(ret, img.data, width * height * 3 * sizeof(float));
+
+  return ret;
+}
+
+
+
+float* saturation(float* data, unsigned int width, unsigned int height, float saturation)
+{
+  ImageHDR img(data, width, height);
+
+  img.saturation(saturation);
+
+  float* ret = new float[width * height * 3];
+  memcpy(ret, img.data, width * height * 3 * sizeof(float));
+
+  return ret;
+}
+
+
+
+float* colorEditor(float* data, unsigned int width, unsigned int height, 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)
+{
+  ImageHDR img(data, width, height);
+
+  float sel_light[2] = { ce_sel_light_l, ce_sel_light_h };
+  float sel_chr[2] = { ce_sel_chr_l, ce_sel_chr_h };
+  float sel_hue[2] = { ce_sel_hue_l, ce_sel_hue_h };
+
+  img.colorEditor(sel_light, sel_chr, sel_hue, ce_tol, ce_edit_hue, ce_edit_expo, ce_edit_con, ce_edit_sat, ce_mask);
+
+  float* ret = new float[width * height * 3];
+  memcpy(ret, img.data, width * height * 3 * sizeof(float));
+
+  return ret;
+}
+
+
+
 float* full_process(float* data, unsigned int width, unsigned int height,
   float exposure,
   float contrast,

+ 12 - 2
HDRip/Full_process.hpp

@@ -8,6 +8,18 @@
 #endif
 
 extern "C" {
+  HDRIP_API float* exposure(float* data, unsigned int width, unsigned int height, float exposure);
+
+  HDRIP_API float* contrast(float* data, unsigned int width, unsigned int height, float contrast);
+
+  HDRIP_API float* yCurve(float* data, unsigned int width, unsigned int height, float yCs, float yCb, float yCm, float yCw, float yCh);
+
+  HDRIP_API float* lightnessMask(float* data, unsigned int width, unsigned int height, bool lms, bool lmb, bool lmm, bool lmw, bool lmh);
+
+  HDRIP_API float* saturation(float* data, unsigned int width, unsigned int height, float saturation);
+
+  HDRIP_API float* colorEditor(float* data, unsigned int width, unsigned int height, 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);
+
   HDRIP_API float* full_process(float* data, unsigned int width, unsigned int height,
     float exposure,
     float contrast,
@@ -15,8 +27,6 @@ extern "C" {
     bool lms, bool lmb, bool lmm, bool lmw, bool lmh,
     float saturation,
     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);
-
-  HDRIP_API float* exposure(float* data, unsigned int width, unsigned int height, float exposure);
 }
 
 #endif

+ 1 - 0
HDRip/HDRip.vcxproj

@@ -190,6 +190,7 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="..\README.md" />
+    <None Include="cpp.hint" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">

+ 1 - 0
HDRip/HDRip.vcxproj.filters

@@ -92,5 +92,6 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="..\README.md" />
+    <None Include="cpp.hint" />
   </ItemGroup>
 </Project>

+ 5 - 0
HDRip/cpp.hint

@@ -0,0 +1,5 @@
+// Les fichiers hint permettent à l'IDE Visual Studio d'interpréter les identificateurs Visual C++
+// tels que les noms de fonctions et de macros.
+// Pour plus d'informations, consultez https://go.microsoft.com/fwlink/?linkid=865984
+#define HDRIP_API __declspec(dllexport)
+#define HDRIP_API __declspec(dllimport)