Parcourir la source

Modification pour rendre HDRip compatible avec linux

Rémi Synave il y a 2 ans
Parent
commit
4fde7d164e
3 fichiers modifiés avec 56 ajouts et 1 suppressions
  1. 31 1
      HDRip/all_processings.hpp
  2. 2 0
      HDRip/pch.h
  3. 23 0
      Makefile

+ 31 - 1
HDRip/all_processings.hpp

@@ -20,6 +20,8 @@
 #ifndef ALL_PROCESSINGS__HPP
 #define ALL_PROCESSINGS__HPP
 
+#ifndef _LINUX
+
 #ifdef HDRIP_EXPORTS
 #define HDRIP_API __declspec(dllexport)
 #else
@@ -48,4 +50,32 @@ extern "C" {
     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);
 }
 
-#endif
+
+#else
+
+
+extern "C" {
+  float* exposure(float* data, unsigned int width, unsigned int height, float exposure);
+
+  float* contrast(float* data, unsigned int width, unsigned int height, float contrast);
+
+  float* yCurve(float* data, unsigned int width, unsigned int height, float yCs, float yCb, float yCm, float yCw, float yCh);
+
+  float* lightnessMask(float* data, unsigned int width, unsigned int height, bool lms, bool lmb, bool lmm, bool lmw, bool lmh);
+
+  float* saturation(float* data, unsigned int width, unsigned int height, float saturation);
+
+  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);
+
+  float* full_process(float* data, unsigned int width, unsigned int height,
+    float exposure,
+    float contrast,
+    float yCs, float yCb, float yCm, float yCw, float yCh,
+    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);
+}
+
+#endif
+
+#endif

+ 2 - 0
HDRip/pch.h

@@ -27,6 +27,8 @@
 #define PCH_H
 
 // ajouter les en-têtes à précompiler ici
+#ifndef _LINUX
 #include "framework.h"
+#endif
 
 #endif //PCH_H

+ 23 - 0
Makefile

@@ -0,0 +1,23 @@
+CXX = g++
+MT = -D_MT_=8
+LINUX = -D_LINUX
+INCLUDE = -I. -I/HDRip/
+CXXFLAGS = -Wall -O3 $(MT) $(LINUX) -D_REENTRANT -fPIC
+LDLIBS = -lm
+
+
+TARGET_O = HDRip/all_processings.o HDRip/Conversion.o HDRip/ImageHDR.o HDRip/Utils.o HDRip/YCurve.o
+
+TARGET = HDRip.so
+
+
+all : $(TARGET)
+
+$(TARGET) : $(TARGET_O)
+	$(CXX) -shared -Wl,-soname,$(TARGET) -o $(TARGET) $(TARGET_O)
+
+%.o : %.cpp
+	$(CXX) $(CXXFLAGS) $(INCLUDE) -c $< -o $@
+
+clean :
+	rm -f *~ $(TARGET_O) $(TARGET)