Skip to content
Snippets Groups Projects
Commit 6b653ed6 authored by Valerio Mariani's avatar Valerio Mariani
Browse files

Dealing with QT dependencies in the img modules (when info support is off)

parent 331b1b0e
Branches
Tags
No related merge requests found
......@@ -94,7 +94,9 @@ line_average.hh
rscrosscorr.hh
)
if(ENABLE_INFO)
include(${QT_USE_FILE})
endif()
module(NAME img_alg SOURCES "${OST_IMG_ALG_SOURCES}"
HEADERS "${OST_IMG_ALG_HEADERS}"
HEADER_OUTPUT_DIR ost/img/alg
......
......@@ -25,8 +25,12 @@
#include <boost/shared_ptr.hpp>
#include <fftw3.h>
#if OST_INFO_ENABLED
#include <QThread>
#define IDEAL_NUMBER_OF_THREADS() QThread::idealThreadCount()
#else
#define IDEAL_NUMBER_OF_THREADS() 1
#endif
#include <ost/message.hh>
#include <ost/img/value_util.hh>
#include <ost/img/image_state/image_state_def.hh>
......@@ -130,7 +134,7 @@ reinterpret_cast<OST_FFTW_fftw_complex*>(out_state->Data().GetData());
for(size_t i=0;i<block_count;i++) {
std::copy(&in_ptr[i*src_size],&in_ptr[(i+1)*src_size],&fftw_in[i*2*dst_size]);
}
OST_FFTW_fftw_plan_with_nthreads(std::max<int>(1,QThread::idealThreadCount()));
OST_FFTW_fftw_plan_with_nthreads(std::max<int>(1,IDEAL_NUMBER_OF_THREADS()));
OST_FFTW_fftw_plan plan = OST_FFTW_fftw_plan_dft_r2c(rank,n,
fftw_in,fftw_out,
FFTW_ESTIMATE);
......@@ -213,7 +217,7 @@ ImageStateBasePtr FFTFnc::VisitState<Complex,HalfFrequencyDomain>(const ComplexH
Real* fftw_out = reinterpret_cast<Real*>(out_ptr);
assert(sizeof(OST_FFTW_fftw_complex)==sizeof(Complex));
OST_FFTW_fftw_plan_with_nthreads(std::max<int>(1,QThread::idealThreadCount()));
OST_FFTW_fftw_plan_with_nthreads(std::max<int>(1,IDEAL_NUMBER_OF_THREADS()));
OST_FFTW_fftw_complex* fftw_in =
reinterpret_cast<OST_FFTW_fftw_complex*>(out_ptr);
......@@ -259,7 +263,7 @@ ImageStateBasePtr FFTFnc::VisitState<Complex,SpatialDomain>(const ComplexSpatial
reinterpret_cast<OST_FFTW_fftw_complex*>(out_state->Data().GetData());
// in place transform
OST_FFTW_fftw_plan_with_nthreads(std::max<int>(1,QThread::idealThreadCount()));
OST_FFTW_fftw_plan_with_nthreads(std::max<int>(1,IDEAL_NUMBER_OF_THREADS()));
OST_FFTW_fftw_plan plan = OST_FFTW_fftw_plan_dft(rank,n,
fftw_out, fftw_out,
dir,
......@@ -297,7 +301,7 @@ ImageStateBasePtr FFTFnc::VisitState<Complex,FrequencyDomain>(const ComplexFrequ
reinterpret_cast<OST_FFTW_fftw_complex*>(out_state->Data().GetData());
// in place transform
OST_FFTW_fftw_plan_with_nthreads(std::max<int>(1,QThread::idealThreadCount()));
OST_FFTW_fftw_plan_with_nthreads(std::max<int>(1,IDEAL_NUMBER_OF_THREADS()));
OST_FFTW_fftw_plan plan = OST_FFTW_fftw_plan_dft(rank,n,
fftw_out, fftw_out,
dir,
......
......@@ -94,6 +94,7 @@ map.hh
if (ENABLE_INFO)
list(APPEND OST_IMG_SOURCES mask_info_convert.cc)
list(APPEND OST_IMG_HEADERS mask_info_convert.hh)
set(INFO_DEPS ost_info)
endif()
foreach(fname ${OST_IMG_IMAGE_STATE_SOURCES})
......@@ -108,4 +109,4 @@ module(NAME img SOURCES "${OST_IMG_SOURCES}"
HEADERS ${OST_IMG_RASTER_IMAGE_HEADERS} IN_DIR raster_image
${OST_IMG_IMAGE_STATE_HEADERS} IN_DIR image_state
${OST_IMG_HEADERS}
DEPENDS_ON ost_geom ost_base ost_info)
DEPENDS_ON ost_geom ost_base ${INFO_DEPS})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment