Skip to content

Commit

Permalink
Merge branch 'relightlab.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ponchio committed Nov 22, 2024
2 parents 1cc7ef5 + 0d000dc commit 9248344
Show file tree
Hide file tree
Showing 221 changed files with 9,216 additions and 488 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/CreateRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ jobs:
- name: Change Permissions
run: |
chmod +x relightlab_linux_portable/usr/bin/relight
chmod +x relightlab_linux_portable/usr/bin/relightlab
chmod +x relightlab_linux_portable/usr/bin/relight-cli
chmod +x relightlab_linux_portable/usr/bin/relight-merge
chmod +x relightlab_linux_portable/AppRun
Expand Down Expand Up @@ -144,6 +145,7 @@ jobs:
path: relightlab_macos_portable
- name: Change Permissions
run: |
chmod +x relightlab_macos_portable/RelightLab*.app/Contents/MacOS/relightlab
chmod +x relightlab_macos_portable/RelightLab*.app/Contents/MacOS/relight
chmod +x relightlab_macos_portable/RelightLab*.app/Contents/MacOS/relight-cli
chmod +x relightlab_macos_portable/RelightLab*.app/Contents/MacOS/relight-merge
Expand Down
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,17 @@ endif()
if(MSVC)
set(JPEGTURBO_HOME ${CMAKE_CURRENT_SOURCE_DIR}/external/libjpeg-turbo-2.0.6)
set(JPEG_INCLUDE_DIR ${JPEGTURBO_HOME}/include)
set(JPEG_LIBRARIES ${JPEGTURBO_HOME}/lib/jpeg.lib)
set(JPEG_LIBRARIES ${JPEGTURBO_HOME}/lib/jpeg.lib)
else()
find_package (JPEG REQUIRED)
endif()

find_package (TIFF)
if(NOT TIFF_FOUND)
add_subdirectory( ${CMAKE_CURRENT_SOURCE_DIR}/external/tiff-4.7.0)
add_library(TIFF::TIFF ALIAS tiff)
endif()


find_package (TIFF)
if(NOT TIFF_FOUND)
Expand Down Expand Up @@ -78,5 +85,6 @@ endif()
include(GNUInstallDirs)

add_subdirectory(relight)
add_subdirectory(relightlab)
add_subdirectory(relight-cli)
add_subdirectory(relight-merge)
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ $ cmake .
$ make
```


### MacOS

Installed tools:
Expand Down
2 changes: 1 addition & 1 deletion build_scripts/Linux/1_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Requires a Qt environment which is set-up properly, and an accessible
# cmake binary.
#
# Without given arguments, relight will be built in the relight/build
# Without given arguments, relightlab will be built in the relightlab/build
# directory, and installed in $BUILD_PATH/../install.
#
# You can give as argument the BUILD_PATH and the INSTALL_PATH in the
Expand Down
8 changes: 4 additions & 4 deletions build_scripts/Linux/2_deploy.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
# This is a script shell for deploying a relight-portable folder, and an appimage.
# Requires a properly built relight (see 1_build.sh).
# Requires a properly built relightlab (see 1_build.sh).
#
# Without given arguments, the folder that will be deployed is relight/install, which
# should be the path where relight has been installed (default output of 1_build.sh).
# Without given arguments, the folder that will be deployed is relightlab/install, which
# should be the path where relightlab has been installed (default output of 1_build.sh).
#
# You can give as argument the path where you installed relight.
# You can give as argument the path where you installed relightlab.

SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
INSTALL_PATH=$SCRIPTS_PATH/../../install
Expand Down
2 changes: 2 additions & 0 deletions build_scripts/Linux/internal/2a_make_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ done
mkdir -p $INSTALL_PATH/usr/share/applications/
mkdir -p $INSTALL_PATH/usr/share/icons/Yaru/512x512/apps/
cp $SCRIPTS_PATH/resources/relight.desktop $INSTALL_PATH/usr/share/applications/relight.desktop
cp $SCRIPTS_PATH/resources/relightlab.desktop $INSTALL_PATH/usr/share/applications/relightlab.desktop
cp $SCRIPTS_PATH/../relight.png $INSTALL_PATH/usr/share/icons/Yaru/512x512/apps/relight.png

chmod +x $INSTALL_PATH/usr/bin/relight
chmod +x $INSTALL_PATH/usr/bin/relightlab
chmod +x $INSTALL_PATH/usr/bin/relight-cli
chmod +x $INSTALL_PATH/usr/bin/relight-merge
2 changes: 1 addition & 1 deletion build_scripts/Linux/internal/2c_portable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fi
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INSTALL_PATH/usr/lib

if $SCRIPTS_PATH/resources/linuxdeploy --appdir=$INSTALL_PATH --plugin qt; then
echo "$INSTALL_PATH is now a self contained meshlab application"
echo "$INSTALL_PATH is now a self contained relight application"
else
echo "linuxdeploy failed with error code $?. Script was not completed successfully."
exit 1
Expand Down
8 changes: 4 additions & 4 deletions build_scripts/Linux/make_it.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# Requires a Qt environment which is set-up properly, and an accessible
# cmake binary.
#
# Without given arguments, ReLight will be built in the relight/build,
# the folder relight/install will be a portable version of ReLight and
# the AppImage will be placed in the relight folder.
# Without given arguments, RelightLab will be built in the relightlab/build,
# the folder relightlab/install will be a portable version of RelightLab and
# the AppImage will be placed in the relightlab folder.
#
# You can give as argument the build path, the install path (that will contain
# the portable version of ReLight), and the number of cores to use to build ReLight
# the portable version of RelightLab), and the number of cores to use to build RelightLab
# (default: 4).
# The AppImage will be placed in the parent directory of the install path.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Type=Application
Name=RelightLab
GenericName=Image relighting
Comment=Create and view relightable images
Exec=relight %F
Exec=relightlab %F
Icon=relight
Terminal=false
Categories=Graphics;3DGraphics;Viewer;Qt;
Name[en_US]=relight.desktop
Name[en_US]=relightlab.desktop
2 changes: 1 addition & 1 deletion build_scripts/Windows/1_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Requires a VS >= 2017 and Qt environments which are set-up properly,
# and an accessible cmake binary.
#
# Without given arguments, relight will be built in the relight/build
# Without given arguments, relight will be built in the relightlab/build
# directory, and installed in $BUILD_PATH/../install.
#
# You can give as argument the BUILD_PATH and the INSTALL_PATH in the
Expand Down
6 changes: 3 additions & 3 deletions build_scripts/Windows/2_deploy.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
# This is a script shell for deploying a relight-portable folder.
# Requires a properly built relight (see 1_build.sh).
# Requires a properly built relightlab (see 1_build.sh).
#
# Without given arguments, the folder that will be deployed is relight/install.
# Without given arguments, the folder that will be deployed is relightlab/install.
#
# You can give as argument the path where relight is installed.
# You can give as argument the path where relightlab is installed.

SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
INSTALL_PATH=$SCRIPTS_PATH/../../install
Expand Down
2 changes: 2 additions & 0 deletions build_scripts/Windows/internal/2a_portable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ esac
done

${QT_DIR}windeployqt $INSTALL_PATH/relight.exe
${QT_DIR}windeployqt $INSTALL_PATH/relightlab.exe


# remove all .lib files
for file in $(find $INSTALL_PATH -name '*.lib');
Expand Down
3 changes: 2 additions & 1 deletion build_scripts/macOS/0_setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ esac
done


brew install coreutils cmake ninja libomp eigen libjpeg
brew install coreutils cmake ninja libomp eigen libjpeg libtiff

npm install -g appdmg

if [ "$DONT_INSTALL_QT" = false ] ; then
Expand Down
4 changes: 2 additions & 2 deletions build_scripts/macOS/1_build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
# this is a script shell for compiling relight in a MacOS environment.
# this is a script shell for compiling relightlab in a MacOS environment.
# Requires a Qt environment which is set-up properly, and an accessible
# cmake binary.
#
# Without given arguments, relight will be built in the meshlab/src/build
# Without given arguments, relightlab will be built in the relightlab/src/build
# directory, and installed in $BUILD_PATH/../install.
#
# You can give as argument the BUILD_PATH and the INSTALL_PATH in the
Expand Down
2 changes: 1 addition & 1 deletion build_scripts/macOS/internal/2a_appbundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SCRIPTS_PATH="$(dirname "$(realpath "$0")")"/..

INSTALL_PATH=$SCRIPTS_PATH/../../install
QT_DIR=""
APPNAME="relight.app"
APPNAME="relightlab.app"

#checking for parameters
for i in "$@"
Expand Down
2 changes: 1 addition & 1 deletion build_scripts/macOS/internal/2b_sign_appbundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SCRIPTS_PATH="$(dirname "$(realpath "$0")")"/..

INSTALL_PATH=$SCRIPTS_PATH/../../install
CERT_ID=""
APPNAME="relight.app"
APPNAME="relightlab.app"

#checking for parameters
for i in "$@"
Expand Down
2 changes: 1 addition & 1 deletion build_scripts/macOS/internal/2c_notarize_appbundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ INSTALL_PATH=$SCRIPTS_PATH/../../install
NOTAR_USER=""
NOTAR_PASSWORD=""
NOTAR_TEAM_ID=""
APPNAME="relight.app"
APPNAME="relightlab.app"

#checking for parameters
for i in "$@"
Expand Down
2 changes: 1 addition & 1 deletion build_scripts/macOS/internal/2d_dmg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sed "s%INST_PATH%$INSTALL_PATH%g" $SCRIPTS_PATH/resources/dmg_latest.json > $SCR
sed -i '' "s%RL_VERSION%$RL_VERSION%g" $SCRIPTS_PATH/resources/dmg_final.json
sed -i '' "s%SOURCE_PATH%$SOURCE_PATH%g" $SCRIPTS_PATH/resources/dmg_final.json

mv $INSTALL_PATH/relight.app $INSTALL_PATH/RelightLab$RL_VERSION.app
mv $INSTALL_PATH/relightlab.app $INSTALL_PATH/RelightLab$RL_VERSION.app

mkdir $PACKAGES_PATH

Expand Down
4 changes: 2 additions & 2 deletions build_scripts/macOS/make_it.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This is a script shell for compiling and deploying ReLight in a MacOS environment.
# This is a script shell for compiling and deploying RelightLab in a MacOS environment.
#
# Requires a Qt environment which is set-up properly, and an accessible
# cmake binary.
Expand Down Expand Up @@ -41,4 +41,4 @@ esac
done

bash $SCRIPTS_PATH/1_build.sh -b=$BUILD_PATH -i=$INSTALL_PATH $QT_DIR_OPTION $CORES
bash $SCRIPTS_PATH/2_deploy.sh -i=$INSTALL_PATH $QT_DIR_OPTION
bash $SCRIPTS_PATH/2_deploy.sh -i=$INSTALL_PATH $QT_DIR_OPTION
Binary file added build_scripts/relightlab.icns
Binary file not shown.
3 changes: 2 additions & 1 deletion normal_integration/normal_integration.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ HEADERS += \
../src/bni_normal_integration.h


unix:INCLUDEPATH += /usr/include/eigen3
win32:INCLUDEPATH += ../external/eigen-3.4.0/

unix:INCLUDEPATH += /usr/include/eigen3
unix:INCLUDEPATH += ../external/eigen-3.4.0/
unix:LIBS += -lgomp #-liomp5
unix:LIBS += -lgomp -ltiff #-liomp5
unix:QMAKE_CXXFLAGS += -fopenmp


Expand Down
19 changes: 10 additions & 9 deletions relight-cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,16 @@ int main(int argc, char *argv[]) {
cerr << "Invalid resolution (must be 0 or >= 2 && <= 20)!\n" << endl;
return 1;
}
break;
}
case 'P':
builder.pixelSize = atof(optarg);
if(builder.pixelSize <= 0) {
cerr << "Invalid parameter pixelSize (-P): " << optarg << endl;
return 1;
}
break;
break;
}
case 'P':
builder.pixelSize = atof(optarg);
if(builder.pixelSize <= 0) {
cerr << "Invalid parameter pixelSize (-P): " << optarg << endl;
return 1;
}

break;
case 'b': {
string b = optarg;
if(b == "rbf") {
Expand Down
25 changes: 12 additions & 13 deletions relight/dstretchtask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@

void DStretchTask::run()
{
uint32_t minSamples;
uint32_t minSamples;
std::function<bool(QString s, int n)> callback = [this](QString s, int n)->bool { return this->progressed(s, n); };
status = RUNNING;
status = RUNNING;

// Get sample rate
if (hasParameter("min_samples"))
minSamples = (*this)["min_samples"].value.toInt();
else {
error = "Unspecified sample rate";
status = FAILED;
return;
}
// Get sample rate
if (hasParameter("min_samples"))
minSamples = (*this)["min_samples"].value.toInt();
else {
error = "Unspecified sample rate";
status = FAILED;
return;
}

dstretchImage(input_folder, output, minSamples, callback);
status = DONE;
dstretchImage(input_folder, output, minSamples, callback);
status = DONE;
}

2 changes: 1 addition & 1 deletion relight/dstretchtask.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class DStretchTask : public Task
{
public:
DStretchTask(QObject *parent) : Task(parent) {}

virtual ~DStretchTask(){}
virtual void run() override;

};

#endif // DSTRETCHTASK_H
Loading

0 comments on commit 9248344

Please sign in to comment.